Phantom48 Posted January 10, 2017 Share Posted January 10, 2017 Anybody make "Select multiple values for one feature" in 1.7 Presta? i can find any information. in 1.6 Presta i use multiple values for one feature, but how i can make it in 1.7? Thanks for help Link to comment Share on other sites More sharing options...
redclip Posted March 7, 2017 Share Posted March 7, 2017 i have 1.6.11 and i need Select multiple values for one feature on my site too... can anyone ???? i found 1.5 solution but not 1.6 Please HELP!!! Link to comment Share on other sites More sharing options...
Devhub Posted August 11, 2017 Share Posted August 11, 2017 I think I found solution to this problem that works for me in Prestashop 1.7.1.1. In file "/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php" you need to go to line around 308 with comment //map features and change code from this: //map features if (!empty($form_data['features'])) { foreach ($form_data['features'] as $dataFeature) { $idFeature = $dataFeature['feature']; //custom value is defined if ($dataFeature['custom_value'][$this->defaultLocale]) { foreach ($this->locales as $locale) { $form_data['feature_'.$idFeature.'_value'] = null; $form_data['custom_'.$idFeature.'_'.$locale['id_lang']] = $dataFeature['custom_value'][$locale['id_lang']]; } } elseif ($dataFeature['value']) { $form_data['feature_'.$idFeature.'_value'] = $dataFeature['value']; } } } to this: //map features if (!empty($form_data['features'])) { $n = 0; foreach ($form_data['features'] as $dataFeature) { $idFeature = $dataFeature['feature']; //custom value is defined if ($dataFeature['custom_value'][$this->defaultLocale]) { foreach ($this->locales as $locale) { $form_data['feature_'.$idFeature.'_value_'. $n] = null; $form_data['custom_'.$idFeature.'_'.$locale['id_lang']] = $dataFeature['custom_value'][$locale['id_lang']]; } } elseif ($dataFeature['value']) { $form_data['feature_'.$idFeature.'_value_'. $n] = $dataFeature['value']; } $n += 1; } } then in the database alter table primary key "ps_feature_product" ALTER TABLE ps_feature_product DROP PRIMARY KEY, ADD PRIMARY KEY (`id_feature`, `id_product`, `id_feature_value`); It's worth to notice that I used standard prefix. If you have changed your prefix then you should update it in this query. Give me some feedback. I'd like to know if it works for you. 2 1 Link to comment Share on other sites More sharing options...
mysho Posted September 8, 2017 Share Posted September 8, 2017 I think I found solution to this problem that works for me in Prestashop 1.7.1.1. In file "/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php" you need to go to line around 308 with comment //map features and change code from this: //map features if (!empty($form_data['features'])) { foreach ($form_data['features'] as $dataFeature) { $idFeature = $dataFeature['feature']; //custom value is defined if ($dataFeature['custom_value'][$this->defaultLocale]) { foreach ($this->locales as $locale) { $form_data['feature_'.$idFeature.'_value'] = null; $form_data['custom_'.$idFeature.'_'.$locale['id_lang']] = $dataFeature['custom_value'][$locale['id_lang']]; } } elseif ($dataFeature['value']) { $form_data['feature_'.$idFeature.'_value'] = $dataFeature['value']; } } } to this: //map features if (!empty($form_data['features'])) { $n = 0; foreach ($form_data['features'] as $dataFeature) { $idFeature = $dataFeature['feature']; //custom value is defined if ($dataFeature['custom_value'][$this->defaultLocale]) { foreach ($this->locales as $locale) { $form_data['feature_'.$idFeature.'_value_'. $n] = null; $form_data['custom_'.$idFeature.'_'.$locale['id_lang']] = $dataFeature['custom_value'][$locale['id_lang']]; } } elseif ($dataFeature['value']) { $form_data['feature_'.$idFeature.'_value_'. $n] = $dataFeature['value']; } $n += 1; } } then in the database alter table primary key "ps_feature_product" ALTER TABLE ps_feature_product DROP PRIMARY KEY, ADD PRIMARY KEY (`id_feature`, `id_product`, `id_feature_value`); It's worth to notice that I used standard prefix. If you have changed your prefix then you should update it in this query. Give me some feedback. I'd like to know if it works for you. Worked for me, PS 1.7.2.0 thanks! Link to comment Share on other sites More sharing options...
terranetpro Posted September 9, 2017 Share Posted September 9, 2017 There are special modules for this need. You can try to search on addons. Link to comment Share on other sites More sharing options...
DLC86 Posted October 18, 2017 Share Posted October 18, 2017 (edited) Hi all (first post here) and thanks devhub for your suggestion! I just tried this method on PS 1.7.2.3 and it works great, except for one thing: the product details tab in product page (front office) displays the same feature several times, one for each value. Do you know how to show all values on the same line separated for example by " / " or " - "? Thanks in advance Edited October 18, 2017 by DLC86 (see edit history) Link to comment Share on other sites More sharing options...
DLC86 Posted October 25, 2017 Share Posted October 25, 2017 Ok it seems that this feature will be natively available in prestashop 1.7.4, I'll wait for that. Link to comment Share on other sites More sharing options...
Gronneunger.dk Posted December 4, 2017 Share Posted December 4, 2017 On 11/8/2017 at 1:53 PM, Devhub said: I think I found solution to this problem that works for me in Prestashop 1.7.1.1. In file "/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php" you need to go to line around 308 with comment //map features and change code from this: //map features if (!empty($form_data['features'])) { foreach ($form_data['features'] as $dataFeature) { $idFeature = $dataFeature['feature']; //custom value is defined if ($dataFeature['custom_value'][$this->defaultLocale]) { foreach ($this->locales as $locale) { $form_data['feature_'.$idFeature.'_value'] = null; $form_data['custom_'.$idFeature.'_'.$locale['id_lang']] = $dataFeature['custom_value'][$locale['id_lang']]; } } elseif ($dataFeature['value']) { $form_data['feature_'.$idFeature.'_value'] = $dataFeature['value']; } } } to this: //map features if (!empty($form_data['features'])) { $n = 0; foreach ($form_data['features'] as $dataFeature) { $idFeature = $dataFeature['feature']; //custom value is defined if ($dataFeature['custom_value'][$this->defaultLocale]) { foreach ($this->locales as $locale) { $form_data['feature_'.$idFeature.'_value_'. $n] = null; $form_data['custom_'.$idFeature.'_'.$locale['id_lang']] = $dataFeature['custom_value'][$locale['id_lang']]; } } elseif ($dataFeature['value']) { $form_data['feature_'.$idFeature.'_value_'. $n] = $dataFeature['value']; } $n += 1; } } then in the database alter table primary key "ps_feature_product" ALTER TABLE ps_feature_product DROP PRIMARY KEY, ADD PRIMARY KEY (`id_feature`, `id_product`, `id_feature_value`); It's worth to notice that I used standard prefix. If you have changed your prefix then you should update it in this query. Give me some feedback. I'd like to know if it works for you. You made my day, Devhub!! Thanks for sharing that - super easy - solution! Thanks! Link to comment Share on other sites More sharing options...
stdeykun Posted March 27, 2018 Share Posted March 27, 2018 On 5.12.2017 at 1:58 PM, horiatb said: This feature should be available in 1.7.30 according to forge. I'd advice to wait for the official feature insead of altering core and database manually. It is available now but unfortunately quite uncomfortable when used in all products. Link to comment Share on other sites More sharing options...
canabislt Posted March 29, 2018 Share Posted March 29, 2018 This feature added on 1.7.3 by default tested and working good Link to comment Share on other sites More sharing options...
Guy Posted April 3, 2018 Share Posted April 3, 2018 On 3/29/2018 at 6:58 AM, canabislt said: This feature added on 1.7.3 by default tested and working good Is it multiple values in one line of feature, or multiple lines of the same feature? I upgraded to 1.7.3, but found I still couldn't select multiple values for one feature under the product page. Link to comment Share on other sites More sharing options...
thehurricane Posted June 7, 2018 Share Posted June 7, 2018 On 18.10.2017 at 7:07 PM, DLC86 said: Hi all (first post here) and thanks devhub for your suggestion! I just tried this method on PS 1.7.2.3 and it works great, except for one thing: the product details tab in product page (front office) displays the same feature several times, one for each value. Do you know how to show all values on the same line separated for example by " / " or " - "? Thanks in advance the same problem for me, any1 have solutions how to make it not double but in one line? Link to comment Share on other sites More sharing options...
ukbaz Posted June 28, 2019 Share Posted June 28, 2019 I'm running Prestashop 1.7.5.1 I can't find where to set multiple features - where is it anyone? Baz Link to comment Share on other sites More sharing options...
rdy4ever Posted June 28, 2019 Share Posted June 28, 2019 3 hours ago, ukbaz said: I'm running Prestashop 1.7.5.1 I can't find where to set multiple features - where is it anyone? Baz Hi Baz, You actually need to add each feature multiple times, with different values. In the front office, it will look like one feature with multiple values. This is not ideal, but that's how PS implemented this function (don 't know why). Link to comment Share on other sites More sharing options...
gerryg Posted July 3, 2019 Share Posted July 3, 2019 Buy this module, works great!! https://addons.prestashop.com/en/search-filters/6356-multiple-features-assign-your-features-as-you-want.html 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