Jump to content

[MODIFICATION] Select multiple values for one feature


Recommended Posts

  • Replies 245
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

1.6 version attached. select-multiple-features-values_1.6.zip

Modification for PS 1.5.3.1 and 1.5.4.0   I have resigned from those overrides /override/controllers/front/ProductController.php /override/controllers/front/CompareController.php   and I have ad

OK, for Prestashop v1.5.1 :   In PS 1.5, admin controllers and admin templates are overridable, so we no longer need to modify core files.   There was 4 files to modify : /controllers/admin/Admin

Posted Images

Hi I have problem, i use this, and in old products all is ok, but in new is ok only in back-office.

 

in one products all is ok, but in other is wrong display

 

i use in product.tpl:

 

{foreach from=$features item=feature}

{if isset($feature.value)}

<li><span><b>{$feature.name|escape:'htmlall':'UTF-8'} :</b></span> {$feature.value|escape:'htmlall':'UTF-8'}</li>

{/if}

{/foreach}

 

see in "parametry"

 

http://x13.pl/klauzyla/80-nowy-modul-cookies-prestashop-popup.html# - is ok

 

http://x13.pl/moduly-prestashop/95-18-weryfikacja-wieku-prestashop.html# - is only one (2 is in backoffice and in blocklayered see 2)

 

http://x13.pl/szablony-graficzne-prestashop/94-auto-dark.html# - is double display

Share this post


Link to post
Share on other sites

I have all in one files ZIP, all is work perfect. (How I can add to post ?)

 

In files you have:

- override/classes

- override/controllers

- simple to change in product.tpl

 

In PS 1.5.4, you have to also delete file: /cache/class_index.php after copying new files to your override folder.

Share this post


Link to post
Share on other sites

hi xirius , so do the multiple features files work on yours? did you find out how to upload the files in the post ? if not would it be possible if I send you email address to forward them to me to try it ? I have had problem that it was setting by default ( the ones I am trying to give multiple values ) the value 'stereo jack " which is set up in demo prestashop when you install it. Even when i deleted the cache file , it was still adding it itself .Nightmare...

thank you ( if you would be so nice to send me the correct files )

Share this post


Link to post
Share on other sites

I need help with this:

1. It only saves one feature even if i tick in many, why? How to fix?

 

2. I will have like 1000values so will be really hard to choose from a list, is it possible to make search function? Like an autocomplete field (similar to the Accessories field on the Associations tab of a product).

a, if it exists allow users to select and add to the currents product feature.

b, if it does not exist, then add it to the available predefined values for that feature and add it to the current products feature.

Share this post


Link to post
Share on other sites

How to sort multiple values to be in the same order as BO in the product comparison?

as you can see, in the product comparison the values are sorted differently...

Untitled-1.jpg

 

some help please?

Share this post


Link to post
Share on other sites

I need help with this:

1. It only saves one feature even if i tick in many, why? How to fix?

 

2. I will have like 1000values so will be really hard to choose from a list, is it possible to make search function? Like an autocomplete field (similar to the Accessories field on the Associations tab of a product).

a, if it exists allow users to select and add to the currents product feature.

b, if it does not exist, then add it to the available predefined values for that feature and add it to the current products feature.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

I have bought the multiplefeatures module When you add extra values to a feature the same feature title is repeated for each value

 

I am told if you edit product.tpl you can get them to display in a line after the feature title

 

Does anyone know this snippet?

 

Thanks

Share this post


Link to post
Share on other sites

Nice module

 

This one works with ps 1.5.4.1?

 

Can i organize attributes by groups?

 

Example

Group: Multimedia

Value Audio (2.1,5.1, dolby...), video(PAL, SECAM, HD...), picture (JPEG,PNG...)

 

Group: Connection

value VGA (Yes/No), HDMI (Yes/No), DVI (Yes/No)

Share this post


Link to post
Share on other sites

PS 1.5.4 I needed to add multiple download files to a product - namely choice of 32 or 64 bit. Attachemtns wouldnt work since too large for ISP php service. I used Features and a new tab in product listing (modded products.tpl). The Feature Value I used was a filename to download. Problem was, I needed multiple values for a given feature thus bringing me to this topic. After deciding not to hack the core files, I simply created multiple Features called Files and assigned the values accordingly. PS doesnt seem to mind Features being called the same name and my simple product.tpl script mod seems to work fine with that. Now, when a customer goes to product, a tab called Extra Downloads appears and links to both files are listed along with other normal features and value. I'm still working out some kinks but same named features seem to work for the problem.

Share this post


Link to post
Share on other sites
  • 4 weeks later...

thanks for this solution, works great.

 

I have added 233 values into one feature, but when I want to edit them, back office displays only the first 50 values.

 

However, when I add a new product, I can choose from all 233 values.

 

Anyone has an idea what's causing this?

 

Currently, when I want to edit, or delete a value, I have to do it manually in the database ....

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Sorry if I write something partially off topic but as the multiple feature values seems to be a particularly important for the community, would it be more appropriate to make a pull request directly on github rather than simply create overrides?

 

Personally I've pickup the Mellow modification and I'm willing to make a pull request if everyone (i.e. the developers that contributed to this feature) agree with that.

 

I'm waiting for answers.

Edited by gr4devel (see edit history)

Share this post


Link to post
Share on other sites

hello guys. an update for 1.5.5?!

 

i tried to make it work but didn't got anywhere.

it doesn't update anymore and doesn't show the selected features on products page. even if they are set.

 

gives this error with dev_mode = true:

 

Warning: in_array() expects parameter 2 to be array, boolean given in /home/iulianv/public_html/cognac_expert/cache/smarty/compile/64/01/e6/6401e60a9863ccb8726ed28f11721986863843dd.file.features.tpl.php on line 97
onchange="$('.custom_14_').val(''); $('#feature_14_value').attr('checked', false); if ($(this).attr('checked')) $(this).closest('label').css('background-color', '#acd8fe'); else $(this).closest('label').css('background-color', '#ffffff');"> Extra

Share this post


Link to post
Share on other sites

Hi iulu2v!

 

That's strange my friend.

 

I've no such problem with my modification to get multiple feature values.

 

But maybe the ones that I've implemented aren't the same as yours.

 

Or maybe you have made the modification directly on the core files and now the mod are gone due the upgrade.

 

Have you implemented the multiple features through the override of the proper files or have you simply modified the core ones?

Share this post


Link to post
Share on other sites

hello gr4devel. thanks for your reply.

 

yes i used the override files. the thing is that i didn't simply upgraded my version of prestashop. i actually made a new installation imported my database, along with my override classes and templates + plus the ones from this modification.

 

in latest 1.5.4.1 it worked no problem, which makes me thing that the new version is different.

 

if i manually add features i can see them in front-end (not back though)

can't seem to find if the "getFrontFeaturesStatic" method has been updated with the new release.

again doesn't work on update product, but it doesn't show the ones selected either.

 

any suggestions?!

 

Thanks so much.

 

 

/*************************/

 

Later Edit:

 

YES, this modification works with version 1.5.5

 

silly me had my own custom AdminProductController that made some modifications and messed some functions, "getFrontFeaturesStatic" to.

 

Again, it works. Thanks!

 

/**************************/

Edited by iulu2v (see edit history)

Share this post


Link to post
Share on other sites

Modification for PS 1.5.3.1 and 1.5.4.0

 

I have resigned from those overrides

/override/controllers/front/ProductController.php

/override/controllers/front/CompareController.php

 

and I have added one override

/override/classes/Product.php

which works for pages: product details, compare products , RandomSpecial, BestSales, product Packs.

 

In PS 1.5.4, you have to also delete file: /cache/class_index.php after copying new files to your override folder.

 

<?php
class Product extends ProductCore
{
public static function getFrontFeaturesStatic($id_lang, $id_product)
{
  $process = (!array_key_exists($id_product.'-'.$id_lang, parent::$_frontFeaturesCache));
  $features = parent::getFrontFeaturesStatic($id_lang, $id_product);
  
  //PWeb: join multiple values of one feature into one value
  if ($process AND count($features)) {
   $features_key = array();
   foreach ($features as $key => $feature) {
	if (!array_key_exists($feature['name'], $features_key)) {
	 $features_key[$feature['name']] = $key;
	} else {
	 $features[ (int)$features_key[$feature['name']] ]['value'] .= ', ' . $feature['value'] ;
	 unset($features[$key]);
	}
   }
   parent::$_frontFeaturesCache[$id_product.'-'.$id_lang] = $features;
  }

  return $features;
}
}
Attachment has been updated and mistake in code has been corrected.

 

 

 

 

I've just override the files and deleted indexcache. 

Checkboxes showing at backoffice but cannot save changes, so not showing in frontoffice.

I didn't know that to do with the install.sql file? Is that the problem?

Share this post


Link to post
Share on other sites

Hello,

 

It is possible to have features in Layered Navigation but not showing in "Data sheet"?

I have products that are available for more that once of age category, but it's not relevant in "Data sheet" and are also, unsorted: Age : -9 - 0 months, 12 - 24 months, 0 - 12 months, 2 - 4 years.

 

Thanks!

Share this post


Link to post
Share on other sites

I ran into 2 little problems (bugs maybe???).

 

1. Similarly named feature values in 2 different features:

I have 2 different features (Product Category and Product Type) that both have one feature value with the same name (Accessoires).

 

If I check Accessoires in Product Category then the checkbox Accessoires in Product Type is checked as well. And also the other way round BTW.

 

I solved it by simply renaming one of the feature values, but it would be nice to have a real solution for this problem.

 

2. Checked feature values change magically after page refresh:

When I select several feature values and then do a page refresh it looks rather random which checkboxes will then be checked. A few checkboxes generally will still be correctly checked, but most of the times not all of them. Sometimes just one check is gone missing but on many occasions there is just another (seemingly random) checkbox checked, often in another feature.

Share this post


Link to post
Share on other sites

I did some further investigation on the "magically changing checkboxes" in my post above, and I noticed that when I only check 1 feature value and then do a page refresh the page returns with the next feature value in the list checked. And when the last feature value in a feature group is reached, it will skip to the first feature value in the next feature group.

 

Can anybody using this script confirm that they get the same behaviour or not? Because if I am the only one there must be something wrong in my setup.

 

BTW, I am running 1.5.4.1.

 

*** UPDATE ***

I found out that I had illegal characters in the feature values: ® and ™ to be precise. On import these characters were accepted without problems, but today I noticed that when I tried to edit any value with such a character in it, I got an error message about illegal characters.

 

So I deleted these characters from all feature values and then did a rebuild of all indexes in the Layered Navigation module and a rebuild of the search index. Now everything seems to work as it should.

 

Sadly I forgot to try and test if the solution was in the removal of the illegal characters before rebuilding all indexes, so I am unsure if it's solved by either one of my steps or by the combination of both steps. But I am glad it works :)

Edited by Toeareg (see edit history)

Share this post


Link to post
Share on other sites

This looks liek jsut what I was lookgin for.  My main reason is to use it in conjunction with the layered navigation block as I want one product to show for more than one of the feature searches.  So for example, a feature could be colours and the item could have both blue and red.  In the layerd nav, I want the item to show up for either blue OR red filtering or BOTH

 

Can anyone tell me if this works as expected?  I have PS 1.4.11

Share this post


Link to post
Share on other sites

Can anyone tell me if this works as expected?  I have PS 1.4.11

Hi,

The answer is yes, and this is one of the reasons why I made this modification !

It was for a site selling jams, and for a mixed jam containing yellow fruits and red berries I wanted layered navigation to show the product when filtering "Yellow fruit" OR "Red fruit" OR BOTH

 

So you can go, it works perfectly :)

You will just have to modify your files manualy because the files provided in the first post are for PS 1.4.8.2

  • Like 1

Share this post


Link to post
Share on other sites

I've installed version 1.5.4 posted by someone here (select-multiple-feature-values_override-files_PSv1.5.4.1.zip), however, when I apply new feature options, it won't update.

 

I've selected some options on a product, but it just sticks with "jack stero" after I save it and return to the product (doenst display new info in the front end of the shop either).

 

Any idea what's going on here?

post-354569-0-72817400-1380116373_thumb.png

Edited by CrossY (see edit history)

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Good day,

 

Many thanks Mellow and pweb,

I've made some changes to yours scripts:

- add the possibility to change the position of feature value (also with ajax drag and drop).

- the separator(between feature values) is space(by default), but it can be anythings typed at the end of each feature'value(,;- newline...).

- change presentation of product datasheet to be in a table with alternating row colors, not a list.

 

I have two problems with 1.5.3.1, after have did all changes, the tab with the features won't appear in the front-office, and always I entering in the back-office, in the tab features of the products to edit, I got a erro saying something like "Some guides don't be loaded correctly, don't you reloaded them?"

Share this post


Link to post
Share on other sites

Lo correcto seria :

 

sustituir

 

if ($val && $val[0] != 0)
    foreach ($val AS $feature_val) $product->addFeaturesToDB($match[1], $feature_val)
else

 

por

 

 

if ((is_array($val)==false) && ($val))
                                $product->addFeaturesToDB($match[1], $val);
                            
                            else if ((is_array($val)==true) && $val[0] != 0)
                                foreach ($val AS $feature_val) $product->addFeaturesToDB($match[1], $feature_val);
else

 

De esta forma grabaríamos tanto si el feature es un listbox como si es un checkbox multiiple

Share this post


Link to post
Share on other sites
  • 1 month later...

Hi All!

I am new to Prestashop and I am seriously considering using it for my shop. While evaluating it I found some restrictions and opened a ticket at forge.prestashop.com to ask the developers to include a very similar feature, that can be partially implemented by using multiple feature values per feature:

 

http://forge.prestashop.com/browse/PSCFV-11002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=79609#comment-79609

 

You're very welcome to add comments/suggestions. I hope at least they include the multiple value per feature in Prestashop 1.6!

I posted a link to this thread so they can take a look at Mellow's work (by the way, thanks for sharing it with the community!).

I have three questions:

1- Is Petete2008's suggestion part of the last version?

2- Has anybody tried Mellow's work with the latest stable release (1.5.6)?

3- Can this be implemented as a module for prestashop? I bet many users would use it if it could be installed from the Admin page...

Thanks!

Edited by Marcelo Ruiz (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites

Hi everyone!. I am getting to work this excelent job with Prestashop 1.5.6. The only problem is feature values are not grouped in the front-office "idtab2". More especifically, multiple values from same feature are listed one after the other and this is not very elegant. I was trying to replicate "features.tpl" foreach from the back-office to "product.tpl" in the F.O., but no success. Do anyone have solved this ?

 

EDIT: it is now working on PS 1.5.6. I had just forgoten to override the ProductController.php

If anyone needs the complete solution just let me know.

Edited by Galoper (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone!. I am getting to work this excelent job with Prestashop 1.5.6. The only problem is feature values are not grouped in the front-office "idtab2". More especifically, multiple values from same feature are listed one after the other and this is not very elegant. I was trying to replicate "features.tpl" foreach from the back-office to "product.tpl" in the F.O., but no success. Do anyone have solved this ?

 

EDIT: it is now working on PS 1.5.6. I had just forgoten to override the ProductController.php

If anyone needs the complete solution just let me know.

Hi Galoper, 

Can you please help with complete solution for PS 1.5.6? I need to list auto parts on my website and will be needing this. :)

Share this post


Link to post
Share on other sites

Hi everyone!. I am getting to work this excelent job with Prestashop 1.5.6. The only problem is feature values are not grouped in the front-office "idtab2". More especifically, multiple values from same feature are listed one after the other and this is not very elegant. I was trying to replicate "features.tpl" foreach from the back-office to "product.tpl" in the F.O., but no success. Do anyone have solved this ?

 

EDIT: it is now working on PS 1.5.6. I had just forgoten to override the ProductController.php

If anyone needs the complete solution just let me know.

I need the complete solution, please.

I think the better is to post it here so everybody can use it.

Share this post


Link to post
Share on other sites
  • 4 weeks later...

I am trying this solution with 1.4.11 and used this process to override AdminProducts.php: http://doc.prestashop.com/display/PS14/Overriding+Files

 

Now, while it hasn't worked, it isn't broken!  Basically, I can still not see any checkboxes for the features, only the original dropdown.  Any suggestions welcome...

 

 

Edit:

 

OK, it seems to be down to that method of overriding adminproducts as if I alter the file directly it works fine.  I'd rather not have to do it directly though if anyone can think of why this wouldn't be working for me.

 

Even more strange - if I try to change the name of the Features tab to Features2, this is shown, but not the changes I made to show the checkbox instead of the drop down!

Edited by babyewok (see edit history)

Share this post


Link to post
Share on other sites
  • 2 weeks later...

hello guys. thanks for amazing modification ! it's really nice and handy. 

i have a question.

 

i want to sell perfumes . all perfumes have 3 notes : top note , mid note and bottom note. notes are made with 3 or more element . for example mid note : orange , lemon , amber . 

 

unfortunately elements on these 3 notes are shared with each other. lemon can used in all 3 notes and the same story for orange and amber . so i want layered navigation block just show all elements not elements in each note .

 

normal layered navigation :

top notes:

o   element 1

o   element 2

o   element 3

 

mid notes:

o   element 2

o   element 4

o   element 6

 

bottom notes:

o   element 1

o   element 2

o   element 4

o   element 6

 

what i want :

notes:

o   element 1

o   element 2

o   element 3

o   element 4

o   element 5

o   element 6

 

 

is it possible to have this kind of layered navigation ? 

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hi everyone!. I am getting to work this excelent job with Prestashop 1.5.6. The only problem is feature values are not grouped in the front-office "idtab2". More especifically, multiple values from same feature are listed one after the other and this is not very elegant. I was trying to replicate "features.tpl" foreach from the back-office to "product.tpl" in the F.O., but no success. Do anyone have solved this ?

 

EDIT: it is now working on PS 1.5.6. I had just forgoten to override the ProductController.php

If anyone needs the complete solution just let me know.

 

Hi Galoper,

 

Can you please post the complete solution for 1.5.6?

 

Thanks,

D.

Edited by dumitru.ban (see edit history)

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Not working on my PS  1.5.5.0 

module is inserting max 1 entry with id_feature_value == 1 for  every feature category into pps_feature_product table. 

 

i only manage it to insert correct id_feature_value but stil max 1 table row for feature group .. someone help?

 

i did drop primary index ...

 

and that nestet foreach loop in AdminProductsController.php looks weird...

 

so ... any ideas ??

 

EDIT: its working now .. i screwed up :-)

Edited by xuderman (see edit history)

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Друзья, получилось запустить на Prestashop 1.5.6
1. вносим изменения в таблицу через phpMyAdmin.

2. Заменяем файлы в папке override/

также добавлял файл AdminProductsController.php.

3. меняем override/classes/Product.php на:

 

<?php
class Product extends ProductCore
{
    public static function getFrontFeaturesStatic($id_lang, $id_product)
    {
        if (!Feature::isFeatureActive())
            return array();
        //if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache))
        //{
            self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
                SELECT name, value, pf.id_feature
                FROM '
._DB_PREFIX_.'feature_product pf
                LEFT JOIN '
._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
                LEFT JOIN '
._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.')
                LEFT JOIN '
._DB_PREFIX_.'feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
                WHERE pf.id_product = '
.(int)$id_product.'
                ORDER BY f.position ASC'

            );
            
            
//PWeb: join multiple values of one feature into one value
            $features =& self::$_frontFeaturesCache[$id_product.'-'.$id_lang];
            $features_key = array();
            foreach ($features as $key => $feature) {
                if (!array_key_exists($feature['name'], $features_key)) {
                    $features_key[$feature['name']] = $key;
                } else {
                    $features[ (int)$features_key[$feature['name']] ]['value'] .= ', ' . $feature['value'] ;
                    unset($features[$key]);
                }
            }
        //}
        return self::$_frontFeaturesCache[$id_product.'-'.$id_lang];
    }
}

 

4. Вносим изменения в themes/theme/product.tpl

5. Удаляем файл  /cache/class_index.php

 

Это последовательность действий, которые помогли мне.
Спасибо за данный функционал!

Share this post


Link to post
Share on other sites

Not sure, but I think that you would like to sort the values of your features in layered navigation module.

In this case, you have to modify the module.

 

In blocklayered.php (getFilterBlock function)

 

~ line 2744 replace:

$sql_query['group'] = 'GROUP BY fv.id_feature_value ';
With:

$sql_query['group'] = 'GROUP BY fv.id_feature_value ORDER BY fvl.value ASC ';
~ line 2764 replace:

GROUP BY fv.id_feature_value';
With:

GROUP BY fv.id_feature_value ORDER BY fvl.value ASC';
Note that in case you disable "Hide filter values with no product matching" in layered navigation configuration, the values with no product matching will always be displayed at the end of the list...

 

Fantastic thank you, I have been looking to sort this for months :-)

Share this post


Link to post
Share on other sites
  • 2 weeks later...

hello Mellow

 

great job. I have a question:

is it possible to make this features "selectable" - for example to chose one feature from list - so it would work just like attributes but not affecting anything like price or weight.

I have 3000+ attributes and prestashop just crash when i try to generate them. so i'm looking ways to achieve this without combinations and attributes...

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hello Everyone,

I have good news.

 

I adapted Mellow modification for PS 1.5.6 with everything in just one file. I tested in my site and works perfect so I am gonna share with you.

 

http://www.tricksfordevelopers.com/wp-content/uploads/2014/03/select-multiple-features-values_PSv1.5.6.zip

 

Enjoy it

 

This solution works for me in version 1.6.0.5.

Thanks

  • Like 1

Share this post


Link to post
Share on other sites

I didn't test this last version, but I'm glad to see that this mod is still evaluating
Thanks to david-evolution and all other people who worked on it. :)

  • Like 1

Share this post


Link to post
Share on other sites

I used the files from david-evolutione and it worked great. Until... I updated the Layered Navigation Block module because the prices that show in product lists show the higher price within combination groups instead of the default combination price and the new version was suppose to fix this (and it did). (Went from Layered Nav version 1.10.1 to 1.10.8) After that update new products don't show the multiple features. The products that were already there still have multiple features, and more features can be added and subtracted. So I deleted the new version of the module, and reinstalled the old version, but still, no luck. New products still only show one feature, even with multiple features selected. I have re-uploaded all of the override files, I have verified the database settings, I have deleted the relevent cache files, I have re-compiled, cleared cache, etc etc. But I can't get the multiple features to show up anymore.

 

Thanks for your help in advance.

Edited by mr913 (see edit history)

Share this post


Link to post
Share on other sites

This solution works for me in version 1.6.0.5.

Thanks

How you change file Product.php?

 

because on server file have 192kb in solution - 2.4kb? or need and from solution not override?

 

thanks

Share this post


Link to post
Share on other sites
  • 2 weeks later...

As an update to my previous post regarding only one feature showing up with multiple features selected:

First, I reinstalled my last update. At first I thought this fixed it, but then, a couple of products later, the features wouldn't all show up again (Just the first selected feature was showing). So I read through all 160 posts. And there was a mention of a problem with caching. This ended up being my problem. I didn't do anything to fix it. But, when I load the page from a fresh web browser (that's never been to my page) all of the features show up. For some reason, when I first create the product and visit the product page for the first time, there's only 1 feature. If I refresh the page a few times, browse the rest of the site, and come back, all of the features show up. Clearing the Prestashop cache, forcing compilation, etc etc. doesn't affect it. I just have to wait a bit... and then it always works. 

 

PITA to figure that out....

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hello everyone. Is there a way to use this with the latest version of prestashop, 1.6.0.6, or has anybody tried to do the overide for this? I think it's a very important thing that prestashop should have done a long time ago by default.

 

If someone has a solution for prestashop 1.6 please post it here.

 

 

EDIT: I tried the solution for prestashop 1.5.6 but my frontoffice doesn't load. It may be because the overide "Products.php" is just a few kb and the default "Products.php" has more than 200 kb. Still waiting for a working solution.

Edited by danyell_dia (see edit history)

Share this post


Link to post
Share on other sites

Hello everyone. Is there a way to use this with the latest version of prestashop, 1.6.0.6, or has anybody tried to do the overide for this? I think it's a very important thing that prestashop should have done a long time ago by default.

 

If someone has a solution for prestashop 1.6 please post it here.

 

 

EDIT: I tried the solution for prestashop 1.5.6 but my frontoffice doesn't load. It may be because the overide "Products.php" is just a few kb and the default "Products.php" has more than 200 kb. Still waiting for a working solution.

 

I agree Prestashop should have done this a long time ago. I opened a bug a while ago (I specifically mention materials but at the end of the bug I mention that a temporary solution would be to allow multiple 'features'), but the developers think of it as a 'minor' improvement. Maybe if people in this thread comment in this bug, the developers would pay more attention to it.

There is a commercial module that provides exactly this feature, but I do think it should be an obvious part of Prestashop Core. Anyway, here is the link: 

 

http://forge.prestashop.com/browse/PSCFV-11002

 

Regards

Edited by Marcelo Ruiz (see edit history)

Share this post


Link to post
Share on other sites

If you have already tried my modification(for 1.5.6) and it isn't working I suggest you that you open your classes/Products.php file

and find the method that is being ovewritten in my module.

 

Copy that method and modify it in order to allow multiple features compared with my Module.

 

You will have to have a good understanding of PHP and MySQL to do this, otherwise I cannot help you.

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 2 months later...

Hi,

 

I am using Prestashop 1.6.5 with zensation theme, and tried to use this multiple features module. I am able to see the back-end changes, can select multiple values. but there is no option to save! Also after applying this changes my webfront is not loading properly.

 

The error displaying is attached.

 

please Help!

post-745465-0-37671900-1406373400_thumb.png

post-745465-0-37864500-1406373411_thumb.png

Share this post


Link to post
Share on other sites

I am going to explain you the best way to achieve this module without breaking your code.

Download the most recent plugin that was working, as far as I know my version works in 1.5.6.

 

Read the code that you see in the modification and compare it with your classess and controllers.

 

Once you have found the differences create override classes/controllers with the classes/controllers of your version and apply the differences.

My version is just that, I took the original files, look at what method were overwritten and how. Took the classes of my version and applied those changes.

It's just that.

Share this post


Link to post
Share on other sites
  • 4 weeks later...
  • 3 weeks later...

I don´t know how can I do this

 

 

 

Once there you will change the primary key existing to a combination of the three values:id_feature, id_product and id_feature_value.

 

What is it means?

 

This is my ps_feature_product

 

What Have I to change?

 

 

+ Opciones

Share this post


Link to post
Share on other sites

 

 

I don´t know how can I do this

 

 

 

Once there you will change the primary key existing to a combination of the three values:id_feature, id_product and id_feature_value.

 

What is it means?

 

This is my ps_feature_product

 

What Have I to change?

Run the following SQL-query:

ALTER TABLE `ps_feature_product`
  DROP PRIMARY KEY,
   ADD PRIMARY KEY(
     `id_feature`,
     `id_product`,
     `id_feature_value`);

 

  • Like 2

Share this post


Link to post
Share on other sites
  • 4 weeks later...

1.6 version attached.

Thank you so much for this!

Anyone's running into a problem with saving selected features? I can select multiple features, however, they won't save. They return to null after saving. ;(

I added the code in instructions to product.tpl as well (the file in the theme folder).

Share this post


Link to post
Share on other sites

Thank you so much for this!

Anyone's running into a problem with saving selected features? I can select multiple features, however, they won't save. They return to null after saving. ;(

I added the code in instructions to product.tpl as well (the file in the theme folder).

1.6 version suggested here doesn't work for 1.6.0.9 version.

 

I'm using prestashop 1.6.0.9 default theme and I got the same problem. I can select multiple features, but they don'

t save. They turn to null after hitting "Save" button. 

 

Would be great if someone please make this work for version 1.6.0.9.

 

Thank you

Share this post


Link to post
Share on other sites

Thank you so much for this!

Anyone's running into a problem with saving selected features? I can select multiple features, however, they won't save. They return to null after saving. ;(

I added the code in instructions to product.tpl as well (the file in the theme folder).

 

 

1.6 version suggested here doesn't work for 1.6.0.9 version.

 

I'm using prestashop 1.6.0.9 default theme and I got the same problem. I can select multiple features, but they don'

t save. They turn to null after hitting "Save" button. 

 

Would be great if someone please make this work for version 1.6.0.9.

 

Thank you

 

Works fine for me in 1.6.0.9 - have you altered the ps_feature_product table and deleted class_index.php?

Share this post


Link to post
Share on other sites