logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Friday, November 5, 2021 7:19:45 AM(UTC)
Joe Payne2

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)
Make some coffee or open another Dr Pepper, because this one is really fun:

Create a product template. Give it any name.
Add a customer field. Make it a RadioButtonList or CheckboxList type. I used RadioButtonList.

Add one choice. Set the choice name to "Non-cancelable, non-returnable." and make the value EXACTLY the same "Non-cancelable, non-returnable."
Mark your one choice Selected.

Now find a product with variants. Ideally a product that will render multiple dropdowns on the product page but at least one variant dropdown should be enough.
Assign the new product template to the product.
Preview the product.

When the product renders, you correctly see the variant dropdown(s) from BuyProductDialog.
You also correctly see one radio button choice, selected by default, for your customer product template you added.

Capture.JPG (13kb) downloaded 0 time(s).

Now make a variant selection in a dropdown. During the postback, the radio button choice is toggled off. Now it's not selected.

Make another variant selection. Again, the postback fires and again toggles the radio button choice. Now it's back to selected.

Rinse and repeat. The radio button choice keeps alternating between on or off with each postback.

The cause:
In the ProductController.GetProductTemplateFields() routine, the code correctly parses for the control type (checkbox, radiobuttons etc). However it's trying to split the choice values from the customer input control assuming a comma separates each choice. Except this is a single choice. There's only one possible value and splitting the string is not appropriate.

And.........splitting the string based on the comma, when the actual choice value already contains a comma (Non-cancelable, non-returnable.), results in the wrong value being parsed (Non-cancelable). Since the value 'Non-cancelable' doesn't match 'Non-cancelable, non-returnable.', the control is not marked as selected.

This is what causes the UI control to toggle with each postback.

End result: You can't use a comma in the value of a choice for a product template that is based on the checkbox, radiobuttonlist etc controls.

I'm going to remove the comma from the choice value. I'll let you guys figure out how to fix that code :)

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Friday, November 5, 2021 11:11:10 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
I am reporting the issue. Thanks for sharing the details.

Regards
thanks 1 user thanked shaharyar for this useful post.
Joe Payne2 on 11/5/2021(UTC)
Users browsing this topic
Guest (3)
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.