Jump to content

Module loyalty program 1.2.8 does not accept categories selection other than root category


Recommended Posts

Hello

 

Module Loyalty program 1.2.8 on PS1.6.1 does not accept categories selection but only the default selection of root category.

 

It is messy, and is not easy to describe all what happens there, by the way I start with the action that at least output an error.

 

Cliking on the root label in the tree, the tree is expanded, if you are fast enough to select one main or one sub category and save you get this error below:

 

Please note that in this circumstance you can not select more than one category or sub category...

[PrestaShopException]Selected categories value must be an arrayat line 219 in file classes/helper/HelperTreeCategories.php214.     }215.216.     public function setSelectedCategories($value)217.     {218.         if (!is_array($value))219.             throw new PrestaShopException('Selected categories value must be an array');220.221.         $this->_selected_categories = $value;222.         return $this;223.     }224.    HelperTreeCategoriesCore->setSelectedCategories - [line 105 - classes/helper/HelperForm.php] - [1 Arguments]    100.    101.                                 if (isset($params['name']))    102.                                     $tree->setInputName($params['name']);    103.    104.                                 if (isset($params['tree']['selected_categories']))    105.                                     $tree->setSelectedCategories($params['tree']['selected_categories']);    106.    107.                                 if (isset($params['tree']['disabled_categories']))    108.                                     $tree->setDisabledCategories($params['tree']['disabled_categories']);    109.    110.                                 if (isset($params['tree']['root_category']))    HelperFormCore->generate - [line 65 - classes/helper/HelperForm.php]    60.     }    61.    62.     public function generateForm($fields_form)    63.     {    64.         $this->fields_form = $fields_form;    65.         return $this->generate();    66.     }    67.    68.     public function generate()    69.     {    70.         $this->tpl = $this->createTemplate($this->base_tpl);    HelperFormCore->generateForm - [line 733 - modules/loyalty/loyalty.php] - [1 Arguments]    728.         $helper->tpl_vars = array(    729.             'fields_value' => $this->getConfigFieldsValues(),    730.             'languages' => $this->context->controller->getLanguages(),    731.             'id_language' => $this->context->language->id    732.         );    733.         return $helper->generateForm(array($fields_form_1, $fields_form_2));    734.     }    735.    736.     public function getConfigFieldsValues()    737.     {    738.         $fields_values = array(    Loyalty->renderForm - [line 256 - modules/loyalty/loyalty.php]    251.     public function getContent()    252.     {    253.         $this->instanceDefaultStates();    254.         $this->_postProcess();    255.    256.         $this->html .= $this->renderForm();    257.    258.         return $this->html;    259.     }    260.    261.     /* Hook display on product detail */    Loyalty->getContent - [line 851 - controllers/admin/AdminModulesController.php]    846.                                 $this->errors[] = Tools::displayError('You do not have permission to uninstall this module.');    847.    848.                             if (count($this->errors))    849.                                 continue;    850.                             // Get the return value of current method    851.                             $echo = $module->{$method}();    852.    853.                             // After a successful install of a single module that has a configuration method, to the configuration page    854.                             if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent'))    855.                                 Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12');    856.                         }    AdminModulesControllerCore->postProcessCallback - [line 1098 - controllers/admin/AdminModulesController.php]    1093.                     $ppm_return = $this->$ppm();    1094.             }    1095.    1096.         // Call appropriate module callback    1097.         if (!isset($ppm_return))    1098.             $this->postProcessCallback();    1099.    1100.         if ($back = Tools::getValue('back'))    1101.             Tools::redirectAdmin($back);    1102.     }    1103.    AdminModulesControllerCore->postProcess - [line 171 - classes/controller/Controller.php]    166.             // setMedia MUST be called before postProcess    167.             if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))    168.                 $this->setMedia();    169.    170.             // postProcess handles ajaxProcess    171.             $this->postProcess();    172.    173.             if (!empty($this->redirect_after))    174.                 $this->redirect();    175.    176.             if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))    ControllerCore->run - [line 373 - classes/Dispatcher.php]    368.             // Execute hook dispatcher    369.             if (isset($params_hook_action_dispatcher))    370.                 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);    371.    372.             // Running controller    373.             $controller->run();    374.         }    375.         catch (PrestaShopException $e)    376.         {    377.             $e->displayMessage();    378.         }    DispatcherCore->dispatch - [line 54 - admin/index.php]    49.     $_POST['controller'] = strtolower($_POST['tab']);    50. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab']))    51.     $_REQUEST['controller'] = strtolower($_REQUEST['tab']);    52.    53. // Prepare and trigger admin dispatcher    54. Dispatcher::getInstance()->dispatch();

Clinking on deselect all and select all does not work at all, noting changes.

 

When you expand the tree using the appropriate link above it a different formatting appears and you are allowed to deselect home category and select (multiple) other categories, when you save it gives no error in this circumstance, but then you see that it did not work.

 

The result is that the points are given anyway to all products

 

Reopening the module configuration panel there is no statement about the number of categories you selected, expanding the tree the result is that apparently no category was selected (but in the front office points are given for every product).

 

Selecting again the categories does not change the overall result, no changes are done, root/home category is kept as whole selection, points are assigned to every product, but again apparently there is no category selected, even not root.

 

Reselecting root and saving it show again the statement "1 selected" (root) "1 selected", the control box below in the green button is ticked BUT the formatting of the button to expand the tree does not work, it is shown only a white dot, further more the button does not not work

Clicking the button there is no reaction while clicking the buttons/labels (1 selected) and "root (1 selected)" the tree is expanded as explained above at the beginning of this post.

 

Another thing I noticed trying it again is that if you are not fast enough the page comes to be refreshed, and if you reached to select anything comes to be discarded.

 

It's a big mess, no idea why it happens but I guess can be understood by the error message I posted above.

 

What must be done to fix this issue?

 

Thank you in advance.

 

Bye

Link to comment
Share on other sites

Hello

 

I installed a fresh Prestashop 1.6.1.0 instance, this module does behave exactly the same way as I described above, the categories cannot be selected, so the module is truly buggy somehow in this respect.

 

Anyone from prestashop team is willing to fix this?

 

It is one of your official free modules, is there any reason why should not work?

 

At least, just in case some special difficulties are present, please remove that feature to choose the category, clearing out that only root category is chosen as default and cannot be modified in the free official module would be a much better presentation for prestashop's sales sake...

 

Anyone have an idea on how to fix this?

 

Thank you in advance

 

Best regards

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 3 weeks later...

Hi all,

I have the same problem...

 

into product view, when I refresh page, it charge point for a little moment but the it show "No reward points for this product."

into checkout it show points...

 

theme: default-bootstrap

PS v. 1.6.1.3

module loyalty v.1.2.8

 

ps: cache disable and force recompile

Edited by tecnico01 (see edit history)
Link to comment
Share on other sites

Maybe I have a solution but I'm a PS newbie so go with "caution" and feedback me if it's a correct fix...

 

I have comment {addJsDefL name=loyalty_nopoints}{l s='No reward points for this product.' mod='loyalty' js=1}{/addJsDefL} at the end of

product.tpl file (themes/default-bootstrap/modules/loyalty/views/templates/hook/product.tpl)

 

I wait feedback from PS community and even PS team

Link to comment
Share on other sites

  • 6 months later...
  • 4 weeks later...
  • 5 months later...
  • 5 months later...

BUMP!!!

 

I am having the same issue and cant find a solution still.

 

All categories are selected but all products show "No reward points for this product."

 

In cart it shows the points correctly.

 

 

UPDATE: THIS METHOD FIXED IT FOR ME https://www.prestashop.com/forums/topic/455383-loyalty-points-no-reward-points-for-this-product-when-attribute-chosen/?hl=loyalty

Edited by guixr (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...