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)
-   -   shipping markup (https://forum.x-cart.com/showthread.php?t=70254)

Phil Richman 10-15-2014 09:54 AM

shipping markup
 
I want to add a 10% markup to all shipping rates. I've been trying to find the array that contains the complete list of available shipping options so I can do a foreach and add 10% to each element value returned before it is displayed to the customer. Does anyone know what array and in what file this is located? I'm having a hard time finding this.

qualiteam 10-15-2014 11:50 PM

Re: shipping markup
 
\XLite\Logic\Order\Modifier\Shipping - this is the class that adds the shipping cost to the order total. I guess you should look into decorating it so that it will add the 10% markup.

Phil Richman 10-16-2014 05:32 AM

Re: shipping markup
 
Quote:

Originally Posted by qualiteam
\XLite\Logic\Order\Modifier\Shipping - this is the class that adds the shipping cost to the order total. I guess you should look into decorating it so that it will add the 10% markup.

I'm not having much luck with this. Can you give me a little further detail.

tony_sologubov 10-17-2014 06:06 AM

Re: shipping markup
 
Hi Phil!

You may want to decorate the getRates() method of the XLite\Model\Shipping class. As you can see, it gathers shipping rates from processors (User-defined, USPS, UPS, etc) and then process it.

Depending on your may want to decorate applyMarkups() method of the same class.

Please, let me know if it all makes sense to you.

Tony.


All times are GMT -8. The time now is 05:59 AM.

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