The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Product options in Modx

cmccmc Member
in Help edited April 2012
I'm currently setting up a new store in Modx revo.

I have a number of product that all share the same product options e.g size, then a number of products in the same category that don't have any options, or only have 2 out of 3 options.

Whats the best way to go about this?

I presume i'll need to create a TV but i need some easy method of having that TV only show up on the products that actually have any options.

I don't think having two templates is the way to go as it's a bit clumbsy.


  • cmccmc Member
    edited April 2012
    No i don't think so.

    Foxy cart passes options like so:
    <label class="label_left">Size:</label>
    <select name="size">
    	<option value="small">Small</option>
    	<option value="medium">Medium</option>
    	<option value="large">Large</option>

    Now i could just include that code in my add to cart code, but then every product would have the same options.

    I could create a number TVs like:

    <label class="label_left">Size:</label>
    <select name="size">
    	<option value="[[*option1]]">[[*option1]]</option>
    	<option value="[[*option2]]">[[*option2]]</option>
    	<option value="[[*option3]]">[[*option3]]</option>

    That would allow me to set the product options on a product by product basis. Since loads of products share the same options, that's too much work.

    But, what if I don't want to pass any options at all? e.g the product might be a scarf that only comes in one size.

    In both instances I have no way of telling modx not to pass any options at all to foxycart. Unless i use a completely separate template for these no-option products, compared to my products with options.

    I'd like to avoid that if at all possible.

    I think what i'm asking is for a way to have a TV running on my product template, but be able to turn that TV off when not needed.

    You know what, i think i've cracked it.

    I could create a TV that has a html input of:
    <label class="label_left">Size:</label>
    <select name="size">
    	<option value="small">Small</option>
    	<option value="medium">Medium</option>
    	<option value="large">Large</option>

    Then and the same output set as default.

    This will be available in all my product pages under the TV tab. As its basically just a text area, for any products I don't want to have options, I can just delete that code right there within that product resource.

    This will also allow me to modify the sizes if needed, or just leave the code alone if i want my products to be available with the default sizes.

    It's not going to be elegant, but it will work.

  • lancelance Member, Community Support Member
    @cmc -

    One possible option would be to write a quick snippet that you call in your template that outputs the appropriate option mark-up. For instance, you could create a Dropdown TV where you determine what you are including as an option with the product, e.g. Default, Custom, None. A second TV could be used to set the custom options, if applicable. The Snippet would check the first TV and take the appropriate action when writing out the template.

    Does this make sense? Might it work for you?

Sign In or Register to comment.