shipping

Get order subtotal value in WooCommerce

痞子三分冷 提交于 2021-02-05 08:28:30
问题 I use the module for calculating delivery by local carrier, but the module don't calculate shipping costs to the total. In the wp-content/plugins/woocommerce/templates/order/order-details.php I added the following code to take the amount of shipping and subtotal: <?php $a = array( get_post_meta($order_id, 'Order_subtotal', true), get_post_meta($order_id, 'Econt_Customer_Shipping_Cost', true)); ?> <tr class="total-cost"> <th><?php _e( 'Total:', 'woocommerce'); ?></th> <td><?php echo array_sum(

Hide COD payment method based on shipping class in WooCommerce cart

江枫思渺然 提交于 2021-01-28 19:43:02
问题 As Salam o Alikum, I'm trying to hide cash on delivery payment method if the product in cart belongs to NOCOD shipping class. I have created a shipping class and its ID is 723, I tried to get help from everywhere on the web but unable to figure out that where I'm doing wrong. Based on web surfing, I have written code and added it to theme functions.php. Here is the code snippet. //disabling COD if shipping class is NOCOD. add_filter('woocommerce_available_payment_gateways', 'hide_cod_if

Save custom delivery dates range calculations to WooCommerce order meta data

為{幸葍}努か 提交于 2021-01-28 10:05:53
问题 I use woocommerce and have written a function, which displays a date range for expected delivery based on the stock status... For reference: Display an estimated delivery date range based on WooCommerce cart item stock Now I want to output the calculated date range into my admin panel for each order. For the Orders edit pages in the Wordpress backend I use this code: add_action( 'add_meta_boxes', 'add_meta_boxes' ); function add_meta_boxes() { add_meta_box( 'woocommerce-order-my-custom', __(

Save custom delivery dates range calculations to WooCommerce order meta data

佐手、 提交于 2021-01-28 10:02:45
问题 I use woocommerce and have written a function, which displays a date range for expected delivery based on the stock status... For reference: Display an estimated delivery date range based on WooCommerce cart item stock Now I want to output the calculated date range into my admin panel for each order. For the Orders edit pages in the Wordpress backend I use this code: add_action( 'add_meta_boxes', 'add_meta_boxes' ); function add_meta_boxes() { add_meta_box( 'woocommerce-order-my-custom', __(

Need shipping cost to depends on custom field (Woocommerce)

时间秒杀一切 提交于 2021-01-28 03:48:48
问题 I used Woocommerce Easy Checkout Fields Editor plugin to create a custom drop-down field in billing section. How do I make the cost of delivery vary depending on what is selected in this field (there are two options) 来源: https://stackoverflow.com/questions/46232628/need-shipping-cost-to-depends-on-custom-field-woocommerce

update cart shipping woocommerce when change country with ajax

◇◆丶佛笑我妖孽 提交于 2021-01-27 11:29:04
问题 i have 3 zone shipping and every zone have 3 more method shipping (diffrent) Zone US : Method Shipping = 1. Flate_rate1, 2. Flate_rate2, 3. Flate_rate3 Zone UK : Method Shipping = 1. Flate_rate4, 2. Flate_rate5, 3. Flate_rate6 Zone All WOrld : Method Shipping = 1. Flate_rate7, 2. Flate_rate8 now iwant to display method shipping by zone when select billing country with ajax. example : if select billing country US then only display/showing method shipping by zone us (1. Flate_rate1, 2. Flate

update cart shipping woocommerce when change country with ajax

久未见 提交于 2021-01-27 11:27:50
问题 i have 3 zone shipping and every zone have 3 more method shipping (diffrent) Zone US : Method Shipping = 1. Flate_rate1, 2. Flate_rate2, 3. Flate_rate3 Zone UK : Method Shipping = 1. Flate_rate4, 2. Flate_rate5, 3. Flate_rate6 Zone All WOrld : Method Shipping = 1. Flate_rate7, 2. Flate_rate8 now iwant to display method shipping by zone when select billing country with ajax. example : if select billing country US then only display/showing method shipping by zone us (1. Flate_rate1, 2. Flate

update cart shipping woocommerce when change country with ajax

人走茶凉 提交于 2021-01-27 11:26:14
问题 i have 3 zone shipping and every zone have 3 more method shipping (diffrent) Zone US : Method Shipping = 1. Flate_rate1, 2. Flate_rate2, 3. Flate_rate3 Zone UK : Method Shipping = 1. Flate_rate4, 2. Flate_rate5, 3. Flate_rate6 Zone All WOrld : Method Shipping = 1. Flate_rate7, 2. Flate_rate8 now iwant to display method shipping by zone when select billing country with ajax. example : if select billing country US then only display/showing method shipping by zone us (1. Flate_rate1, 2. Flate

Set a percentage discount to Local pickup shipping method in Woocommerce

会有一股神秘感。 提交于 2020-08-04 19:20:26
问题 I have a WordPress site which uses WooCommerce plugin. I would like to offer buyer 5% reduction from cart total if they select local pickup as a shipping method. I already tried - 5 * [qty] and it doesn't seem to be working. I also tried -0.95 * [cost] with no luck 回答1: I am using WooCommerce 3 and achieved the above result by writing a function inside the function.php of active theme. function prefix_add_discount_line( $cart ) { $chosen_methods = WC()->session->get( 'chosen_shipping_methods'