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

Where to put a modified php file

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-18-2019, 01:51 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Where to put a modified php file

Hi there

I want to make a change to a php file that resides in the following directory in XC5:

classes/XLite/Module/QSL/WordPress/View/Plugins/RecentPosts

Although the file in question is part of the Blog System module, I could be asking about any similar php file anywhere in that directory structure.

I am using the Custom Skin mod also, so that any changes I make to templates, etc., will not change the original files.

My question is, where do I put my modified php file so that it will be executed instead of the original, but leaving the original intact?

Does it go somewhere in my custom skin directory, and is there anything else I should be aware of (clearing cache, or changing the namespace, for example)?

Many thanks

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
  #2  
Old 02-18-2019, 06:17 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Where to put a modified php file

For php files you need to create custom module and put any changes in there by decorating the original file.
Start here - https://devs.x-cart.com/
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 02-18-2019, 06:32 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Re: Where to put a modified php file

Hi Steve

Many thanks for your reply.

I don't understand much about this stuff, so to be clear, if I want to change one php file in an existing module, and I want to leave the original file in place (intact) so that future module upgrades will work fine and I won't lose the changes I am making, I need a new module?

I can't use the custom skin for this?

Thanks again.

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
  #4  
Old 02-18-2019, 06:43 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Where to put a modified php file

No. In order to make sure all custom changes to php files stay you need to put them in a separate module.
The custom skin is also a module. You can use it but still have to manually create these php files and the code in them.
So it is way better to have your own custom module for these changes instead of counting on XC module which may or may not be there with next XC upgrade...
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Triple A Racing (02-18-2019)
  #5  
Old 02-18-2019, 09:35 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Re: Where to put a modified php file

OK, thanks.

I'm not especially confident, but I might as well have a crack at it.

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (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:49 AM.

   

 
X-Cart forums © 2001-2020