AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.6 major bug when adding item to order for variant products with price modifiers
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Steps to reproduce:
1. Set up default AC906 install with sample data. 2. Create a new order, any product and any customer. 3. Modify the Spiky Massage Ball product to charge +$1 price modifier on each of the color choices. 4. View the order you just placed. On the View-Order page click the Items tab. 5. Click Add Product button. 6. Find the Spiky Massage Ball product, click the green + to add it. 7. Click the color option choices.
The product price is not changing based on the variant choice. The base product price remains unmodified in the price field. The price should change as soon as the variant selection is changed. If you add the product now to the shopper basket, you'll only get base price regardless of the variant choice(s).
I went from 904 to 906, so I can't tell you if this was introduced in 905 or 906.
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 472
Thanks: 4 times Was thanked: 34 time(s) in 33 post(s)
|
Hi Joe,
I confirmed the issue exists in both 9.0.5 and 9.0.6.
I will report it, but in the meantime, you can manually adjust the price to reflect the option choice price + base.
Thanks for letting us know. If there is an easy fix, we will post it here.
|
Thanks for your support!
Katie Secure eCommerce Software and Hosting |
1 user thanked Katie S for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Thanks. We were able to revert the 905 changes to the file to resolve the issue. The changes appear to have something to do with editing a Kit Master item from the Shipments tab. Not exactly sure on that, just deriving that from the code changes I saw.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 5/30/2020(UTC) Posts: 125
Thanks: 14 times Was thanked: 3 time(s) in 3 post(s)
|
Is there an easy code fix for this? It is going to be one of the first things our team notices when we switch to AC9.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 5/30/2020(UTC) Posts: 125
Thanks: 14 times Was thanked: 3 time(s) in 3 post(s)
|
I dug into the OrderController and think it is due to a change in the PrepareAddProductModel between 9.0.4 and 9.0.6. This code block appears to be the culprit (v9.0.6 lines 9982-9985): Code:if (model.IsKitMaster)
model.Price = pcalc.Price;
else
model.Price = isPostBack ? price : pcalc.Price;
I believe the isPostBack parameter was added so it would persist user-entered price modifications. However, when you select an option choice, it submits the form via JavaScript and also registers as a postback... The end result is that pcalc.Price doesn't fire, so the price modifier is never applied to the price. Probably need a hidden field that gets set when product options are changed so that the price gets applied.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 5/30/2020(UTC) Posts: 125
Thanks: 14 times Was thanked: 3 time(s) in 3 post(s)
|
Alright, my workaround is to modify v9.0.6 b7222 line 10156 from: Code:model = PrepareAddProductModel(model.ProductId, model.OrderId, model.ShipmentId, model.Quantity, model.Price, true);
To: Code:model = PrepareAddProductModel(model.ProductId, model.OrderId, model.ShipmentId, model.Quantity, model.Price, true && !string.IsNullOrEmpty(addToCart));
The new 9.0.6 code to prevent the user-entered price from being overwritten was preventing price modifiers from applying. With this modification, the price modifiers will apply unless the "Add Product" button is clicked (Note: This button click sets the addToCart to a non-empty value within /Areas/Admin/Orders/_AddProduct.cshtml)
|
1 user thanked sweeperqb for this useful post.
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.6 major bug when adding item to order for variant products with price modifiers
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close