Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

is it possible to override a module's yaml info

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 05-19-2015, 11:31 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: is it possible to override a module's yaml info

Hi guys,

Although you can edit the menu and change the link from "?target=brands" to something else, this won't change the URL to the page itself.

What the link says is that it is a page handled by "brands" controller. Once you change the "target" value, you link to a different controller class and everything will stop working.

The controller class for the page is \XLite\Module\QSL\ShopByBrand\Controller\Customer\ Brands.

So, here is what you are to do in your custom module/theme:

1. Add a new controller class for the new target that you need and extend it from \XLite\Module\QSL\ShopByBrand\Controller\Customer\ Brands controller to inherit all the methods necessary for the page.

2. Decorate \XLite\Module\QSL\ShopByBrand\Controller\Customer\ Brands and make it redirect users to your new controller if the target is "brands".

3. Decorate \XLite\Module\QSL\ShopByBrand\View\BrandsPage::get AllowedTargets() and remove "brands" item from the array and add your new target as a new item. If there are other View classes tied to "brands" target, decorate them as well.

This should help and will maintain the upgradability (even if something is changed in the original module classes, it will be a few minutes of work to update your classes to adapt to the changes).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
totaltec (05-20-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:50 AM.

   

 
X-Cart forums © 2001-2020