Checkbox List with Conditional Checkbox Lists

1 month ago
Working with:
  - no-source nopCommerce 4.50.1
  - restaurant ordering

  - ordering multiple items at the same time when items have conditional checkbox attributes

On a few pages, customers should be able to order all food items at the same time in different quantities, like Drinks, where some items can be configured with multiple conditions (like, ice/no ice, small/medium/large etc.)

I tried adding a checkbox list where list items are either Associated to Product and customer can choose quantity or Simple with a conditional checkbox list attached, creating a tree of checkbox attributes, but this does not work. What happens is that only one item with conditional attributes can be ordered, multiple items without conditional attributes can be ordered, or only the top tier of the tree is shown and can be ordered.

Two drinks, A and B can be ordered, A has 2 sizes, A1 and A2 (as conditional attributes), and B has only 1 size. I can order A with whatever quantities for A1 and A2 and add to cart or I can order B in whatever quantities I want and add to cart, but I cannot order A1, A2, and B in whatever quantities and Add to Cart.

One solution is to display all possible combinations in a checkbox list. In the example, I would show A in A1 size, A in A2 size, and B. However, (1) it would be easier for customers to have A1 and A2 popup only if they order A; and, (2) this gets unwieldy if multiple conditional attributes are needed (like, 4 drink flavors, ice/no ice, and 3 sizes would give 4 x 2 x 3 = 24 items).

A partial solution is to force customers to only order 1 item at a time by using radio button lists except for the final drink option. So, either A or B can be chosen but not both. If A is chosen, then A1 and A2 with quantities are shown. If B is chosen, a quantity is shown. However, this is not the preferred behavior.

How could this be done? Is there a plugin for it? Can no-source nopCommerce be modified to do it?
2 weeks ago

This is possible with coding in _ProductAttributes.cshtml:

(1) Add all possible combinations of menu options as values to a checkbox attribute using names that include each menu option with a delimiter, like "name1 -- name2 -- name3 -- name4". nopCommerce allows all these checked items to be stored at the same time.
(2) Hide all of these combinations.
(3) Create a new set of checkboxes for display that are properly linked to the hidden ones with jQuery, pulling out the options from the names for display

These leaves out a lot of details, but gives a general overview of what needs to be done.
2 weeks ago
Yes you can do something like that
I load a custom version of _ProductAttributes.cshtml in my Accommodation Booking Plugin
I use the Date Type Product Attributes in a Booking form
I have designated product attributes which are hidden and prefilled with the dates selected in previous steps