eBay API to get Total Amount using GetOrders by PHP - 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.

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.

Details don't match amount total when using taxes

I'm using Paypal to process payments.
The subtotal (without taxes) for the purchase is 132.94$. My customers are in Canada and I need to multiply a tax percent to that subtotal in order to get the real total.
The tax percent is 1.14975, but Paypal doesn't accept a tax percent with more than two decimals, so it rounds it to 1.15.
Here's the code that I use to setup the payment :
// Not shown- create an ItemList, add Item's to it
// ...
$details = new Details;
$details->setSubtotal(132.94);
$details->setTax(1.14975);
$amount = new Amount;
$amount->setCurrency('CAD');
$amount->setTotal(152.88); // 132.94 * 1.15
$amount->setDetails($details);
// ...
// Not shown - create the transaction, try to create the payment
However, when I try to send the information to Paypal, I get this error :
Transaction amount details (subtotal, tax, shipping) must add up to specified amount total
I tried dumping out $amount to see what it contains, and here's what I see :
Why does it tell me that the details don't add up to the amount? Am I missing something here? If I multiply the subtotal by the tax, I get the total for the amount, they do match up.

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$

Magento calculate shipping to be refunded on partial refund

I'm trying to figure out how to calculate the shipping refund on orders where some of the items are being refunded. Currently, in the credit memo screen, the amount in the input field is the total amount paid for shipping. When you adjust the quantity of items being refunded, and hit update, the shipping refunded amounts stays the same. I'd like to adjust it to be the portion of shipping that is related to the items being refunded.
As a calculation, I was thinking this would be:
total shipping cost - new calculation of shipping for items not being refunded = shipping cost of items being refunded.
I can see that the calculation for shipping is done in this class:
Mage_Sales_Model_Order_Creditmemo_Total_Shipping
However, I am having trouble figuring out how I would rerun the shipping calculation for the credit memo items.
Anyone have any thoughts on how I might be able to accomplish this?

Different shipping amounts based on total amount of order in ubercart

is there an option to offer different shipping amounts based on the total amount of the order in Ubercart ? An example would be the following, if the order totaled:
0-$50 then shipping would be $50
$50-$100 then shipping would be $125
$100-$500 then shipping would be $1000
I don't think there is any specific option for that, but in MARKUPS you can choose the percentage, which may give a close result of what you need.

Categories