Hi Trendoman,
Thanks! I think your solution seems to be the closest to what I wanted. I understand the importance of separate price modifiers however in my instance I think I can get away without it. =
I've implemented the code and it comes up no problems in the back end. However on the front end, the options don't display under the product correctly unless there are two or more checkboxes ticked, i.e., small and medium, not just small or medium. Attached is a screenshot of just small being selected in the backend. You can see it's just an editbox.
I've put the code for the options below along with where they display on the product:
Another issue is the products don't filter at all by size through the front end. I'm dynamically grabbing the values from pp_option_size which show up correctly, but when selecting and pressing search they don't work. The code for this is below.
Thanks! I think your solution seems to be the closest to what I wanted. I understand the importance of separate price modifiers however in my instance I think I can get away without it. =
I've implemented the code and it comes up no problems in the back end. However on the front end, the options don't display under the product correctly unless there are two or more checkboxes ticked, i.e., small and medium, not just small or medium. Attached is a screenshot of just small being selected in the backend. You can see it's just an editbox.
I've put the code for the options below along with where they display on the product:
- Code: Select all
<cms:editable name='group_variants' label='Options' type='group' order='40' />
<cms:editable
name='explain_options'
type='message'
group='group_variants'
order='10'
>
<b>Product Options:</b><br/>
<font color='#777'>If this product has options (e.g. Size, Color or a Custom message)
add each to the box below using the following format:</font> <br/>
<font color='blue'><pre>
Color[Red | Black=+3 | Green=-2]
Size[Large | Medium | Small]*
Your Message[*TEXT*]
Your Message[*TEXT*=5]</pre></font>
<font color='#777'>Note that<br/>
1. Each variant is on a separate line.<br/>
2. If an option has a different price than the base price, you can specify the price difference too.<br/>
For example, the 'Black' option of 'Color' above will add $3 to the base price while the 'Green' will deduct $2. <br>
3. To create radio buttons instead of a dropdown add a '*' at the end as with 'Size' in the example above. <br/>
4. To create a textbox (if the variant consists of custom text e.g. message to be printed on T-Shirts), use '*TEXT*' as shown in the third variant above. You can also specify any price difference as shown in the last variant.</font>
</cms:editable>
<cms:config_form_view>
<cms:persist
pp_options="
Size[<cms:each frm_pp_option_size as='option' sep=','><cms:show option /><cms:if k_last_item='0'> | </cms:if></cms:each>]
Color[<cms:each frm_pp_option_color as='option' sep=','><cms:show option /><cms:if k_last_item='0'> | </cms:if></cms:each>]
"
/>
<cms:field name='pp_options' hide='1' />
<cms:field name='explain_options' hide='1' />
</cms:config_form_view>
<cms:editable
name='pp_options'
label=':'
height='130'
type='textarea'
group='group_variants'
order='11'
/>
<cms:editable
name='pp_option_size'
label='Size:'
type='checkbox'
group='group_variants'
opt_values = 'Small | Medium | Large'
order='12'
/>
<cms:editable
name='pp_option_color'
label='Color:'
type='checkbox'
group='group_variants'
opt_values = 'Red | Black [+$3] : Black=+3 | Green [-$2] : Green=-2'
val_separator=':'
order='12'
/>
- Code: Select all
<div class="product-options">
<cms:pp_product_options >
<label><cms:show option_name />:</label>
<cms:pp_option_values /><br>
</cms:pp_product_options >
</div>
Another issue is the products don't filter at all by size through the front end. I'm dynamically grabbing the values from pp_option_size which show up correctly, but when selecting and pressing search they don't work. The code for this is below.
- Code: Select all
<div id="quick-search">
<cms:form name="quicksearch" id="quicksearch" anchor='0'>
<cms:if k_success >
<cms:if frm_size!='-' >
<cms:set my_search_str="<cms:concat my_search_str ' | p_sizes>=' frm_size />" scope='global'/>
</cms:if>
<cms:if frm_min_price!='-' >
<cms:set my_search_str="<cms:concat my_search_str ' | pp_price>=' frm_min_price />" scope='global'/>
</cms:if>
<cms:if frm_max_price!='-' >
<cms:set my_search_str="<cms:concat my_search_str ' | pp_price<=' frm_max_price />" scope='global'/>
</cms:if>
</cms:if>
<div>
<label>Size</label>
<cms:input type="checkbox"
opt_values="
<cms:pages masterpage='shop.php'>
| <cms:show pp_option_size />
</cms:pages>
"
opt_selected='-'
name="size" id="size" />
</div>
<div>
<label>Minimum Price</label>
<cms:input type="dropdown"
opt_values='
No Minimum=- | $1=1 | $5=5 | $10=10
'
opt_selected='-'
name="min_price" id="min_price" />
</div>
<div>
<label>Maximum Price</label>
<cms:input type="dropdown"
opt_values='
No Maximum=- | $1=1 | $5=5 | $10=10
'
opt_selected='-'
name="max_price" id="max_price" />
</div>
<cms:input type="submit" class="fbsubmitbtn" value="Filter" name="submit"/>
</cms:form>
</div>