magento cart totals when using subscriptions - php

when using paypal subscriptions in magneto - by default, magento uses the awkward method of
separating the subscription items from grand totals
grand total is zero if only sub is in cart while it calculates physical good separately
subscription items cost is placed below grand totals so it looks like:
as shown, subscription items are not even totaled
subtotal
0.00
grand total
0.00
subscription items
sub1 $1.00
sub2 $1.00
In my view, it would be better like this:
this would be what i consider normal....
Subscription Items:
sub1 $1.00
sub2 $1.00
Subtotal $2.00
Other Cart Items:
T-Shirt 1.00
Subtotal $1.00
grand total
$3.00
or...
Subscription Items:
sub1 $1.00
sub2 $1.00
Other Cart Items:
T-Shirt 1.00
Subtotal $3.00
grand total $3.00
or simply...
Your Cart Items:
sub1 $1.00
sub2 $1.00
T-Shirt 1.00
Subtotal $3.00
grand total $3.00
has anyone faced this and found a way to fix paypal/magnetos bad coding so that everything in cart adds up like a normal shopping cart?

It is a standard practice to keep subscription items separate from current order items. The way you're outlining this would cause confusion with your customers, I can pretty much guarantee.
If you show a break down like you've explained...
sub1: 1.00
sub2: 1.00
tshirt: 1.00
subtotal: 3.00
grand total: 3.00
Your customers are going to wonder if they're being charged 3.00 on a recurring bases or only the 2.00.
The actual shopping cart items that are "normal" as you put it, would be setup and included in the one-time purchase. Subscription items, which would be billed on a recurring basis, would be shown separately to differentiate and make it very clear.
Now, a subscription profile may have an "initial amount" charged, and that could be included and shown as a cart item, but again, the recurring amount would typically be shown separately.
Here's an example of a site of mine that is completely custom. I toyed around with lots of ways to display this so it was clear to people, and this is the sort of thing I came up with.
As you can see there I'm showing the one-time amount as the subtotal and then the recurring amount under that as an additional charge that will happen based on the subscription included with the order. If I were to simply show 71.85 as the total that would be confusing to people (and I experienced that first hand before I moved to this format.)
So then here's another screenshot of what it looks like with shipping included, so the subtotal and grand total are updated accordingly, but the subscription amount is still separate.
I have other orders where the one-time is $0 and there's nothing but a subscription, but it still gets broken down as $0 + 1.95/mo or whatever the case may be.
So, personally, I think what Magento is doing makes sense and is going to be better for you once you have live customers shopping on your site. It breaks down exactly what will be charged now, one-time, vs. what will be charged on a recurring basis.

Related

Magento 2 table rates- minimal amount necessary?

I use the Magento 2 table rates as calculation system for shipping costs.
For low weight products the shipping is for free. Or in the table rates file noted as € 0,00.
But it seems not to work for customer view in shopping cart. If a customer gets as high as € 0,00 for shipping costs the Magento system shows "Shipping: Not calculated yet".
So I think the Magento table rates system cannot deal with total shipping costs of € 0,00.
Is this indeed the situation or can I do something to get the € 0,00 amount accepted in the Magento store cart?
Thank you for reading and thinking it over!

Prestashop discount to increase total cart price

It's sounds a kind weird but I need to use a Prestashop 1.7 discount based on transportation id = 1 to increase 20% over cart's total.
I don't know where the function is and where to place...
You need to find module. For example Cash on Delivery with fee.

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.

Tax calculation issue for a plugin

i am working on a plugin for prestashop, i am done with it, but i have stumbled on to an issue.
The program flow is as follows:
A person places an order at the eCommerce website, the order is accepted, the order details such as items, prices, taxes, discounts etc is send to an external invoice API service.
An example of an order could be:
(These prices include taxes)
1x T-shirt 20.64
1x Shipping 125
1x Discount -18.58
(In this particular test case, the discount is 90% off the product, the math is simple 20.64 * 0.90 = 18.58)
Order total after tax is applied: 127.06
This is all fine, but, when i send the details off to the API, the order is saved as the following:
(These prices are saved without tax applied, the tax rate being 25%)
1x T-shirt 16.51
1x Shipping 100
1x Discount -14
Order total after tax is applied: 128.14
As you see, the order totals do not mach, the difference is 1.08, i am thinking this a discount & tax issue.
Its worth noting that the external site does its own math on the values sent, e.g products, tax etc. I cannot influence the way the external invoicing site does its calculations. I think the issue occurs in the order of which the operations are performed on the different platforms.
Its also worth mentioning that the code works perfectly fine when there is no discount present.
What can i do prior to sending the values, so that i get the prestashop price at the external service?
Let the value of the items be v_1 (t-shirt), v_2 (shipping) untaxed values, respectively.
Case 1.
1.25*v_1+1.25*v_2-0.9*1.25*v_1 = 127.06
Case 2 (tax at end)
(v_1+v_2-0.9*v_1)*1.25 = Same as Case 1 after expanding the brackets.
The figure which is amiss is, as you suggest, the -14 discount, which is more like -0.9*16.51=-14.86.
1.08 difference
There is a difference of 86 cents/pence, whatever, between the untaxed discount values. After taxes this difference grows to, 0.86*1.25=1.08, which explains the discrepancy.
To fix the code, the discount calculation needs to be fixed, unless there are other tax considerations that apply to discounts, etc. In other words why is -14 being used, rather than -14.86?
To you second point about the order of events, this should not impact anything - unless discounts are taxed differently.
Fix
Either
The discount calculation is wrong (i.e. 14 should be 14.86), or
The discount value of 14 is correct, in which case a different (tax/discount) methodology than what is being assumed and this needs to be ascertained before you can make a fix for it.

Magento shopping cart pricing rules not applying correctly

I have been having a problem with shopping cart price rules that aren't being applied correctly in the cart. The problem occurs when there are multiple discounts. Here is a specific example:
Discount A:
Product: 3 Book Set
Price: $20 each book
Discount: $10 (when you buy all 3)
Discount B:
Product: Suit (jacket and pants)
Price: $500 each piece
Discount: $50 (when you buy both)
Here is the situation:
When the suit is listed first and the books second, all discounts are taken ($50 + $10 = $60). However, when the books are first, only the suit discount is taken ($50).
Using firebug/firephp I have been able to see that for the first case, the discount is less than the price of the first product and all the discounts can be taken off that product.
In the second case, the discount is more than the price of the first product. When this happens, the $50 discount is spread across the 3 books. It takes $20 off the first book, $20 off the second, $10 off the third; but then the $10 discount for the books is not processed.
I need to know where to look next. What models/methods are involved in processing shopping cart price rules? How do I go about tracing the code so I can find out where the error happens?

Categories