Jump to content

Drop Down Menu for Configurable Options


rayb

Recommended Posts

Here's the rub, I set up a package that includes parts that are priced lower than the ones included. I put in a negative amount in the configurable options so that these parts subtract from the order summary price. Now the parts that have positive amounts have the dollar amounts appear next to the part names in the drop down menu. However the parts with negative amounts do not. These act as if there is a zero there and doesn't show the price amount except in the order summary. Is there a way for the negative price to appear on the drop down menu?screen shot.png

Link to comment
Share on other sites

These act as if there is a zero there and doesn't show the price amount except in the order summary. Is there a way for the negative price to appear on the drop down menu?

if the price is negative, that isn't passed to the option name value - whereas it is if it's positive... this is either a bug or WHMCS have made a conscious decision to not get involved in negative pricing formats... :?:

 

you can fix it by editing the standard_cart/configureproduct.tpl template and changing ~line145 from...

 

{$options.name}

to...

 

{$options.name}{if $options.recurring lt 0} {$currency.prefix}{$options.recurring}{$currency.suffix}{/if}

and you'll end up with this (ignore that the prices are shown in GBP, they should show the chosen currency on your site)...

 

PfeRC7U.png

 

I believe the above would be correct in the British currency format, but I think America tends to put negative values in parentheses, so you could use...

 

{$options.name}{if $options.recurring lt 0} ({$currency.prefix}{$options.recurring|replace:'-':''}{$currency.suffix}){/if}

 

2OXiZHw.png

 

you could then tweak that by adding "Save" to the output to emphasise that it is a reduction in price... though technically, you should probably use a Language Override to do this if using multiple languages.

 

{$options.name}{if $options.recurring lt 0} (Save {$currency.prefix}{$options.recurring|replace:'-':''}{$currency.suffix}){/if}

 

if you wanted to add a bit of colour to the output, you could modify the preceding line to add a class value to the option field. :idea:

 

<option {if $options.recurring lt 0}class="pink" {/if}value="{$options.id}"{if $configoption.selectedvalue eq $options.id} selected="selected"{/if}>

 

and then add the code below to six/css/custom.css

 

option.pink {background-color: #ffcccc;}

 

Wsep8Uy.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated