Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Add a button that returns to a parent category in embedded modals  (Read 2941 times)

Offline carrerable

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
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

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Add a button that returns to a parent category in embedded modals
« Reply #1 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 ;-)
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod