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

make a module??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-19-2011, 02:30 AM
  techker's Avatar 
techker techker is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 155
 

Default make a module??

Hey guys is there a tutorial on how to make a module?

or i need to add a function....

is there anything out there that can help me??
__________________
X-Cart version 4.4.3
Reply With Quote
  #2  
Old 07-19-2011, 04:35 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: make a module??

Moving to "Program Logic" forum.

There is no tutorial unfortunately. But you can always check the source code of any built-in module to get the idea.

I suppose the sitemap module can be used as a source:
Code:
grep -r "\/Sitemap\/" *

Also, check this -> http://help.qtmsoft.com/index.php?title=X-Cart:Integration_with_third_party_modules
__________________
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
  #3  
Old 10-24-2011, 08:29 PM
 
Powertrain Powertrain is offline
 

Senior Member
  
Join Date: Mar 2011
Posts: 101
 

Default Re: make a module??

Old topic but seems relevant to my question.

I'm in need of module that has same functionality as Manufacturers but different name, I tried cloning it (like successfully can be done with WordPress plugins or similar) but when I upload it to server does not even show up in "Modules" list in xcart admin.

Is it because "Manufacturers" is part of the xcart (built in) modules and has depending code elsewhere in xcart files?

Can cloning be done or need to create completely new plugin?

Any ideas, suggestions greatly appreciated.
__________________
x-cart 4.4.2 Gold
Reply With Quote
  #4  
Old 10-24-2011, 10:24 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: make a module??

Sure, you can clone a module, but its not that simple in X-Cart unfortunately. You should use FTP access to make a copy. Also, you should update the DB and add module record there as well.

Since modules in X-Cart are not completely separated from the core, you will need to add support to the required core functions.

Code:
INSERT INTO xcart_modules VALUES (,'MyModule','My module description','Y');

'MyModule' - should be the same as the folder name containing the module files (module is located here -> <xcart-dir>/modules/MyModule).
__________________
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:
Powertrain (10-25-2011)
  #5  
Old 10-25-2011, 05:23 AM
 
Powertrain Powertrain is offline
 

Senior Member
  
Join Date: Mar 2011
Posts: 101
 

Default Re: make a module??

So the code you posted is SQL query that needs to be inserted into the DB?

Also please correct me if I'm wrong, since the functionality of the module I want to clone is exactly same as Manufacturers and the products will be associated with it (like selecting manufacturer) I will need to add row to product table too? and anything else Manufacturers module does at activation?

Thank you very much.
__________________
x-cart 4.4.2 Gold
Reply With Quote
  #6  
Old 10-26-2011, 12:16 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: make a module??

If I understand you correctly you need a separate module.

Thus separate records in DB are required.

To make the new module work the same way you should "grep" the code (grep -r "Manufacturers" *) and add similar code but for your module.

In most cases the simplest way will be customizing the existing module.
__________________
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:
Powertrain (10-26-2011)
  #7  
Old 10-26-2011, 09:11 AM
 
Powertrain Powertrain is offline
 

Senior Member
  
Join Date: Mar 2011
Posts: 101
 

Default Re: make a module??

Thanks Alex

I did replaced all instances of Manufacturers to new name but still does not show up in Modules list. Maybe I missed something.

Also I think I need to add code in admin files (product_modify, etc.) to display fields if I'm correct.

Has anyone had success in cloning existing module?

Thanks.
__________________
x-cart 4.4.2 Gold
Reply With Quote
  #8  
Old 11-02-2011, 05:52 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: make a module??

You should add corresponding record to the "xcart_modules" table to have the module displayed in the modules list.
__________________
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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 08:59 PM.

   

 
X-Cart forums © 2001-2020