Jump to content

Output Combinations Reference


Recommended Posts

Hi,

 

Relatively new to Prestashop and would be grateful for any help.

 

I'm wanting to include the Combinations Reference data(see below)in the option dropdown on my product page.

 

Hope that makes sense!

 

Thanks in advance.

post-1183561-0-47890700-1453908004_thumb.png

Link to comment
Share on other sites

Managed to sort this with the below code. Thought I'd post the solution in case anyone needed to do the same.

{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}
                                                             {foreach from=$combinations key=comb_key item=combination}
                                                                 {if isset($combination.attributes[0]) AND $combination.attributes[0] == $id_attribute|intval}
                                                                    - {$combination.reference}
                                                                    {/if} 
                                                                {/foreach}
                                                            </option>
{/foreach}
Edited by Timeh (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...