Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi,

When adding variables to an item like

Color[Red | Black=+3 | Green=-2]

Is it possible on the front end to display the full price in the drop down instead of [$+2]?

Thanks
I think we can use cms:pp_option_values tag as a tag-pair and generate our custom markup (including within it the combined price as we go).
Please see the 'Listing products' section of http://www.couchcms.com/docs/concepts/s ... art-1.html where a full example is given.

Hope this helps.
I have read that, and still no closer :)

In the example
Code: Select all
<div class="product-options"> 
   <cms:pp_product_options >
      <cms:if option_type='list'>
        <cms:if option_modifier='*' || option_modifier='**'>
            <label><cms:show option_name />:</label><br>
            <input type="hidden" name="on<cms:show k_count />" value="<cms:show option_name />" style="display:none;">
            <cms:set radio_input_name="os<cms:show k_count />" />
            <cms:pp_option_values>
                <label class="radio-label">
                    <input type="radio" name="<cms:show radio_input_name />" value="<cms:show k_count />"<cms:if k_count='0'> checked="true"</cms:if>>
                    <cms:show option_val />
                    <cms:if option_price >
                        [<cms:show option_price_sign /><cms:pp_config 'currency_symbol' /><cms:show option_price />]
                    </cms:if>
                </label>
                <cms:if option_modifier='*'><br/></cms:if>
            </cms:pp_option_values>
        <cms:else />
            <label><cms:show option_name />:</label><br>
            <input type="hidden" name="on<cms:show k_count />" value="<cms:show option_name />" style="display:none;"> 
            <select name="os<cms:show k_count />">
                <cms:pp_option_values>
                    <option value="<cms:show k_count />">
                        <cms:show option_val />
                        <cms:if option_price >
                            [<cms:show option_price_sign /><cms:pp_config 'currency_symbol' /><cms:show option_price />]
                        </cms:if>
                    </option>
                </cms:pp_option_values>
            </select>
        </cms:if>
      <cms:else />
        <label><cms:show option_name />:</label><br>: 
        <input type="hidden" name="on<cms:show k_count />" value="<cms:show option_name />" style="display:none;">
        <input type="text" name="os<cms:show k_count />" maxlength="200">
      </cms:if> 
   </cms:pp_product_options>
   <br>
</div>


I guess it is
Code: Select all
<cms:show option_price />
that needs to be changed somehow to show sum of base price + option price.
How would this be done? and could it work so, with a base price of $10 using
Color[Red=0 | Black=+3 | Green=+5]

Would make a list like

Red [$10]
Black [$13]
Green [$15]
Please find the following lines (there are two instances) in the code you mentioned -
Code: Select all
<cms:if option_price > 
    [<cms:show option_price_sign /><cms:pp_config 'currency_symbol' /><cms:show option_price />]
</cms:if>

- and replace them with the following
Code: Select all
<cms:if option_price > 
    <cms:set my_price="<cms:if option_price_sign='+'><cms:add pp_price option_price /><cms:else/><cms:sub pp_price option_price /></cms:if>" />
    [<cms:pp_config 'currency_symbol' /><cms:number_format my_price />]
<cms:else />
    [<cms:pp_config 'currency_symbol' /><cms:number_format pp_price />]
</cms:if>

That should display the price in your desired format.

Hope this helps.
Do let us know.

Thanks.
4 posts Page 1 of 1