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)
-   -   Changing Shipping Module Name Dynamically (https://forum.x-cart.com/showthread.php?t=72572)

aneel13 08-11-2015 08:27 PM

Changing Shipping Module Name Dynamically
 
I have some particular events based on which I am refreshing the shipping module widget. Now I want to change the shipping module name for different cases. That name changing is not just the frontend name change but it should be reflected in other pages aswell. (Checkout Page, Success Page, Admin Page) etc.

Please let me know where I am suppose to do this change. So far I have done the change in the following file:

File: \xcart\classes\XLite\Module\Swipezoom\Internationa lShipping\View\ShippingList.php

/**
* Get rate method name
*
* @param \XLite\Model\Shipping\Rate $rate Shipping rate
*
* @return string
*/
protected function getMethodName(\XLite\Model\Shipping\Rate $rate)
{
if($rate->getMethod()->getName() == "Swipezoom InternationalShipping"
&& !empty(\XLite\Core\Session::getInstance()->swipezoomTitle))
return \XLite\Core\Session::getInstance()->swipezoomTitle;
else
return $rate->getMethod()->getName();
}

But this change only reflects on the frontend. I want to use the same shipping name in session everywhere for this particular order.

qualiteam 08-20-2015 01:25 AM

Re: Changing Shipping Module Name Dynamically
 
I'm not sure if I understand what you are trying to do, but it sounds as a weird hack.

Why don't you add a database record for every shipping method like other shipping modules do? Check the FedEx integration module (the install.yaml file), for example.

aneel13 08-20-2015 02:01 AM

Re: Changing Shipping Module Name Dynamically
 
In backend the shipping module needs to be same, its just that a different shipping module title on the frontend.

aneel13 09-07-2015 03:03 AM

Re: Changing Shipping Module Name Dynamically
 
Issue resolved. Just changed the frontend name, kept the backend name same.


All times are GMT -8. The time now is 04:46 AM.

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