X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Simple Sample Shipping Module (https://forum.x-cart.com/showthread.php?t=70866)

Sunny Koh 12-29-2014 07:01 AM

Simple Sample Shipping Module
 
Hello,

Does anyone know where I can find the sample code for a very simple shipping module? I have written some php code for my WeightStep calculation for shipping but am unsure where should I fitting into the system. Thanks

gkarlsson 12-29-2014 10:13 AM

Re: Simple Sample Shipping Module
 
have you looked at the developer documentation?

Sunny Koh 12-29-2014 10:15 AM

Re: Simple Sample Shipping Module
 
Yes I have, doesn't tell me what are the methods I have to implement or what is the min needed.

gkarlsson 12-29-2014 10:17 AM

Re: Simple Sample Shipping Module
 
Are you looking to remove the other shipping options and have only yours, or do you want to modify values for existing shipping methods?

Sunny Koh 12-29-2014 12:37 PM

Re: Simple Sample Shipping Module
 
I am actually trying to implement my own shipping calculation method as the system provided ones do not suit the local post office tables. I already manage to write the code in php on implementing the calculation but am trying to hunt down what is needed to implement it as a module. The code I have posted http://forum.x-cart.com/showthread.php?t=70853 but this seems to be the place to ask some of these development questions.

gkarlsson 12-29-2014 12:45 PM

Re: Simple Sample Shipping Module
 
Your best bet would be to look at one of the pre-defined shipping modules like FedEx.
You will find this in /classes/XLite/Module/CDev/FedEx.

You will be able to see that the majority of functions relate to getting data and processing it - you could strip these out and remain with the core functions necessary to perform your tasks.

The core functions can be found in the subfolder Model\Shipping\Processor\fedex.php. This should give you a good point to start producing what you are looking for.

When in doubt, or when there is insufficient information or documentation, always have a look at how other modules do stuff.


All times are GMT -8. The time now is 02:16 AM.

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