woocommerce

Set all shipping methods cost to zero for a Free shipping coupon in Woocommerce

孤人 提交于 2021-02-19 05:31:17
问题 I have 3 shipping methods in my cart that should become zero prices as soon as your customer enters Free Shipping coupon. I know how to add a filter in functions.php to detect the coupon but is someone know a snippet to set shipping methods visibles in cart (radio button) to ZERO for this order? My deliveries methods are companies like UPS, FedEx... I activated the free shipping option in order it can be managed with coupon. The list of choice of deliveries methods for the customers is

Enabling Payment method based on the customers location

社会主义新天地 提交于 2021-02-19 05:25:23
问题 I don't know if it's possible, but, we would need to add some different payment methods for Barcelona. So, our idea is that if the customer lives in Barcelona area (Catalunya), he will see a credit card payment method and a bank transfer account different than the rest of Spain. Is that possible with WooCommerce? Thanks. 回答1: If you want to enable this kind of feature in WooCommerce , Customers need to be registered and logged on first, as it's the only way to get they town location before

Dynamic discount using AJAX and Fee API in Woocommerce checkout page

随声附和 提交于 2021-02-19 04:39:07
问题 I have put a select box in the checkout page like this. function rx_wc_reward_points_check() { $reward_points = '<select class="rx-rewad-points" id="rx-redemption-points"> <option value="1250">$25.00 Off (1250 Points) </option> <option value="2500">$50.00 Off (2500 Points) </option> <option value="5000">$100.00 Off (5000 Points) </option> <option value="7000">$150.00 Off (7000 Points) </option> </select>'; $reward_points .= '<a class="button alt" name="rx_reward_points_btn" id="rx_reward

Product regular price calculation based on 2 custom fields in Woocommerce 3

白昼怎懂夜的黑 提交于 2021-02-19 03:08:32
问题 In Woocommerce I have set 2 custom fields in the admin in the pricing section under Woocommerce default prices fields: Margin rate and Purchase price. I am trying to figure out how can I auto update the product price (regular price field) based on the calculation below: $product_price = $rate_margin * $purchase_price; Any help is appreciated. 回答1: You should add alway add the code that is used for your additional pricing fields in your question. The code below is: displaying and saving 2

Product regular price calculation based on 2 custom fields in Woocommerce 3

本小妞迷上赌 提交于 2021-02-19 03:06:34
问题 In Woocommerce I have set 2 custom fields in the admin in the pricing section under Woocommerce default prices fields: Margin rate and Purchase price. I am trying to figure out how can I auto update the product price (regular price field) based on the calculation below: $product_price = $rate_margin * $purchase_price; Any help is appreciated. 回答1: You should add alway add the code that is used for your additional pricing fields in your question. The code below is: displaying and saving 2

Product regular price calculation based on 2 custom fields in Woocommerce 3

穿精又带淫゛_ 提交于 2021-02-19 03:05:42
问题 In Woocommerce I have set 2 custom fields in the admin in the pricing section under Woocommerce default prices fields: Margin rate and Purchase price. I am trying to figure out how can I auto update the product price (regular price field) based on the calculation below: $product_price = $rate_margin * $purchase_price; Any help is appreciated. 回答1: You should add alway add the code that is used for your additional pricing fields in your question. The code below is: displaying and saving 2

Product regular price calculation based on 2 custom fields in Woocommerce 3

☆樱花仙子☆ 提交于 2021-02-19 03:05:10
问题 In Woocommerce I have set 2 custom fields in the admin in the pricing section under Woocommerce default prices fields: Margin rate and Purchase price. I am trying to figure out how can I auto update the product price (regular price field) based on the calculation below: $product_price = $rate_margin * $purchase_price; Any help is appreciated. 回答1: You should add alway add the code that is used for your additional pricing fields in your question. The code below is: displaying and saving 2

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(

Set cart shipping total amount issue after Woocommerce update

无人久伴 提交于 2021-02-18 19:33:02
问题 After the update my custom shipping amount rules are not working. Before the update I was using the following code to update shipping amount. add_action('woocommerce_calculate_totals', 'mysite_box_discount'); function mysite_box_discount($cart ) { $cart->shipping_total=100; return $cart; } After the update the structure of $cart array has changed and the above code has stopped working. Now the data coming in form of a protected array. I found that $cart->get_shipping_total(); can fetch me

Hook a section into WooCommerce Emails with customer ID

 ̄綄美尐妖づ 提交于 2021-02-18 19:30:20
问题 I am keen to hook a section into the WooCommerce emails with the customer number (which is the Wordpress user ID). If I insert the following code directly into the email template file echo $order->user_id; It works just fine, but if I try and hook it in, nothing is returned - except the word 'Hooked' which shows my hook is correct. add_action( 'woocommerce_email_after_order_table', 'lnz_hook_content', 1); function lnz_hook_content() { echo 'hooked'; // Test Purposes only echo $order->user_id;