After changing the shipping method on the Checkout page of my Woocommerce store, the total price does not update to reflect the new shipping cost.
I disabled all plugins, checked for errors, but everything is running like it should - except the total won't update.
I can't find anything about this on Google either. Anyone know what would cause this, or what steps I need to take to fix?
I had this problem and it was caused by outdated custom woocommerce template files.
For example, the review-order.php file in themes/my-theme/woocommerce/ was outdated and it included some of my own code.
I updated the version of that file, brought my custom code over and voila, upon changing shipping methods it successfully makes an AJAX call and refreshes the order totals.
In your case problem with html classes. When editing the checkout/review-order.php file, you need to keep the right html class shop_table woocommerce-checkout-review-order-table at the highest parent node. The file should look something like this:
<div class="shop_table woocommerce-checkout-review-order-table">
<?php //do stuff, add or remove anything you want ?>
</div>
Related
We recently started using distance based shipping for certain products. I have separated the shipping method from the review-order (picture of the design below). I basically just moved wc_cart_totals_shipping_html(); to form-checkout and it worked fine until we started using distance based shipping. I noticed that when the address is updated the price in review-order is updated but not the shipping method. Only after page refresh it would sync up.
I understand that the problem comes from AJAX not refreshing the part that I moved out but not sure how to fix it. The furthest I got with this was finding a thread with similar issue https://wordpress.org/support/topic/update-shipping-methods-in-checkout-via-ajax/. The method here is technically working (the shipping method is updating) but it causes another set of strange things that I could not figure out and I do not completely understand what it does. Namely I have sectioned the checkout process into sections and each of them can be opened as a dropdown through some jQuery. But after the "solution" above, I could not target the HTML elements brought in with JS anymore.
My solution before the "solution" above:
form-checkout.php
if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
<table class="checkout-shipping-table">
<?php wc_cart_totals_shipping_html(); ?>
</table>
<?php endif; ?>
I successfully generated a test cart rule and assigned to my user.
I can see it both in backoffice and on the my-account page under 'my vouchers'. So we're sure it's recorderd and assigned.
What happens is that in shopping-cart page, even after loggin in with my user, I can't see any voucher field.
Digging deeper, I can say that the $discounts template var is not populated, or, simply it counts zero. So I took a look to the controller, and saw it assign it via $order->getCartRules(). And getCartRules simply reads a db table. And surprise?? The order_cart_rule table is empty. So it doesn't get populated. So what could be the problem here? Ever had same issue someone? It's a strange thing..
Probably the main question is: where/when exaclty do the cart and the rules get created/applied? I can see in FrontController the cart being created, but at that point it seems the cart rules are not setted yet.
By the way, I'm running on latest prestashop 1.6.1.4
$order->getCartRules
The function $order->getCartRules() gives you the list of cart rules applied to this order (you can find it in a table ps_order_cart_rule).
Where are all cart rules?
All cart rules are in the table ps_cart_rule.
If you have marked a cart rule as Highlight - you can see this:
If you have added any cart rule to your shop - you can see this:
If you can't see Vouchers field - either you don't have any cart rules or your theme installed isn't supporting it.
is a late answer but i noticed that if you enable paypal it has in paypal.js a line that remove not only the voucher area but also the trashcan to delete a product:
see pic: https://i.gyazo.com/403a9004aaa745a2817f11884d52346b.png
/* 1.5 One page checkout*/
var qty = $('.qty-field.cart_quantity_input').val();
$('.qty-field.cart_quantity_input').after(qty);
$('.qty-field.cart_quantity_input, .cart_total_bar, .cart_quantity_delete, #cart_voucher *').remove();
by renaming the cart_voucher to cart_voucher_2 (if you not use express checkout) and cart_quantity_delete to cart_quantity_delete_2 you will return to have your things right :)
I have a problem. I'm using Woocommerce plugin and I never edited any default file and there's something wrong with the prices shown. I upload the product via the official API with no problems. If I load the products via browser, it shows the wrong prices.
But if I open the product to edit it, it shows the right price.
I don't understand why this is happening as I've never bothered touching any default core files. I'd appreciate it so much if anybody could help me solve this. Thank you very much.
Did you try putting the price like: 15655.00?
In Woocommerce Settings you can set the currency options where the separators are already handled:
As the title says, I want to remove the invoice fee from the customer-processing-order.php (I Think this is the right template)
https://github.com/woothemes/woocommerce/blob/master/templates/emails/customer-processing-order.php
From what I understand it comes from the function get_order_item_totals().
I can't just use CSS to hide it either because everything is inside a table. I found a website where someone was trying to hide the shipping cost and he used this:unset($totals['shipping']); inside the php file, which seemed pretty straightforward and clean. I wish you could just write something like unset($totals['invoice']); but unfortunately that's not the case.
Anyone got any ideas? I can't turn it off anywhere inside Woocommerce either.
do you have a screenshot of what exactly you want to be removed? I don't have an "invoice fee" anywhere at checkout ...
Having some problem setting up my woocommerce shop because of the checkout page.
The problem is that I'm facing duplicated payment methods that appear on BILLING Page and also ORDER & PAYMENT page.
I'm using a theme that haves a one page checkout.
If anyone can indicate how can i remove the links
Images that explain the the situation
http://i.imgur.com/ODCTERg.png - Billing and shipping page that show the wrong placement of the field
http://i.imgur.com/s26UfjI.png - the payment page that show the right and wrong placement of the field
I'm not 100% sure why the payment options are appearing on your Billing Details step (this will be down to how the theme is built); however I suspect this is happening because your theme has a woocommerce folder, and following one of the more recent WooCommerce updates (around 2.3.0, I think), the WooCommerce theme files have changed slightly.
Previously, the payment options loop was in /woocommerce/checkout/review-order.php in your theme folder. However, it was removed from this file and there are now two new files: payment.php and payment-method.php.
It's most likely that your existing review-order.php template contains the loop for displaying the available payment gateways, but WooCommerce sees that your theme doesn't have the payment.php file, so is helpfully using its default (located in /plugins/woocommerce/templates) - as a result, your checkout is doubling up on displaying the payment options.
Try:
Make a backup of your current review-order.php file, then copy 'review-order.php, payment.php & payment-method.php from /plugins/woocommerce/templates/checkout/ to your theme folder: [your-theme]/woocommerce/checkout/.
Hopefully, you should no longer see the doubling-up of your payment methods. On the downside, you may well have to modify these files to bring them back in line with your theme.
Just rename this folder:
/wp-content/themes/themename/woocommerce/checkout
It Is old code which is coming with theme.