-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkout Amount in FastSpring does not represent Cart Quantities #8
Comments
I see. I had a default pricing that gets modified when a product is a sub but I didn't have that check in the correct place. This should be fixed. I also addressed an issue with coupons not being applied to subscription signup fees so that works now as well. Hopefully :) |
I will test this today. Thanks! More info to come! |
Unfortunately, this is still not working correctly. I updated, but am still getting the price for quantity 1 of each the first time that I select the checkout button that brings up the pop-up. The plugin is still not grabbing the correct quantities from the cart. If I cancel the pop-up, and click the button to bring up the checkout, the plugin grabs the correct prices. I am going to complete a checkout to see if the quantities are being reduced to 1, or if the prices are just being changed. More to come. |
More info on the behavior. When I visit the cart, and the popup gives me the cost for only 1 of each item, it is only passing 1 item through to fastspring. After I cancel the popup and click the checkout button again, it is passing all items through to fastspring. I think this must have something to do with where you are getting the items, because the plugin thinks that it is only passing 1 of each item through to fastspring the first time i go to the checkout. Hope that you get a chance to take a look at this soon. Thanks! |
Here is the log. I removed all the product and user information, but the important bits are there. You can see that even though the plugin detects that there are products in the cart, it still only passes quantity 1 for each item in the cart to fastspring. The second part of the log shows the calculation working correctly. You can see where I cancelled the checkout, and clicked the checkout button again. The plugin then gets the correct value and quantity for all items in the cart. 06-20-2018 @ 02:47:00 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38 |
I am not able to recreate this. Let's confirm your process. You have a regular item (not a subscription) of say $20. You add 2 to cart, go to checkout which shows $40, select FS and click Place Order at which point the FS popup says $20? Can you enable SCRIPT_DEBUG and inspect the console log and look for the payload part which has the items with pricing/qty. See https://github.com/cyberwombat/woocommerce-fastspring-payment-gateway/wiki/Troubleshooting |
Aha! Maybe that was where the disconnect was. These are not regular items, but subscriptions. All of the items in my store are subscriptions. However, I allow customers to buy multiple quantities of license subscriptions of the software. So when I say “item” you can substitute “subscription”.
Here is my process.
I add two items (subscriptions) to the cart from my store category page.
I then go to the cart and increase the quantity on one of the items (subscriptions) to 5 or 6 (or any other qty, the behavior is the same.)
I then click on checkout. This takes me to the checkout page, where I fill out my information, and click the “Pay for items” button.
This brings up the fastspring popup, which only has quantity one for each item (subscription), and price accordingly.
If I cancel this, and click the “Pay for Items” button again, it brings up the fastspring popup, but with the correct quantities and pricing. This continues to work until I go back to the cart, at which time it again only gives me quantity 1.
I have verified in fastspring that it is only receiving quantity 1, and you can see from the log that I posted that this is the case.
Here are the relevant sections of the log:
This part says that the plugin is calculating the price for qty 5 of item priced $38, and qty 1 of item priced $50. This is after I came from the cart, filled out my information, and then clicked the “Pay for Item” button
06-20-2018 @ 02:47:00 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38
06-20-2018 @ 02:47:00 - Calculating pricing for amount of 50 and qty of 1 with cart total of 240 and discount of 0: 50
06-20-2018 @ 02:47:39 - API order hJUpZ90iTvy23SBi5PW6ew completion checked
06-20-2018 @ 02:47:40 - Marking order ID 3812 as complete
Here is the part that doesn’t make sense. It says quantity: 1, but should say quantity: 5.
[{"id":"jG3agjboRsubC5EIbCwTcQ","processed":false,"created":1529480854460,"type":"subscription.activated","live":false,"data":{"id":"yXF62FiZRNSph09Il_ZrnA","subscription":"yXF62FiZRNSph09Il_ZrnA","active":true,"state":"active","changed":1529480854135,"changedValue":1529480854135,"changedInSeconds":1529480854,"changedDisplay":"6/20/18","live":false,"currency":"USD","account":"","product":"product-with-premium-support","sku":"PS101PT05","display":"product with Premium Support","**quantity":1**,"adhoc":false,"autoRenew":true,"price":38,"priceDisplay":"$38.00","priceInPayoutCurrency":38,"priceInPayoutCurrencyDisplay":"$38.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subtotal":38,"subtotalDisplay":"$38.00","subtotalInPayoutCurrency":38,"subtotalInPayoutCurrencyDisplay":"$38.00","attributes":{"webhook_action":"UpdateUserInformation"},"tags":
Below in the log is the part where I canceled and then clicked the “Pay for item” button again. You can see that the plugin calculated pricing twice.
First time to the fastspring window, after visiting the cart.
06-20-2018 @ 02:48:31 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38
06-20-2018 @ 02:48:31 - Calculating pricing for amount of 50 and qty of 1 with cart total of 240 and discount of 0: 50
However, I get the wrong pricing and quantities in the fastspring window, so I cancel and try again.
06-20-2018 @ 02:49:01 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38
06-20-2018 @ 02:49:01 - Calculating pricing for amount of 50 and qty of 1 with cart total of 240 and discount of 0: 50
06-20-2018 @ 02:49:38 - API order EEcUqi6uQEyekobvPK9qFw completion checked
06-20-2018 @ 02:49:38 - Marking order ID 3815 as complete
And now the quantity is also correct. See below the the quantity value is 5.
[{"id":"xRYSE9-MQcucBC1xaaL0uA","processed":false,"created":1529480973574,"type":"subscription.activated","live":false,"data":{"id":"N2d5-kQ9TmupHncT5q3Lyw","subscription":"N2d5-kQ9TmupHncT5q3Lyw","active":true,"state":"active","changed":1529480973284,"changedValue":1529480973284,"changedInSeconds":1529480973,"changedDisplay":"6/20/18","live":false,"currency":"USD","account":"","product":"product-with-premium-support","sku":"PS101PT05","display":"product with Premium Support","quantity":5,"adhoc":false,"autoRenew":true,"price":38,"priceDisplay":"$38.00","priceInPayoutCurrency":38,"priceInPayoutCurrencyDisplay":"$38.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subtotal":190,"subtotalDisplay":"$190.00","subtotalInPayoutCurrency":190,"subtotalInPayoutCurrencyDisplay":"$190.00","attributes":{"webhook_action":"UpdateUserInformation"},"tags":
You are calculating pricing correctly, but for some reason, if you go to the cart and then directly to checkout and payment, the quantity information is not making it to fastspring. If you cancel the fastspring window, and click the “Pay for item” button again, it does make it to fastspring.
Hope that this helps. Thanks!
From: Yashua [mailto:notifications@github.com]
Sent: Wednesday, June 20, 2018 2:04 PM
To: cyberwombat/woocommerce-fastspring-payment-gateway
Cc: ps-PKrueger; Author
Subject: Re: [cyberwombat/woocommerce-fastspring-payment-gateway] Checkout Amount in FastSpring does not represent Cart Quantities (#8)
I am not able to recreate this. Let's confirm your process. You have a regular item (not a subscription) of say $20. You add 2 to cart, go to checkout which shows $40, select FS and click Place Order at which point the FS popup says $20?
Can you enable SCRIPT_DEBUG and inspect the console log and look for the payload part which has the items with pricing/qty. See https://github.com/cyberwombat/woocommerce-fastspring-payment-gateway/wiki/Troubleshooting
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#8 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMQUlAJ6xsls3m4F8tU4uBZH9_miUb5mks5t-pyagaJpZM4Ur2w9> . <https://github.com/notifications/beacon/AMQUlPWcP57vXKL1k_TmHctXoflFUz3Bks5t-pyagaJpZM4Ur2w9.gif>
…---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|
Ok - hopefully I got it. Turns out that Woo gives a line total for each non subscription item but totals all quantities of a subscription together. There may be some property I am not aware of that will smooth this up but for now I handled it in the code by multiplying for quantity only in the case of non sub items. Seems to come out ok. Try it out. |
Unfortunately, I am still getting the same behavior with 1.1.4 as with 1.1.3. The first time that I click through, I get quantity 1 for each subscription in the fastspring window. After I cancel and spawn the window again, I get the correct amount of subscriptions. But any time I go back to the cart, it starts again. Try putting some subscription items into your cart, and increase the quantity of one of them past 1 (in the cart). Update your cart. Then try checking out. You will get the amount for quantity 1 of the subscription, and fastspring will only receive quantity 1 of the subscription. Then cancel the fastspring window, and try checking out again. Now fastspring will get the right quantity of subscriptions. Something is only allowing 1 subscription item through the first time. Hope this helps. |
Thats odd. I do exactly that and I always get the correct quantity. I wonder if there is something about your WP/Woo flow that is different. On top of that the issue I was working on would not have affected that in a way that could be changed by reloading. Is there a demo site I can look at? |
I am making this a separate issue, as the issues may not be connected in the plugin.
1.1.2 seems to have solved the dividing error (dividing the price by the number of items of that type in the cart), but now there is an error when updating the cart. This happens when I am in the cart, and I have selected multiple items with quantities. When I first go to the checkout page, add my info and click the "Place Order" button, I get a price value in the pop up that is for quantity 1 of each item in the cart. When I cancel and click the "Place Order" button again, it updates to the correct value for all items and quantities in the cart.
If I go back to the cart, it resets with this same behavior, so I think that it may be pulling incorrect quantity information from the cart. I added a picture so that you could see the different prices.
The text was updated successfully, but these errors were encountered: