AbanteCart Community

eCommerce construction => How-to questions => Topic started by: carrerable on March 08, 2021, 03:42:30 PM

Title: Add a button that returns to a parent category in embedded modals
Post by: carrerable on March 08, 2021, 03:42:30 PM
Hello, I have been trying to modify the structure of a modal to add a button that lets me navigate between the categories but I have not known how, can someone help me to Add a button that returns to a parent category in the embedded modals


AbanteCart Version 1.2.16
Title: Re: Add a button that returns to a parent category in embedded modals
Post by: abolabo on March 09, 2021, 04:36:45 AM
Hello, I have been trying to modify the structure of a modal to add a button that lets me navigate between the categories but I have not known how, can someone help me to Add a button that returns to a parent category in the embedded modals


AbanteCart Version 1.2.16

hi,
You can follow this steps:

1. determine what tpl used for modal (i guess pages/product/category.tpl)
2. write a hook that looking for embed get parameter from request. (see &embed_mode =1 OR $this->config->get('embed_mode') inside controller pages/product/category). You can use it to determine when embed mode is on.
3 inside hook method change tpl via $view->addHookVar('your_var_name', $your_button) in case when you have your own custom store template (you also need to add $this->getHookVar('your_var_name'))
In case when you use default template just replace tpl with your custom  tpl-file, that will contains needed buttons.

hope this help ;-)