Timeh Posted January 27, 2016 Share Posted January 27, 2016 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. Link to comment Share on other sites More sharing options...
NemoPS Posted January 29, 2016 Share Posted January 29, 2016 (edited) I don't think it's possible, because that's a combination value, while the options are attributes. You can only display the new reference elsewhere once the combo is chosen (as per default) Edited January 29, 2016 by Nemo1 (see edit history) Link to comment Share on other sites More sharing options...
Timeh Posted January 29, 2016 Author Share Posted January 29, 2016 Thanks Nemo1, Was hoping there might be a relation between the combination and its attribute that I could access. Will keep trying and post back if I have any success. Link to comment Share on other sites More sharing options...
NemoPS Posted January 30, 2016 Share Posted January 30, 2016 There is, but each attribute then can have multiple references and it would be one for each combination it belongs to. Link to comment Share on other sites More sharing options...
Timeh Posted February 4, 2016 Author Share Posted February 4, 2016 (edited) 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 February 4, 2016 by Timeh (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now