woocommerce shipping table rates per order + per cart - wordpress

I am using woocommerce table rate shipping
In my current system I need to two types of shipping rates
1. Per Order (Based on category )
2. Per Item (Based on category )
The both categories are working fine if the products are separately added
But while I am adding and one products from each categories, in that senarioes I want to both shipping method summation.
Can anyone help me?
Thanks,
Denis
http://www.yiion.com

If you are using the Table Rate plugin from WooCommerce you have to check 'break' when setting up the shipping method.

Related

Differences between WooCommerce price filters

First of all, thank you for your support all those years.
I am building a role-based pricing plugin for a client and I am having an existential crisis over filters WooCommerce uses for prices. I made this post in hope someone can explain this so someone in the future can find this post.
I managed to understand how filters for simple products work but I don't have an idea how equivalent filters for variable products work
Simple products
As from what I understood, you can override price, regular price, and sale price for simple products returning some value inside filters woocommerce_product_get_price, woocommerce_product_get_regular_price, and woocommerce_product_get_sale_price. Those filters will save provided data into $product object and you can easily access them later in woocommerce_get_price_html filter by using $product->get_regular_price
Variable products
Looks like variable products work differently. For example, they dont save overriden price to $product or $variation object and you cannot fetch overriden prices by calling $variation->get_regular_price.
As I understood, following filters change price of the product on add-to-cart variation select, and in the cart and do not save them in $variation object.
woocommerce_product_variation_get_price
woocommerce_product_variation_get_regular_price
woocommerce_product_variation_get_sale_price
I didnt manage to fully understand what following filters do. But when I turn them on loop price changes and product price changes but prices are removed from add-to-cart select and cart prices are not changed.
woocommerce_variation_prices_price
woocommerce_variation_prices_regular_price
woocommerce_variation_prices_sale_price

Split shipping cost in cart

I have Shipping costs based on the number of categories in cart. Base shipping is 250 and if the number of categories is more than 1 for every category is charged extra 50. At the moment everything is shown together in a cart, I would like to be extra cost visible with a label and new row.
It looks like you might need to modify the WooCommerce checkout template in the theme that you are using.

Woocommerce: Need to show shipping price and include it in the total [duplicate]

This question already has an answer here:
Get the Cart shipping label and cost in Woocommerce
(1 answer)
Closed 4 years ago.
I've inherited a custom built Woocommerce site and am having to make some upgrades but are getting a little stuck.
I can show the cart total before taxes:
WC()->cart->get_cart_total();
I can show the taxes to be applied:
WC()->cart->get_cart_contents_tax();
And the final with the taxes applied:
WC()->cart->get_cart_subtotal();
But I cannot find anyway to show the flat rate shipping I have and also the cart total with the shipping cost applied.
I only have one shipping item which is active, flat rate, with all continents applied to make it global. I'm logged in with an address registered but it doesn't display it.
I have tried multiple options including...
WC()->cart->calculate_totals();
WC()->cart->calculate_shipping();
$packages = WC()->shipping->get_packages();
...but still no shipping price or cart total with shipping.
To extract shipping cost, I would go like this, using get_cart_shipping_total:
$shipping_cost = WC()->cart->get_cart_shipping_total();
Have a try.

WooCommerce : set TAX on product page

I'd like to set a specific Tax on each product.
I see i can create tax classes, but i'm going to have many different taxes, one per product, on more than 300 products.
Is it possible to set the tax % on the product page when i create it ?
Do you know a plugin for that ?
What want to do is to calculate Tax Based On SKU and not shipping address.
So i need to have a field on product page where i can enter a TVA number, manually.
Do you think it's possible ?
OR an other way maybe :
- have one taxe class
- in the tax class add many taxes rates with all the same country code, and no zip code
- create a field in the product page to assign the right tax rate for the product (instead of assign a class rate)
What do you think about that ?

Add custom calculated shipping to the total on checkout in Drupal Commerce?

I want to add custom calculated shipping value (based on the origin of the shipment of the book) to the total amount of the order. I can now calculate the shipping value based on the order ID in my custom module....
I want to be able to add this value to the order total on checkout, is that possible?
I have tried shipment rules, but it is not satisfactory as it only allows me to add a value to the line items in the order and not to total. How can I hook to the checkout process and add this amount to the total? Maybe I can add it as custom line items on checkout?
Also, since it is a custom shipment method with customs shipment companies, do I need to use any of the shipment modules in the first place ( I neither use flat service or any of the commerce shipment modules) ?
Try API of respective commerce/ubercart module. They must offer some API which allows you to modify the check out page

Resources