hook-woocommerce

Customizing loop product image via a hook in Woocommerce

萝らか妹 提交于 2021-02-20 10:11:29
问题 I am customizing woocommerce themes. I stuck on loop product using hook action woocommerce. To call/include the thumbnail image in a loop, we call this hook <?php do_action('woocommerce_before_shop_loop_item_title'); ?> And the thumbnail image appears. I am confused where is the <img src"" .... location? How to edit that code? Thanks 回答1: The hook woocommerce_before_shop_loop_item_title load the image from this function code: if ( ! function_exists( 'woocommerce_template_loop_product

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 ,

Adding more product from contact form 7 to woocommerce checkout

吃可爱长大的小学妹 提交于 2021-02-19 07:32:45
问题 I am creating an order form that sells sim and i have a dropdown menu that list option to top up i want once a customer select an option it add to cart and then link a button to the checkout page 回答1: on_sent_ok is deprecated in latest version of contact form 7, but alternate way is: document.addEventListener( 'wpcf7mailsent', function( event ) { location = 'http://www.yoursite.com/checkout/?add-to-cart=ID';}, false ); 来源: https://stackoverflow.com/questions/53063904/adding-more-product-from

Adding a custom field to BACS account fields without overriding core files

℡╲_俬逩灬. 提交于 2021-02-19 01:32:33
问题 I have this situation - I made a changes in one of the woocommerce email templates, but I`m sure - these changes will be lost after next woocommerce update. As I know, I should use theme functions to bypass this problem. This is the code before changes: echo '<ul class="wc-bacs-bank-details order_details bacs_details">' . PHP_EOL; // BACS account fields shown on the thanks page and in emails $account_fields = apply_filters( 'woocommerce_bacs_account_fields', array( 'account_number'=> array(

Move additional information from product tab under add to cart button in WooCommerce

谁都会走 提交于 2021-02-16 04:14:55
问题 In single product pages, I would like to change the location of "additional information" from tabs, under add to cart button using Woocommerce hooks (removing the "additional information" tab) . I have: add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); and: woocommerce_after_add_to_cart_button I'm trying: remove_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); add_action( 'woocommerce_after_add_to_cart

Move additional information from product tab under add to cart button in WooCommerce

笑着哭i 提交于 2021-02-16 04:11:28
问题 In single product pages, I would like to change the location of "additional information" from tabs, under add to cart button using Woocommerce hooks (removing the "additional information" tab) . I have: add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); and: woocommerce_after_add_to_cart_button I'm trying: remove_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); add_action( 'woocommerce_after_add_to_cart

Move additional information from product tab under add to cart button in WooCommerce

♀尐吖头ヾ 提交于 2021-02-16 04:09:46
问题 In single product pages, I would like to change the location of "additional information" from tabs, under add to cart button using Woocommerce hooks (removing the "additional information" tab) . I have: add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); and: woocommerce_after_add_to_cart_button I'm trying: remove_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); add_action( 'woocommerce_after_add_to_cart

WooCommerce sort all products by sale percentage including variable products

时间秒杀一切 提交于 2021-02-11 14:02:34
问题 I have the following function which adds a custom sort by discount amount: add_filter( 'woocommerce_get_catalog_ordering_args', 'wcs_get_catalog_ordering_args' ); function wcs_get_catalog_ordering_args( $args ) { $orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); if ( 'on_sale' == $orderby_value ) { $args['orderby'] = 'meta_value_num'; $args['order'] =