kishoreunni Posted February 23, 2015 Share Posted February 23, 2015 for eg: we have 3 attributes for a pariticular group namely:- a,b,c then only 3 combinations are generated a,b,c. But how can we bring combinations such as ab,bc,ac,abc. please help me. Link to comment Share on other sites More sharing options...
NemoPS Posted February 23, 2015 Share Posted February 23, 2015 You can't combine 2 attributes of the same group, it's necessary to create different groups if you want so, no way around. It wouldn't make much sense either Link to comment Share on other sites More sharing options...
kishoreunni Posted February 23, 2015 Author Share Posted February 23, 2015 protected static function createCombinations($list) { if (count($list) <= 1) return count($list) ? array_map(create_function('$v', 'return (array($v));'), $list[0]) : $list; $res = array(); $first = array_pop($list); foreach ($first as $attribute) { $tab = AdminAttributeGeneratorController::createCombinations($list); foreach ($tab as $to_add) $res[] = is_array($to_add) ? array_merge($to_add, array($attribute)) : array($to_add, $attribute); } return $res; } can we change the above code to obtain such combinations Link to comment Share on other sites More sharing options...
NemoPS Posted February 25, 2015 Share Posted February 25, 2015 No. You wouldn't be able to use it in any other way even if you do. Link to comment Share on other sites More sharing options...
tomerg3 Posted February 25, 2015 Share Posted February 25, 2015 PrestaShop requires that you use 1 attribute value from each group when creating combinations, and each combination must have the same attribute groups. That means you cannot change the structure of combinations, unless you also change PrestaShop's way of handling combinations (which is a tall order). If you are looking for a system that would allow you to select only some attributes, try https://www.prestashop.com/forums/topic/47363-module-attribute-wizard-pro-create-unlimited-attributes-combinations-choose-frm-7-input-types Link to comment Share on other sites More sharing options...
kishoreunni Posted February 27, 2015 Author Share Posted February 27, 2015 PrestaShop requires that you use 1 attribute value from each group when creating combinations, and each combination must have the same attribute groups. That means you cannot change the structure of combinations, unless you also change PrestaShop's way of handling combinations (which is a tall order). If you are looking for a system that would allow you to select only some attributes, try https://www.prestashop.com/forums/topic/47363-module-attribute-wizard-pro-create-unlimited-attributes-combinations-choose-frm-7-input-types Thank you for your suggestion. Link to comment Share on other sites More sharing options...
Recommended Posts