label LiteCart Fan از کشور Australia عضو از دسامبر 2018 label 7 ژوئن 2020 16:28 Hi, Thanks for your help previously getting the phone number displayed: [quote]'%shipping_phone' => $this->data['customer']['phone'],[/quote] I am trying to add the shipping method to the order confirmation email but can't get it to work. Can you please help to let me know how to define the aliases. I have tried: [quote]'%shipping_option_name_display' => $this->data['shipping_option'], & '%shipping_option_name_display' => $this->data['shipping_option'][preg_replace('#^(shippingoption)#', '', $field)],[/quote] But neither of these works.
tim Founder از کشور Sweden عضو از مه 2013 tim 7 ژوئن 2020 16:37 Try $this->data['shipping_option']['name']
label LiteCart Fan از کشور Australia عضو از دسامبر 2018 label 8 ژوئن 2020 01:42 Thanks for the reply. I have two shipping methods (Standard Post & Express Post). However, the above code will just display "Australia" for both of them.
tim Founder از کشور Sweden عضو از مه 2013 tim 9 ژوئن 2020 03:03 $this->data['shipping_option']['name'] returns the "Module Name (Option Title)" returned by options(). https://wiki.litecart.net/how_to_create_a_shipping_module
label LiteCart Fan از کشور Australia عضو از دسامبر 2018 label 23 ژوئن 2020 12:05 Thanks for the reply. I changed the option(s) around a bit in the shipping modules before when I removed the weight from displaying in the checkout. So now I realise that I am actually hoping for it to display the shipping option description (or the module title translation). I tried defining the alias: '%shipping_option_name_display' => $this->data['shipping_option']['description'], But this displays an empty result?
tim Founder از کشور Sweden عضو از مه 2013 tim 23 ژوئن 2020 21:20 Shipping description is not copied to the order object. Only id, name (and title). What is it that you are trying to do?
label LiteCart Fan از کشور Australia عضو از دسامبر 2018 label 25 ژوئن 2020 02:24 I was wanting to get as much of the order information into the email as possible (including name, shipping address, phone number, shipping method), so that (1) There's a written confirmation of it that is permanently stored in email history (in case of server going down etc) (2) Emails can be searched to find an order based on name, postcode, suburb, phone number etc. (3) Can set up an email filter for orders placed with Express shipping to be forwarded to an email address or SMS gateway From your previous help, I had setup the name, address & phone number to be included in the email :) With the shipping method, I ended up rearranging/renaming the options array values (name, description) so that in the checkout there wasn't a duplication of information being shown for the shipping method. Now an appropriate shipping method options array name shows up in both the checkout and in the order confirmation email. Thanks again for your help.
tim Founder از کشور Sweden عضو از مه 2013 tim 2 ژوئیه 2020 22:41 You can have a shipping module add comments to the order in after_process. Then edit the order confrmation mail and make sure that comments are inserted to the email. https://github.com/litecart/litecart/blob/aff5018d9a68df4c2edbd05a2aeb9ff432bf12f6/public_html/includes/entities/ent_order.inc.php#L679-L749