woocommerce/wordpress set maximum cart total - php

I can't find any plugins that allow me to set rules I need to cart.
I found plugins which allow to set rules that let you set max/min purchases (only calculates total of products) but doesn't take into account total price of products+fees+shipping (total cart).
Anyone know any solutions?
Thank you.

As advised I can answer my own question.
First off my query was about setting maximum price allowed to a cart total, not just product total.
eg.max Total products+shipping+fees=100
Here's the solution:
I found a plugin called min "Min and Max Purchase for WooCommerce".If you set your fee (if you have that implemented) and shipping to static eg. $1 fee and $1 shipping all the time.
You can then set maximum total price of products to [desired maximum price to set - (static shipping cost+ static fee)= total max price to set for products]
From example on top deired maximum [$100 desired maximum total-($1 shipping+$1 fee)=$98 total max price to set for products]
This will only work for your eCommerce website IF your shipping cost are static and not affected by weight of products.

Related

Apply coupon after calculate the shipping rate - woocommerce

I am building my website by using woocommerce, but i faced the problem of calculating the total amount of the order.
There is a shipping method which is 15% additional fee of the order, and there is a coupon offers $10 discount.
But woocommerce seems like apply the coupon before calculate shipping fee.
For example, the order total amount is $100, the expected result should be (100*1.15) - 10 = 105, but when i tested in the checkout page, the total amount is (100-10) * 1.15 = 103.5.
May I know how to apply the coupon after calculate the shipping fee?
Thank you.
I want to calculate amount correctly in woocommerce, which is apply coupon after calculate the shipping fee.

How to set a shipping cost by item in Woocommerce

In Woocommerce, when I add multiple products in cart, the shipping only applies to to 1 product. How should I change that to apply the cost to each item?
Like in the following image, the shipping cost for printer is applied but the LCD monitor is not.
How to set a shipping cost by item in Woocommerce?
In the Woocommerce Shipping Settings for "Flat rate" Shipping Method, there is many ways to get dynamic settings based on:
Item quantity, using [qty] argument
Total item cost, using [cost] argument
A fee, using [fee] argument with additional parameters percent, min_fee and max_fee
You can also use +, -, * and / operators and parenthesis.
Here are some example:
[qty]*2 - Cost by item
4+([qty]*2.5) - Initial cost with an additional cost by item
[fee percentage='10' min_fee='' max_fee='20'] - Percentage fee limited to a max amount
[fee percentage='10' min_fee='4' max_fee=''] - Percentage fee with a minimal cost
Related thread: Set Minimum item cost in Woocommerce Shipping method rates
Advanced shipping cost customizations:
It's possible to customize even more shipping costs using woocommerce_package_rates filter hook.
See all StackOverFlow related threads using woocommerce_package_rates filter hook.

Progressive Flat rate shipping method based on item quantity in Woocommerce

I Would like to add different progressive flat rates shipping cost for 2 different shipping Zones domestic and international: A fixed amount for the first item and an additional cost for every additional items.
eg: Standard domestic postage $10, and $20 international, with $5 additional for each extra item.
Is this possible through woocommerce shipping setting? or this need some custom coding?
Any help is appreciated.
You can use the following cost line that will give you a fixed cost + an additional cost by item. This need to be differently for each shipping zone.
For your "Domestic" shipping Zone, use: 5+([qty]*5) So the first item will be at 10 (5+5) and each additional item will add +5 to the cost.
For your "International" shipping Zone, use: 15+([qty]*5) So the first item will be at 20 (15+5) and each additional item will add +5 to the cost..

eBay API to get Total Amount using GetOrders by PHP

Right now, I am using GetOrders to launch all my orders to my database. Normally, it works fine. I can get the total amount(includes item price and tax) by using:
$totalAmount = $order->AmountPaid;
However, when I tried to import an International Order, the amount was wrong.
The thing is: I only charged him $102.90, but the amount here gives me $157.62
Does anyone know how can I get the total price, which under the "Total" column, in eBay? What kind of value I need to use? Or maybe how to calculate the price for international order?
There few fields related to order price
OrderArray.Order.AmountPaid
This value indicates the total amount of the order. This amount includes the sale price of each line item, shipping and handling charges, shipping insurance (if offered and selected by the buyer), additional services, and any applied sales tax. This value is returned after the buyer has completed checkout (the CheckoutStatus.Status output field reads 'Complete').
OrderArray.Order.Total
The Total amount equals the Subtotal value plus the shipping/handling, shipping insurance, and sales tax costs.
OrderArray.Order.Subtotal
The subtotal amount for the order is the total cost of all order line items. This value does not include any shipping/handling, shipping insurance, or sales tax costs.
I would suggest you try Order.Total for receive price of the order.

How to increase shipping cost depending on quantity of order?

Pretty much I want to increase the shipping cost depending on the number of items in order... e.g. by default shipping cost is 10$ but when number items goes beyond 20 it will add 3$ to shipping cost so it would be 13$
I tried changing codes but it's complicated somehow
I had to find all places that include shipping tax like in 1-blockcart module, 2-one page checkout, 3-payment, 4-inserting to database... And then change some codes. And it's a lot of work and hard
Prestashop includes a shipping range functionality. You can define shipping cost depending of the total weight of your products.
If you want a simple implementation, you can define all your products weight to 1Kg and add shipping cost ranges like those:
0kg => 20kg : 10$
20kg => 40kg : 13$
40kg => 99999kg : 15$

Categories