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

Run a sql command during mod installation

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 09-24-2015, 05:23 AM
 
Phil Richman Phil Richman is offline
 

Advanced Member
  
Join Date: May 2012
Posts: 94
 

Default Run a sql command during mod installation

Does anyone know how to run a sql command during the install of a mod? I have a mod that modifies how clean urls work in 5.2.x, but I had to manually run a sql command to remove all of the extensions from the clean url table. Is there a way I could have included that command in my mod, so that the command would run during installation?
__________________
Ver 5.2.6
Reply With Quote
  #2  
Old 09-24-2015, 06:45 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Run a sql command during mod installation

Use the hooks scripts - http://kb.x-cart.com/display/XDD/Upgrading+X-Cart+5
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-24-2015, 06:46 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Run a sql command during mod installation

Or make your module to check if the url has extension and remove it before returning the url
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 09-24-2015, 09:17 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Run a sql command during mod installation

You should look into implementing \XLite\Module\AModule::callInstallEvent() method in your Main.php class.
__________________
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:
cflsystems (09-25-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 03:36 PM.

   

 
X-Cart forums © 2001-2020