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

Changing Shipping Module Name Dynamically

 
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 08-11-2015, 08:27 PM
  aneel13's Avatar 
aneel13 aneel13 is offline
 

Senior Member
  
Join Date: Jul 2015
Location: Dubai
Posts: 148
 

Default 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.
__________________
Regards,
Aneel Sarwar
X-Cart version: 5.2.10
Windows: 7
Modules: Free version modules
  #2  
Old 08-20-2015, 01:25 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default 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.
__________________
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
  #3  
Old 08-20-2015, 02:01 AM
  aneel13's Avatar 
aneel13 aneel13 is offline
 

Senior Member
  
Join Date: Jul 2015
Location: Dubai
Posts: 148
 

Default 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.
__________________
Regards,
Aneel Sarwar
X-Cart version: 5.2.10
Windows: 7
Modules: Free version modules
  #4  
Old 09-07-2015, 03:03 AM
  aneel13's Avatar 
aneel13 aneel13 is offline
 

Senior Member
  
Join Date: Jul 2015
Location: Dubai
Posts: 148
 

Default Re: Changing Shipping Module Name Dynamically

Issue resolved. Just changed the frontend name, kept the backend name same.
__________________
Regards,
Aneel Sarwar
X-Cart version: 5.2.10
Windows: 7
Modules: Free version modules
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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 11:43 AM.

   

 
X-Cart forums © 2001-2020