7

I'm building an XML-feed for publishing my client's products to a third party, and I need to output a list of modifier-options sans the form-tag. I would imagine this to work something along these lines:

{product_store_variations:modifier_options backspace='1'}
    {option_name}
{/product_store_variations:modifier_options}

This doesn't output anything though. Any thoughts?

5

You can access most of the basic variables directly through the "Product Details" fieldtype. For example, assuming you named your field product_details, you can access the price inside your channel entries tag like so:

{product_details:price}

However, you can't access the modifiers that way (there is no way for the fieldtype to return variable loops).

To use the standard Product tag without a form, simply add the disable_form parameter:

{exp:store:product entry_id="123" disable_form="yes"}
    {modifiers}
        <!-- code here -->
    {/modifiers}
{/exp:store:product}

Reference: https://exp-resso.com/docs/product_tag.html#disable_form

  • Oh awesome, hadn't noticed that parameter! Additional question: does the {modifier_options} tag have a backspace parameter by any chance? If not: feature-request much? :D – Steven Nov 22 '12 at 10:32
  • It's not possible to add parameters to tags like that without resorting to nasty regexes, and I'm pretty against the backspace parameter in principle anyway. What exactly do you need to do? There might be a better way around it. (feel free to post another question if you want to elaborate a bit more) – Adrian Macneil Nov 22 '12 at 10:35
  • I'm trying to output all available sizes (my client sells clothing/fashion items), separated by a slash (not my idea, it's going to a 3rd party in XML-form). I added the disable_form='yes' parameter, but I'm still getting heaps of JS outputted... can I get rid of that too? – Steven Nov 22 '12 at 10:47
  • There's a disable_javascript parameter coming in the next version :) For now, you could potentially hack up/comment out relevant lines in mod.store.php. – Adrian Macneil Nov 22 '12 at 12:03
  • But if I comment out those lines the js will be disabled site-wide, right? That's not exactly ideal either... – Steven Nov 22 '12 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.