danrimer Posted October 22, 2012 Share Posted October 22, 2012 Hi I am writing a customised shipping module for PrestaShop 1.5. The module automatically switches between 4 different options and provides discounts to the consumer at certain price points. However, the module is simply called "Economy shipping" and the user is not given any more information than the name or the price. I don't want to use the static text (shipping/carriers/edit) for more than just basic info. I would like to add another line (or lines) to explain the carrier selected and the discount applied. Can this be done? Or am I looking in the wrong place? Thanks Dan Link to comment Share on other sites More sharing options...
math_php Posted October 23, 2012 Share Posted October 23, 2012 (edited) Hi Dan, Will $carrier->delay = 'delivered by rocket for good price'; do the job ? With a HOOK_BEFORECARRIER and modification of order-carrier.tpl, you could display your informations. Regards Edited October 23, 2012 by math_php (see edit history) Link to comment Share on other sites More sharing options...
danrimer Posted October 23, 2012 Author Share Posted October 23, 2012 Hi Dan, Will $carrier->delay = 'delivered by rocket for good price'; do the job ? With a HOOK_BEFORECARRIER and modification of order-carrier.tpl, you could display your informations. Regards Hi math_php Since i am a noob, can you explain to me how to do this please? Many thanks Dan Link to comment Share on other sites More sharing options...
math_php Posted October 26, 2012 Share Posted October 26, 2012 Hi Dan, In fact do you already have calculated shipping price in your module ? If yes an override of getDeliveryOptionList from class cart could be a solution. You will get an array of all carriers, with shipping prices, displayed name, id and so on. You could then modify your carrier information depending on the display you want. What sort of behaviour you want something like that : 0 - 400 pounds 'economic slow' 400-600 pounds 'economic fast' more than 600 pound 'deluxe shipping' Best regards Link to comment Share on other sites More sharing options...
danrimer Posted October 26, 2012 Author Share Posted October 26, 2012 (edited) Hi math_php in my module i have: public function getOrderShippingCost($params, $shipping_cost) { if ($this->id_carrier <> (int)(Configuration::get('SHIPECO_CARRIER_ID'))) return false; global $cart; $carriers=$cart->getDeliveryOptionList(); print_r ($carriers); . . . This code just gives me an out of memory error - I can't seem to get any info from getDeliveryOptionList(). I'm afraid I am really in the dark here! Can you give me a piece of code that I can use to change just one line of the carrier description? I should be able to work other things out from there :-) Thanks for your help so far! Dan Edited October 26, 2012 by danrimer (see edit history) Link to comment Share on other sites More sharing options...
Radu Posted March 11, 2013 Share Posted March 11, 2013 hello Dan, I needed something similar and answered in the following post: http://www.prestashop.com/forums/topic/219629-changing-carrier-delay-from-within-shipping-module/page__gopid__1138141#entry1138141 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now