Home Change Cart total price in WooCommerce
Reply: 0

Change Cart total price in WooCommerce

user1036 Published in June 19, 2018, 4:11 pm

I am running into issues with the cart total only displaying 0

Essentially what I am trying to do is only accept a deposit total of a certain amount after all cart items have been added to the carts subtotal.

So for example if the customer adds $100 worth of items, they would only pay $10 initially or (10%) of the subtotal as the total value.

I took the code from here: Change total and tax_total Woocommerce and customize it this way:

add_action('woocommerce_cart_total', 'calculate_totals', 10, 1);

function calculate_totals($wc_price){
$new_total = ($wc_price*0.10);

return wc_price($new_total);

But the total amount shows 0.00 when that code is enabled. If removed the code, I get the standard total.

I also could not find on the woocommerce site where the full api is listed, only generic articles related to how to create a plugin.

Any help or a point in the right direction would be great.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.493479 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO