woocommerce

How to get “Terms & Conditions” Page ID in WooCommerce?

风格不统一 提交于 2021-02-11 17:10:54
问题 I'd like to know how to get the page which set as "Terms & Conditions Page" on "Appearance > Customize > WooCommerce > Checkout" on WordPress admin. I could get privacy policy page with "is_privacy_policy()", but don't know how to get "Terms & Conditions Page". I want to do this to make a plugin for WooCommerce not just for me but any person, so I can not know its page slug. Thank you. 回答1: First terms and conditions WordPress page need to be defined in WooCommerce Settings > Advanced > Terms

How to get “Terms & Conditions” Page ID in WooCommerce?

て烟熏妆下的殇ゞ 提交于 2021-02-11 17:09:08
问题 I'd like to know how to get the page which set as "Terms & Conditions Page" on "Appearance > Customize > WooCommerce > Checkout" on WordPress admin. I could get privacy policy page with "is_privacy_policy()", but don't know how to get "Terms & Conditions Page". I want to do this to make a plugin for WooCommerce not just for me but any person, so I can not know its page slug. Thank you. 回答1: First terms and conditions WordPress page need to be defined in WooCommerce Settings > Advanced > Terms

WooCommerce Display avanced custom fields (ACF) inside order notification

為{幸葍}努か 提交于 2021-02-11 16:12:51
问题 I've added the following snippet to display a custom field (that don't display taxonomy field if product has field) with the estimated delivery time. This is working. <?php add_action( 'woocommerce_before_add_to_cart_form', 'geschatte_levertijd', 10 ); function geschatte_levertijd (){ if( get_field('plevertijd') ): ?> <span class="product_melding_kleur"><i class="fa fa-truck"></i>Levertijd: <a href="/verzending-en-levertijd/" alt="Verzending en levertijd" ><?php the_field( 'plevertijd' ); ?><

WooCommerce Display avanced custom fields (ACF) inside order notification

你说的曾经没有我的故事 提交于 2021-02-11 16:12:49
问题 I've added the following snippet to display a custom field (that don't display taxonomy field if product has field) with the estimated delivery time. This is working. <?php add_action( 'woocommerce_before_add_to_cart_form', 'geschatte_levertijd', 10 ); function geschatte_levertijd (){ if( get_field('plevertijd') ): ?> <span class="product_melding_kleur"><i class="fa fa-truck"></i>Levertijd: <a href="/verzending-en-levertijd/" alt="Verzending en levertijd" ><?php the_field( 'plevertijd' ); ?><

Woocommerce variation product price inside Add to cart button

≡放荡痞女 提交于 2021-02-11 15:37:51
问题 I use "Display price on add to cart button from the functions.php file in Woocommerce" answer code, that add price inside simple product. But I want to improve this function and dynamically display chosen variation price inside button. With this code on variation product page it display only the lowest price. Is there any solution? How add to cart button looks now (no options chosen) : How I want to be displayed: 回答1: Maybe it will be useful for somebody! Result. Add to cart button of

Shipping calculator Button at Checkout page

帅比萌擦擦* 提交于 2021-02-11 15:24:57
问题 I am new to woocommerce and I do not have much knowledge about that. In a project I want to hide shipping calculation button from cart page.but want to show the same configuration with button on checkout page. I want help regarding how to add shipping button on checkout. 回答1: Go to WooCommerce->Settings->Shipping->Shipping Options and make sure you have unchecked 'Enable the shipping calculator on the cart page'. 回答2: All the woocommerce files needs to be overridden by copying that file into

how to add shipping cost with product actual price?

时间秒杀一切 提交于 2021-02-11 14:21:46
问题 I am using woocommerce plugin v2.2.8 for my eCommerce site. I am using weight based shipping method. Is there is any possibility to add shipping cost with products actual price which is displaying in product page? For Eg.. Product1 = Rs 800/- & shipping cost of this product is Rs 50/- Product1 price in shop page should be displayed as Rs 850/- (Actual price + shipping cost) Note: shipping cost calculated from weight based shipping method. Is this possible? Any idea regarding this??? 回答1:

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'] =

Display custom order meta data value in email notifications WooCommerce

柔情痞子 提交于 2021-02-11 14:02:29
问题 Based on the following code Add a custom checkbox in WooCommerce checkout which value shows in admin edit order I tried to add my_field_name to order confirmation email. As I understand I have to use woocommerce_email_customer_details . So I came to this solution, unfortunately without the desired result. add_action('woocommerce_email_customer_details','woocommerce_email_order_invoice_number', 28, 4 ); function woocommerce_email_order_invoice_number( $order, $sent_to_admin, $plain_text,

Get specific WooCommerce product data on “added_to_cart” javascript event

拟墨画扇 提交于 2021-02-11 13:49:11
问题 On WooCommerce, I would like to implement the following event tracking script when customer use the Ajax add to cart: <script> bianoTrack('track', 'add_to_cart', { id: 'PRODUCT-1234', quantity: 10, unit_price: 123.45, currency: 'CZK', }); </script> I know that I can use "added_to_cart" event this way: jQuery( 'body' ).on( 'added_to_cart', function( e, fragments, cart_hash, this_button ) { ​ }); But I have no idea how to get the product data like sku , quantity , price … How can I get specific