Product extras

Hi there,
I am so happy to follow this example: Item Options - modmore documentation and build the same product.

However, I found some inconsistency in the readme text and code:

  • the readme article says the extra option can be just as simple as <input type="checkbox" name="[[+scriptProperties.name]]" value="[[+id]]">, so in my case the name is Sides which is also allowed in the Item Data module for Commerce in the field: Allowed fields

  • while the cart items tpl code is using the adjustments and the filter

{% set adjustments = item.adjustments|filter(v => v.type == 'extra') %}
                   {% if adjustments|length > 0 %}
                       {% for adjustment in adjustments %}
                           <br>
                           &plus;&nbsp;{{ adjustment.name }}
                           ({{ adjustment.total_change_formatted }})
                       {% endfor %}
             {% endif %}

So, the question: how should the additional ‘sides’ be named in the html and what needs to be set per that side product settings or in the item data module, please?

Item Options and Item Data are two different modules and they do not interact with each other.

For storing arbitrary data in the item properties, you use item data.

For adding one product as an adjustment to another (e.g. to increase the cost when selecting a gift wrapped option), you use item options.

1 Like

Dear Mark,
thanks for your quick reply and in regards to

please advise how it’s best to get it?

You know I can’t find it in Commerce

or on the website: Extensions for Commerce • Commerce • modmore.com

Thanks in advance :man_genie:

Hi @fuddus
You can download the ItemOptions module from the modmore package provider. Once it’s installed, you’ll be able to find it in the Commerce -> Configuration -> Modules grid. :slight_smile:

Hi Murray,
thanks for getting back to me

OK, I have check this but it seems it just can’t find it, see below

while when I try Commerce for example it find modmore’s addons as follows:

Do you have any idea how to help, please? :upside_down_face:

It’s in the modmore package provider, not the standard MODX one. Try searching for “options”:

We’ll get it added to the list of extensions on the site after the Berlin meetup, looks like we forgot about that when releasing it.

1 Like

Thank you all for the help. Just to confirm the example from Item Options - modmore documentation works fine in commerce 1.4 :crazy_face:
Have a good time tomorrow in Berlin, will be watching you MODX Berlin 2023 - YouTube