1

I am using espresso-store 1.6.2, and working with the product modifiers. I've managed to get the dynamic product variable working for my price & sku in the main area (code below).

<div class="price_box">

      <h3><span class="store_product_price">{price}</span><span class="ft">{per_unit}</span></h3>

      <h4 style="text-decoration:none; font-size:13px;">Sku: #<strong class="store_product_sku">{sku}</strong></h4>


                     {modifiers}
    <hr>
                         <label>Options: {modifier_name}</label><br/>
                            {if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
                            <form class="store_product_form">
                            <select name="{modifier_input_name}" class="select" style="width:100%;">
                              {modifier_options}
                                <option value="{option_id}">
                                  {option_name}
                                  {if price_mod_val} {price_mod} {/if}
                                </option>
                              {/modifier_options}
                            </select>


                          {if:else}
                            <input type="text" name="{modifier_input_name}" />
                          {/if}
                          </form>


                    {/modifiers}


</div>

But when I try to use the <span class="store_product_price">{price}</span> anywhere else on my site it doesn't work, I can use it multiple time but only within the "price_box" div.

I guess i'm just wondering if you can only use the Dynamic Product Variables css classes only once?

Thanks in advance!

  • 1
    There were a couple of bug fixes dealing with dynamic variables in 1.6.3 can you upgrade to help with troubleshooting. The dynamic variables only work on pages that have one product form and they must be wrapped in the {exp:store:product} tag pair – Justin Long Apr 8 '13 at 20:24
  • Thanks for the reply Justin, but updating to 1.6.3 didn't fix it. I've been playing around a lot obviously trying to fix this. Even if I duplicate my "price_box" and have 2 right beside each other, only one will work. But if I have 2 <span class="store_product_price">{price}</span>'s within "price_box" it works. Thanks for your help. – Funkefied Apr 9 '13 at 18:42
  • Can you post your full template code? – Justin Long Apr 11 '13 at 3:43
1

I'm not sure exactly what the rest of your template code looks like, but there is certainly no limit on the number of times you can use the dynamic css variables like store_product_price in your template.

One caveat to remember is that they will only work inside your {exp:store:product} tag. So you won't be able to display them outside of the product tag.

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.