woocommerce

Add image caption under image thumbnail in WooCommerce single product page

[亡魂溺海] 提交于 2021-02-20 04:05:07
问题 I'm trying to add the image caption under each image thumbnail in WooCommerce single product page. Here you can see where I want the text to be showed (presently "undefined") I want to add the individual caption text (not the product title, the image caption. Each image has a different caption). Is there an easy way to do that? I'm using ToolSet and can add JavaScript snippet if needed. I saw a post that talk about this but can't figure it out where to put that code : Show caption under

WooCommerce email IDs and order status change for email notifications

落爺英雄遲暮 提交于 2021-02-20 02:15:55
问题 I am trying to add a function that will log any email that is sent through order status changes. Is there a hook I can use that is triggered right before an order notification email is sent? 回答1: Updated All the available hooks responsible for triggering email notifications are located in WC_Emails init_transactional_emails() method and are action hooks: woocommerce_low_stock , woocommerce_no_stock , woocommerce_product_on_backorder , woocommerce_order_status_pending_to_processing ,

WooCommerce email IDs and order status change for email notifications

有些话、适合烂在心里 提交于 2021-02-20 02:12:37
问题 I am trying to add a function that will log any email that is sent through order status changes. Is there a hook I can use that is triggered right before an order notification email is sent? 回答1: Updated All the available hooks responsible for triggering email notifications are located in WC_Emails init_transactional_emails() method and are action hooks: woocommerce_low_stock , woocommerce_no_stock , woocommerce_product_on_backorder , woocommerce_order_status_pending_to_processing ,

WooCommerce email IDs and order status change for email notifications

独自空忆成欢 提交于 2021-02-20 02:12:24
问题 I am trying to add a function that will log any email that is sent through order status changes. Is there a hook I can use that is triggered right before an order notification email is sent? 回答1: Updated All the available hooks responsible for triggering email notifications are located in WC_Emails init_transactional_emails() method and are action hooks: woocommerce_low_stock , woocommerce_no_stock , woocommerce_product_on_backorder , woocommerce_order_status_pending_to_processing ,

Using AJAX to load more products WooCommerce

做~自己de王妃 提交于 2021-02-20 00:45:33
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Using AJAX to load more products WooCommerce

别说谁变了你拦得住时间么 提交于 2021-02-20 00:44:34
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Using AJAX to load more products WooCommerce

拥有回忆 提交于 2021-02-20 00:42:49
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Add a purchase condition to WooCommerce products

◇◆丶佛笑我妖孽 提交于 2021-02-19 09:13:29
问题 I ma trying to add a purchase condition to my WooCommerce products with the following: {$current_user = wp_get_current_user(); if ( current_user_can('administrator') || wc_customer_bought_product($current_user->email, $current_user->ID, // return true return true;} But I don't know if this code is correct and an advise will be helpful. 回答1: The product Id argument is missing from wc_customer_bought_product() function, and you can get more easily the WP_User object. Here is a usage example:

How to disable fields that are pre-filled in WooCommerce checkout?

空扰寡人 提交于 2021-02-19 08:59:10
问题 I would like to prevent (make these fields readonly, for example) users from changing their billing information on the WooCommerce checkout form. I'm currently using this code snippet: add_filter('woocommerce_billing_fields', 'mycustom_woocommerce_billing_fields', 10, 1 ); function mycustom_woocommerce_billing_fields($fields) { $fields['billing_first_name']['custom_attributes'] = array('readonly'=>'readonly'); $fields['billing_last_name']['custom_attributes'] = array('readonly'=>'readonly');

How include mask in the Woocommerce fields? E.g. Phone: (99) 9999-9999

你说的曾经没有我的故事 提交于 2021-02-19 08:57:14
问题 According to the WC docs, if I want to add a new field in the checkout area I should write the following code in functions.php: /* Add the field to the checkout*/ add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); function my_custom_checkout_field( $checkout ) { echo '<div id="my_custom_checkout_field" class="my_new_field"><h2>' . __('My Field') . '</h2>'; woocommerce_form_field( 'my_field_name', array( 'type' => 'text', 'class' => array('my-field-class form-row-wide'),