insanebear Developer Från Poland Medlem sedan okt. 2014 insanebear 18 dec. 2014 10:09 In Poland we have shipping method called ""Paczkomaty"" (in larger cities stand box in which you can take the package). I need to pass value from <select class=""paczkomaty""> (http://shirtz.pl/checkout) to order as shipping_tracking_id (or something else). For now i pass it via javascript to <textarea name=""comments""></textarea> but it is not a good solution i think.PS. It would be great if you gave some christmas discounts on Litecart Add-ons :P
litecart Main Crew Från Sweden Medlem sedan feb. 2013 litecart 18 dec. 2014 12:00 Inside the shipping module in the after_process() method you can write to any order parameter e.g. $GLOBALS['order']->data['shipping_tracking_id'] = 'foobar';If you have user input in the shipping option you can fetch these inside the select() method refering to the $_POST param. Keep in mind the order object is created after selecting shipping so the param would need to be stored elsewhere e.g. session::$data['myparam'].
insanebear Developer Från Poland Medlem sedan okt. 2014 insanebear 19 dec. 2014 13:27 $GLOBALS['order']->data['shipping_tracking_id'] = '111';orglobal $order;$order->data['shipping_tracking_id'] = '111';Doesn't work for me in after_process() method. It work in order_process.inc.php so i will put this <select /> in box_checkout_summary.inc.php and it will go with rest of $_POST
litecart Main Crew Från Sweden Medlem sedan feb. 2013 litecart 19 dec. 2014 13:58 Either is fine.Oh, I forgot to mention, you must save the changes.$GLOBALS['order']->data['shipping_tracking_id'] = '111';$GLOBALS['order']->save();
developer_cz Developer Från Czech Republic Medlem sedan apr. 2018 developer_cz 16 okt. 2020 09:59 Is this procedure valid for version 2.2.4 or how best to do it for version 2.2.4?
tim Founder Från Sweden Medlem sedan maj 2013 tim 16 okt. 2020 15:10 In later versions of LiteCart the $order object is already populated in after_process().https://wiki.litecart.net/how_to_create_a_shipping_module