Downloadable Product Permission Issue – Grant Access automatically

When I order downloadable products, I can’t see them in my downloads page. When I checked the order details in the admin side, I saw that the downloadable product permissions part is blank even if the status of my order is completed.

I used paypal sandbox for testing. The order status was initially on-hold, and then I changed it to completed.

My functions.php:

function has_bought_item( $  product_id ) { global $  wpdb;  if( ! is_user_logged_in() )     return false;  $  current_user = wp_get_current_user();  $  statuses      = array_map( 'esc_sql', wc_get_is_paid_statuses() );  // Count the number of products $  count_query = $  wpdb->get_var( "     SELECT COUNT(woim.meta_value) FROM {$  wpdb->prefix}posts AS p     INNER JOIN {$  wpdb->prefix}postmeta AS pm ON p.ID = pm.post_id     INNER JOIN {$  wpdb->prefix}woocommerce_order_items AS woi ON p.ID = woi.order_id     INNER JOIN {$  wpdb->prefix}woocommerce_order_itemmeta AS woim ON woi.order_item_id = woim.order_item_id     WHERE p.post_status IN ( 'wc-" . implode( "','wc-", $  statuses ) . "' )     AND pm.meta_key = '_customer_user' AND pm.meta_value = $  current_user->ID     AND woim.meta_key IN ( '_product_id', '_variation_id' )     AND woim.meta_value = $  product_id " ); // Return true boolean value if count is higher than 0, if not false return $  count_query > 0 ? true : false; }  // Shop and archives - Replace add to cart ajax button to a custom linked button add_filter( 'woocommerce_loop_add_to_cart_link', 'replace_loop_add_to_cart', 20, 2 ); function replace_loop_add_to_cart( $  html, $  product ) { if( has_bought_item( $  product->get_id() ) ) {          $  text = __("Download", "woocommerce");          $  user_id = get_current_user_id();     $  downloads = wc_get_customer_available_downloads($  user_id);      if (!empty($  downloads)) {         foreach ($  downloads as $  download) {             if ($  download['product_id'] === $  product->get_id()) {                 $  link = $  download['download_url'];             }         }     }      $  html = '<a href="' . $  link . '" class="button alt add_to_cart_button">' . $  text . '</a>'; } return $  html; }  function add_completed_status_to_download_permission($  data, $  order) { if ( $  order->has_status( 'completed' ) ) { return true; } return $  data; } add_filter('woocommerce_order_is_download_permitted', 'add_completed_status_to_download_permission', 10, 2); 

My system status report:

### WordPress Environment ### WordPress address (URL): https://stg.myscrapchick.com Site address (URL): https://stg.myscrapchick.com WC Version: 4.3.1 REST API Version: ✔ 1.0.10 WC Blocks Version: ✔ 2.7.2 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 1.3.1 Log Directory Writable: ✔ WP Version: 5.4.2 WP Multisite: – WP Memory Limit: 2 GB WP Debug Mode: – WP Cron: – Language: en_US External object cache: –  ### Server Environment ###  Server Info: Apache PHP Version: 7.3.17 PHP Post Max Size: 2 GB PHP Time Limit: 600 PHP Max Input Vars: 16384 cURL Version: 7.29.0 NSS/3.44  SUHOSIN Installed: – MySQL Version: 5.5.5-10.2.31-MariaDB Max Upload Size: 2 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔  ### Database ###  WC Database Version: 4.3.1 WC Database Prefix: wp_ Total Database Size: 4286.03MB Database Data Size: 2622.78MB Database Index Size: 1663.25MB wp_woocommerce_sessions: Data: 0.54MB + Index: 0.02MB + Engine MyISAM wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_downloadable_product_permissions: Data: 196.98MB + Index: 184.73MB + Engine MyISAM wp_woocommerce_order_items: Data: 80.96MB + Index: 44.21MB + Engine MyISAM wp_woocommerce_order_itemmeta: Data: 643.68MB + Index: 440.29MB + Engine MyISAM wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_actionscheduler_actions: Data: 1.55MB + Index: 0.58MB + Engine MyISAM wp_actionscheduler_claims: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_actionscheduler_groups: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_actionscheduler_logs: Data: 1.14MB + Index: 0.91MB + Engine MyISAM wp_commentmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_comments: Data: 2.17MB + Index: 1.23MB + Engine MyISAM wp_email_log: Data: 152.56MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ninja_table_items: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 6.19MB + Index: 0.21MB + Engine MyISAM wp_postmeta: Data: 1251.84MB + Index: 837.68MB + Engine MyISAM wp_posts: Data: 140.07MB + Index: 45.37MB + Engine MyISAM wp_ppgc_categories: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_ppgc_customers: Data: 2.09MB + Index: 2.91MB + Engine MyISAM wp_ppgc_orders: Data: 28.50MB + Index: 22.76MB + Engine MyISAM wp_ppgc_products: Data: 0.18MB + Index: 0.26MB + Engine MyISAM wp_simple_history: Data: 7.52MB + Index: 4.03MB + Engine InnoDB wp_simple_history_contexts: Data: 34.56MB + Index: 26.08MB + Engine InnoDB wp_termmeta: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_terms: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_term_relationships: Data: 0.21MB + Index: 0.42MB + Engine MyISAM wp_term_taxonomy: Data: 0.02MB + Index: 0.01MB + Engine MyISAM wp_tinvwl_analytics: Data: 1.52MB + Index: 0.36MB + Engine InnoDB wp_tinvwl_items: Data: 0.44MB + Index: 0.00MB + Engine InnoDB wp_tinvwl_lists: Data: 0.14MB + Index: 0.00MB + Engine InnoDB wp_usermeta: Data: 56.78MB + Index: 45.81MB + Engine MyISAM wp_users: Data: 2.85MB + Index: 2.79MB + Engine MyISAM wp_wcpv_commissions: Data: 0.30MB + Index: 0.00MB + Engine InnoDB wp_wcpv_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_notes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_admin_note_actions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_category_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_customer_lookup: Data: 0.19MB + Index: 0.14MB + Engine MyISAM wp_wc_download_log: Data: 0.60MB + Index: 0.50MB + Engine MyISAM wp_wc_order_coupon_lookup: Data: 0.04MB + Index: 0.06MB + Engine MyISAM wp_wc_order_product_lookup: Data: 0.81MB + Index: 0.60MB + Engine MyISAM wp_wc_order_stats: Data: 0.16MB + Index: 0.14MB + Engine MyISAM wp_wc_order_tax_lookup: Data: 0.05MB + Index: 0.05MB + Engine MyISAM wp_wc_product_meta_lookup: Data: 0.16MB + Index: 0.20MB + Engine MyISAM wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfblockediplog: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wfblocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfconfig: Data: 1.39MB + Index: 0.00MB + Engine InnoDB wp_wfcrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wffilechanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wffilemods: Data: 2.52MB + Index: 0.00MB + Engine InnoDB wp_wfhits: Data: 1.52MB + Index: 0.28MB + Engine InnoDB wp_wfhoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfknownfilelist: Data: 1.52MB + Index: 0.00MB + Engine InnoDB wp_wflivetraffichuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wflocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wflogins: Data: 0.47MB + Index: 0.16MB + Engine InnoDB wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfnotifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfpendingissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfreversecache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfsnipcache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfstatus: Data: 0.13MB + Index: 0.09MB + Engine InnoDB wp_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB  ### Post Type Counts ###  attachment: 8211 ctct_forms: 3 ctct_lists: 5 custom_css: 2 customize_changeset: 36 elementor_library: 20 nav_menu_item: 9 page: 18 post: 160 product: 2533 revision: 410 shop_coupon: 19 shop_order: 577585 shop_order_refund: 34  ### Security ###  Secure connection (HTTPS): ✔ Hide errors from visitors: ✔  ### Active Plugins (26) ###  ManageWP - Worker: by GoDaddy – 4.9.6 WC Thanks Redirect: by Nitin Prakash – 2.2 – Installed version not tested with active version of WooCommerce 4.3.1 Better Search Replace: by Delicious Brains – 1.3.3 Classic Editor: by WordPress Contributors – 1.5 Constant Contact Forms for WordPress: by Constant Contact – 1.8.5 Login/Signup Popup ( Inline Form + Woocommerce ): by XootiX – 2.0 – Installed version not tested with active version of WooCommerce 4.3.1 Elementor Pro: by Elementor.com – 2.9.5 Elementor: by Elementor.com – 2.9.13 Email Log: by Sudar – 2.3.2 Site Kit by Google: by Google – 1.10.0 Grant download permissions for past WooCommerce orders: by Claudio Sanches – 0.0.2 – Installed version not tested with active version of WooCommerce 4.3.1 Insert Headers and Footers: by WPBeginner – 1.4.5 Kadence WooCommerce Email Designer: by Kadence WP – 1.4.2 – Installed version not tested with active version of WooCommerce 4.3.1 Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.3 Remove Widget Titles: by Stephen Cronin – 1.0 Simple CSS: by Tom Usborne – 1.1.1 Simple History: by Pär Thernström – 2.34.0 Smoother: by Merkulove – 1.0.5 User Menus: by Code Atlantic – 1.2.3 WP Sheet Editor - WooCommerce Products (Premium): by WP Sheet Editor – 1.5.0 – Installed version not tested with active version of WooCommerce 4.3.1 Woo Title Limit: by Dima W. – 2.0.0 – Installed version not tested with active version of WooCommerce 4.3.1 WooCommerce Product Vendors: by WooCommerce – 2.1.32 – Installed version not tested with active version of WooCommerce 4.3.1 WooCommerce: by Automattic – 4.3.1 Wordfence Security: by Wordfence – 7.4.8 WordPress Importer: by wordpressdotorg – 0.7 WP Mail SMTP: by WPForms – 2.1.1  ### Inactive Plugins (5) ###  Already In Cart / Already Purchased: by MyThemeShop – 1.0.2 – Installed version not tested with active version of WooCommerce 4.3.1 TI WooCommerce Wishlist: by TemplateInvaders – 1.20.5 – Installed version not tested with active version of WooCommerce 4.3.1 WooCommerce Products Layout for Elementor: by AD-Theme – 1.0 – Installed version not tested with active version of WooCommerce 4.3.1 WP DataTable: by Samuel Behan – 0.2.5 WP Super Cache: by Automattic – 1.7.1  ### Must Use Plugins (2) ###  ManageWP - Worker Loader: by GoDaddy – Nexcess Managed Apps: by Nexcess – 1.9.1  ### Settings ###  API Enabled: ✔ Force SSL: – Currency: USD ($  ) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable)  Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5)  Connected to WooCommerce.com: –  ### WC Pages ###  Shop base: #5 - /shop/ Cart: ❌ Page does not contain the shortcode. Checkout: ❌ Page does not contain the shortcode. My account: ❌ Page does not contain the shortcode. Terms and conditions: #577437 - /terms-of-use-copyright/  ### Theme ###  Name: GeneratePress Child Version: 0.1 Author URL: https://tomusborne.com Child Theme: ✔ Parent Theme Name: GeneratePress Parent Theme Version: 2.4.2 Parent Theme Author URL: https://tomusborne.com WooCommerce Support: ✔  ### Templates ###  Overrides: generatepress_child/woocommerce/order/order-downloads.php generatepress_child/woocommerce/single-product/add-to-cart/simple.php  ### Action Scheduler ###  Complete: 6,179 Oldest: 2020-05-26 17:41:33 -0400 Newest: 2020-08-06 16:19:38 -0400 

I know we can manually grant access per order but access should be granted automatically, right? any help is highly appreciated.

Code to Update Prices and add them for Woocommerce Custom Product Variations Loop

I am actually struggling with some custom functions. Actually My aim is the following: Create 2 custom fields in a woocommerce variable product backend ✔ Show these custom fields text and prices in frontend Make able to add the product in the cart with these prices summed up.

I don’t know which hook I am using wrong and why the theme ajax doesn’t work. There is someone that can assist?

"Working" (I hope) Code

// Aggiunte campi asseverazione, legalizzazione Variazioni nel backend add_action( 'woocommerce_variation_options_pricing', 'add_variation_options_pricing_assev', 10, 3 ); function add_variation_options_pricing_assev( $  loop, $  variation_data, $  variation ){      woocommerce_wp_text_input( array(         'id' => '_assev_'.$  loop,         'wrapper_class' => 'form-row form-row-first',         'class' => 'short wc_input_price',         'label' => __( 'Asseverazione', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',         'value' => wc_format_localized_price( get_post_meta( $  variation->ID, '_assev', true ) ),         'data_type' => 'price',     ) );     woocommerce_wp_text_input( array(         'id' => '_legal_'.$  loop,         'wrapper_class' => 'form-row form-row-last',         'class' => 'short wc_input_price',         'label' => __( 'Legalizzazione', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',         'value' => wc_format_localized_price( get_post_meta( $  variation->ID, '_legal', true ) ),         'data_type' => 'price',     ) );      }  // Salvataggio in backend add_action( 'woocommerce_save_product_variation','save_variation_options_pricing_assev', 10, 2 ); function save_variation_options_pricing_assev( $  variation_id, $  loop ){     if( isset($  _POST['_assev_'.$  loop]))         update_post_meta( $  variation_id, '_assev', wc_clean( wp_unslash( str_replace( ',', '.', $  _POST['_assev_'.$  loop] ) ) ) );     if( isset($  _POST['_legal_'.$  loop]))         update_post_meta( $  variation_id, '_legal', wc_clean( wp_unslash( str_replace( ',', '.', $  _POST['_legal_'.$  loop] ) ) ) ); }  // Frontend (mi manca di aggiungere la legalizzazione) add_filter( 'woocommerce_available_variation', 'display_variation_assev', 10, 3 );  function display_variation_assev( $  data, $  product, $  variation ) {      if( $  assev = $  variation->get_meta('_assev') ) {         $  data['price_html'] = '<div class="woocommerce_assev">' . __( 'Asseverazione: ', 'woocommerce' ) .         '<span class="asseverazione-prezzo">' . wc_price( $  assev ) . '</span></div>' . $  data['price_html'];     }      return $  data; } 

Code Struggle:

/*add_filter( 'woocommerce_add_cart_item', 'aggiorna_prezzi_nuova', 10, 2 ); function aggiorna_prezzi_nuova( $  cart_item_data, $  cart_item_key, $  variation) {                if( isset( $  _POST['_assev_'][$  variation_id] ) )         $  cart_item_data['_assev'][$  variation_id] = $  _POST['_assev'][$  variation_id];     if(isset( $  _POST['_legal'] ) )        $  cart_item_data['_legal'] = $  _POST['_legal'];      return $  cart_item_data; }   add_action( 'woocommerce_before_calculate_totals', 'fissa_valore_var_carrello', 20, 1 ); function fissa_valore_var_carrello( $  cart ) {     if ( is_admin() && ! defined( 'DOING_AJAX' ) )         return;      if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 )         return;      // First loop to check if product 11 is in cart     foreach ( $  cart->get_cart() as $  cart_item ){         if( isset($  cart_item['_assev']) && isset($  cart_item['_legal'])          && ! empty($  cart_item['_assev']) && ! empty($  cart_item['_legal']) )             $  cart_item['data']->set_price( '30' );     } }*/ 

Other non functional code:

function aggiorna_prezzo( $  price, $  product ) {         $  shortcost_first = get_post_meta( $  variation->id, '_assev_0', true );    $  shortcost_mid = get_post_meta( $  product->id, '_assev_0', true );   $  shortcost_minimum = get_post_meta( $  product->id, 'assev_0', true );        $  unit_price = $  assev + $  shortcost_mid + $  shortcost_first + $  shortcost_minimum; //     +($  shortcost_mid * ($  shortcost_minimum - 1));    return $  price + $  unit_price;       } add_filter('woocommerce_get_price', 'aggiorna_prezzo', 10, 3); add_filter('woocommerce_get_regular_price','aggiorna_prezzo', 10, 3); add_filter('woocommerce_get_sale_price','aggiorna_prezzo', 10, 3); 

Thank you!

Given an array $a$, we have to find product of $a_{j}$-$a_{i}$ modulo $998244353$ over all $i$ and $j$ given $j>i$

Given an array $ a$ , we have to find product of $ a_{j}$ $ a_{i}$ modulo $ 998244353$ over all $ i$ and $ j$ given $ j>i$ .
For eg. Let the array be $ 1,2,3$ then my answer will be calculated as-
$ (2-1)$ .$ (3-1)$ .$ (3-2)$ =$ 2$
As number of elements in the array could be large (upto $ 10^5$ ) I am looking for solution of order $ nlogn$ .
I have tried representing array as a polynomial but could get anything out of it. Please help.

Minimize the maximum inner product with vectors in a given set

Given a set $ S$ of non-negative unit vectors in $ \mathbb R_+^n$ , find a non-negative unit vector $ x$ such that the largest inner product of $ x$ and a vector $ v \in S$ is minimized. That is, $ $ \min_{x\in \mathbb R_+^n,\|x\|_2=1}\max_{v\in S} x^Tv. $ $

It seems like a quite fundamental problem in computational geometry. Has this problem been considered in the literature?

It can be formulated as an infinity norm minimization problem, which can in turn be expressed as a quadratically constrained LP. If the rows of matrix $ A$ are the vectors in $ S$ , we seek $ $ \begin{align} &&\min_x\|Ax\|_\infty \ \rm{s.t.} && x^Tx=1 \ && x\geq 0. \end{align} $ $ But the quadratic constraint is non-convex, so this is not very encouraging.

How to connect a mobile app through the woocommerce API to “Create Order” for a product linked to a vendor

I want to connect a mobile app through the woocommerce API to “Create Order” for a product linked to a vendor such that this will create the sub-order automatically for a given vendor account. The woocommerce API does not provide this capability by default and the "post author" is assigned to the user authorised to make the API call. How do I go about this?

Does mentioning Product Identity-protected things in a comparison violate the OGL?

I have a homebrew setting that involves a heavily-modified cosmology. None of my planes are identical to the "standard" planes, and the re-used names are only generic ones with heavily-modified meanings. In fact, the only two with identical names are the Astral Plane and the Abyss.

I would like to publish (on a wiki, and potentially more formally) a concordance of sorts for players more familiar with other cosmologies. Basically, a table mapping my_plane to closest standard_plane(s). This would be both for mechanical purposes (any spell that says it involves the <y> standard plane instead uses the <x> custom plane) and for thematic shorthand (generally, beings who live in the <y> standard plane live in <x> custom plane instead).

Can I, without violating the OGL, actually do this by referencing the actual WotC-published, stock-5e-cosmology plane names? If that’s all I do with those names is mention them (without any of the details)?Or is there another sane, understandable way of accomplishing this same task without risking an OGL violation?

From what I can tell, this would fall under nominative fair use as defined in the link:

Nominative fair use permits use of another’s trademark to refer to the trademark owner’s actual goods and services associated with the mark. Nominative fair use generally is permissible as long as (1) the product or service in question is not readily identifiable without use of the trademark, (2) only so much of the mark as is reasonably necessary to identify the product or service is used and (3) use of the mark does not suggest sponsorship or endorsement by the trademark owner.

Product of all nodes except for one in Binary Tree

Assume we are given a binary tree with an integer sitting at each node. I am looking for an efficient way to find for every path from the root to a leaf every possible product with exactly one node omitted. I am looking for a solution without divisions (i.e. integers can be zero).

One way to go about this I thought of is I can compute all possible partial products starting at the root. That is each node stores the product of the unique path from the root up this node ( but except the integer stored at that particular value ). Then for each leaf node I can walk up the path to the root node multiplying the integers on the way. At a given node before accumulating the node into the product I can multiply the product with the prefix product stored in the node.

It feels like I am doing a lot of redundant multiplications when visiting each path from a leaf to the root, since these paths potentially share a lot of nodes. Is there a way faster way to do this?

The number of products displayed on the page clears all selected product filters – woocommerce

I have a problem on the Product archive, when I filter products and change the number of displayed products per page, all the set filters are reset.

I’ve noticed that both the filter and the number of products on the page also enter their attributes in the URL, and that’s probably the problem. Does anyone have any solution for this?

enter image description here

Filtered products: http://xxx.xxx/product-category/spirits/?ixwpst[pa_brand[]=25&ixwpst[pa_brand[]=28&title=1&excerpt=1&content=1&categories=1&attributes=1&tags=1&sku=1&ixwpsf[pa_brand][show]=all&ixwpsf[taxonomy][pa_brand][multiple]=1&ixwpsf[taxonomy][pa_brand][filter]=0&ixwpsf[taxonomy][pa_region][show]=all&ixwpsf[taxonomy][pa_region][multiple]=1&ixwpsf[taxonomy][pa_region][filter]=0&ixwpsf[taxonomy][pa_detail-type-1][show]=all&ixwpsf[taxonomy][pa_detail-type-1][multiple]=1&ixwpsf[taxonomy][pa_detail-type-1][filter]=0&ixwpsf[taxonomy][pa_detail-type-2][show]=all&ixwpsf[taxonomy][pa_detail-type-2][multiple]=1&ixwpsf[taxonomy][pa_detail-type-2][filter]=0

Displaying number of products on page: http://xxx.xx/product-category/spirits/?Products-per-page=48

How to show price update date in product single page?

I wanted to show price update date in Woocommerce product single page after add to cart button. something like this: ” Price updated at 5/6/2020 “

I tried to research but I did not find a good response. Thanks for helping.

https://wordpress.stackexchange.com/a/216653/189455 this is also a good reference but I could not figure it out how to use and do what he said in code.

Woocommerce redirection to checkout for certain after product added to cart

I have implement this code in function.php to redirect the page to checkout if product with id(26285) added to the cart .This is the code

add_action( 'woocommerce_add_to_cart', 'custom_add_to_cart', 1, 2 ); function custom_add_to_cart( $  cart_item_key, $  product_id ) {  $  site_url = get_site_url(); if($  product_id == 26285) {  // Redirecting to some url wp_redirect($  site_url.'/my-account/'); exit; }} 

the condition i need to satisfy here is , if the product with ID:26285 added to the cart i need to redirect to checkout.The problem i am facing now is the page is redirecting but the product was not adding to cart . How to achive that?

Your help will very much appreciated. Have a nice day!