X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   make a module?? (https://forum.x-cart.com/showthread.php?t=60222)

techker 07-19-2011 02:30 AM

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??

qualiteam 07-19-2011 04:35 AM

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

Powertrain 10-24-2011 08:29 PM

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.

qualiteam 10-24-2011 10:24 PM

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).

Powertrain 10-25-2011 05:23 AM

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.

qualiteam 10-26-2011 12:16 AM

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.

Powertrain 10-26-2011 09:11 AM

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.

qualiteam 11-02-2011 05:52 AM

Re: make a module??
 
You should add corresponding record to the "xcart_modules" table to have the module displayed in the modules list.


All times are GMT -8. The time now is 03:13 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.