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

Extend module's layout.

 
Reply
   X-Cart forums > X-Cart 5 > Third Party Add-Ons for X-Cart 5
 
Thread Tools Search this Thread
  #1  
Old 05-30-2018, 12:29 AM
 
Soptareanu @Alex Soptareanu @Alex is offline
 

Advanced Member
  
Join Date: Apr 2018
Posts: 39
 

Default Extend module's layout.

I want to change some logic from product\details\stock\body.twig layout.
For that task, I decorate \XLite\View\Product\Details\Customer\Stock class and I override the getDefaultTemplate() method.
PHP Code:
protected function getDefaultTemplate()
    {
        return 
'modules/XGhosty/Disponibility/product/details/stock/body.twig';
    } 
It works very fine. But still it is a problem. I have install Backorder Module. This module also extands product\details\stock\body.twig layout. If this module is active the runner goes to the layout found in QSL\Backorder... and ignore the implementation of my module. How can i deal with such situation ?!
__________________
Soptareanu Alex
Reply With Quote
  #2  
Old 05-30-2018, 02:33 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Extend module's layout.

Quote:
Originally Posted by Soptareanu @Alex
I want to change some logic from product\details\stock\body.twig layout.
For that task, I decorate \XLite\View\Product\Details\Customer\Stock class and I override the getDefaultTemplate() method.
PHP Code:
protected function getDefaultTemplate()
    {
        return 
'modules/XGhosty/Disponibility/product/details/stock/body.twig';
    } 
It works very fine. But still it is a problem. I have install Backorder Module. This module also extands product\details\stock\body.twig layout. If this module is active the runner goes to the layout found in QSL\Backorder... and ignore the implementation of my module. How can i deal with such situation ?!

You can make your module to be placed after QSL/Backorder in decoration chain as explained here:
https://devs.x-cart.com/basics/making_one_module_depend_on_another_one_--_creating_a_menu_in_the_customer_area.html

This way you will be in control of final version of the class.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote

The following user thanks tony_sologubov for this useful post:
Soptareanu @Alex (05-30-2018)
Reply
   X-Cart forums > X-Cart 5 > Third Party Add-Ons for X-Cart 5


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:30 PM.

   

 
X-Cart forums © 2001-2020