Jump to content

[Resolved] Sort Options by Lowest denominator


keat

Recommended Posts

That is a decision made by the skin designer.

In the skin template content.product.php, find (the following is for Foundation, other skins will be similar):

            {elseif $option.type == Catalogue::OPTION_SELECT}
            <div class="row">
               <div class="small-12 columns">
                  {* If we only have one required option replace with hidden field *}
                  {if $option.required && count($option.values)===1}
                  <label for="option_{$option.option_id}" class="return">{$option.option_name}</label>
                  {$option.values.0.value_name}{if $option.values.0.price} {$option.values.0.symbol}{$option.values.0.price}{/if}
                  <input type="hidden" name="productOptions[{$option.option_id}]" id="option_{$option.option_id}" value="{$option.values.0.assign_id}" data-price="{$option.values.0.decimal_price}">
                  {else}
                  <label for="option_{$option.option_id}" class="return">{$option.option_name}{if $option.required} ({$LANG.common.required}){/if}</label>
                  <select name="productOptions[{$option.option_id}]" id="option_{$option.option_id}" class="nomarg" {if $option.required}required{/if}>
                     <option value="">{$LANG.form.please_select}</option>
                     {foreach from=$option.values item=value}
                     <option value="{$value.assign_id}"{if $value.absolute_price == '1'}class="absolute"{/if} data-price="{$value.decimal_price}">{$value.value_name}{if $value.price} {$value.symbol}{$value.price}{/if}</option>
                     {/foreach}
                  </select>
                  {/if}
               </div>
            </div>

Change this line: <option value="">{$LANG.form.please_select}</option>

To this: {* <option value="">{$LANG.form.please_select}</option> *}

Link to comment
Share on other sites

options.jpg.d84c651e38d7041822b29bbac331

 

Hi Brian.

 

I made the subtle change, and whilst it did indeed now default to something, it wasn't the lowest denominator.

For instance (fuses again), we sell in bags of 25, 50, 100, 500 & 1000.

It defaulted to 100

The entry for 100 units does appear in the table before the entry for 25 units..

I exported the table Cubecart_Option_Value, reordered the entries in a tidy order, changed the priority to suit, re-imported the table and now it defaults to the lowest option. I assume this is OK ?

Link to comment
Share on other sites

Is the image above now accurate based on what you manipulated in the table?

In admin, Product Options, Option Attributes tab, select from the drop-down the Option Name referencing the bag quantity.

In the table that appears, the up/down icon is a draggable handle that allows you to sort the Attributes (aka Option Values) for this option.

(Supposedly) No matter in which order these Attributes are assigned to the product, they will be sorted by the order shown in this table.

 

Link to comment
Share on other sites

Wish I'd known this earlier, however the method I took didn't take me long, less than 5 minutes to re-arrange the whole table.

Baically, I exported the table to a CSV file.

Arranged this in to order by value_name asc, re-arranged a few additional things like small, medium, large & X-large, then set the priority order from 1 through to  however many entries it had (about 40)

 

The image above was before I re-arranged the priority.
 

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.

×
×
  • Create New...