Order Email Modifications

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277447

-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : none

HikaShop Business, Is there a way to view changes to the order email templates without actually going through the order process and having the system send me an email? Also, I have been trying in vain to figure out how to view the template editor for the Order Emails. I found the documentation on how to modify them and it looks like there is an editor? I am not sure if this is an editor or just a different screenshot of the screen where all the email templates are listed for HikaShop Business. ( www.hikashop.com/support/documentation/i...entation/25-hikashop ),I noticed that under System/Emails, there are 3 version of a template, HTML / Text / Preload Version. I assume what I need to do is take the template, modify it accordingly, then upload it as a new template. What I would like to do is have an template that uses my Company Logo and has the appropriate wording. So if I upload a new template I believe I will need one for each of the different emails my customers may receive. The emails that I am focusing on are the emails send after the order is paid which I believe is the "Order Confirmation", The email sent once an order is Shipped (need to add a tracking number to the order and I believe this is under the "Order Modification" and one if the order is Cancelled which is the "Order Cancellation" emails? Would this be correct?

I apologize for some of these questions but I am still very green to HikaShop and all my Google Searches keep bringing me to these forums rather then the documentation. I want to be sure that I modify the correct code and upload properly without the template being over written.

Also, Could someone point me to the proper forum for the USPS Plugin? I don't want to ask my question in the wrong place. Thank you!


(HikaShop Business 3.2.0 [1709061916])
Last edit: 7 years 2 months ago by Dardwizzle.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 2 months ago #277465

Hi,

1. I would recommend to do your changes in the order notification email first. You can easily check the changes for that email by clicking the "email" button when you edit an order in the backend. You don't even have to send the email thanks to the preview there.
Then, you can copy/paste the changes to the other order notification emails as they are roughly the same.

2. I would recommend not modifying the HTML/text/preload versions if all you want is change the logo and the colors of the emails. Instead, open one email and edit the template selected in that email. Once the template is changed, the changes will apply to all the emails using that template. So you won't have to do the change in each email.

3. The emails sent when the order status changes to confirmed, or to shipped or to cancelled are all generated out of the "order status notification" email. So if you edit that one, it will change for all of them.

4. When you edit the template, you can change its name. In that case, when you save, the change will be stored in a separate template file, so you won't loose the default template of HikaShop emails. You'll just have to select that new template in the other emails if you need to. So no need to edit the files directly via FTP.

5. When you create a new topic on this forum, you can select the category where the message should be posted in. So you can choose the "shipping methods" category: www.hikashop.com/forum/shipping-methods.html

The following user(s) said Thank You: Dardwizzle

Please Log in or Create an account to join the conversation.

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277493

Thanks very much that was very helpful. However, if I wanted to change the actual text of the email, I found a post that stated that in order to change that the translation or the expanded text of the placeholders (or macro's, not sure what they are called in HikaShop) such as the "HI_CUSTOMER" this is handled here:

"Texts are process in the "XXXX.preload.php" file, you will find the code which make the translation for the HI_CUSTOMER and you will see that the $customer->name or the $order->billing_address->address_firstname are used to fill the customer name in that place."

An example of what I am looking to change, I would like the email to read

"Hi John,
Thank you for your order at Eutopian Trader Online Store ." or similar instead of

""Hi John,
Thank you for your order at www.eutopiantrader.com/ "

But I am unable to find where on the server where this gets exampled from. I don't think it's in the HI_Customer, and its not in the template itself (and if it were one of those i would need access to the XXXX.preload.php which I don't believe I have access to.

I appreciate all your help. You guys have been fantastic with your support, especially with us new guys. I appreciate the extreme patience, it really means the difference between a good product and a great product when you have people such as yourselves that take the time to help the new guys learn.

Cheers!


(HikaShop Business 3.2.0 [1709061916])

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 2 months ago #277497

Hi,

That's easy to do.
You can do that with a translation override, like any other text you want to change in the interface of HikaShop:
www.hikashop.com/download/languages.html#modify

Please Log in or Create an account to join the conversation.

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277586

Hi Nicolas,

Would your advise assume that I know the name of the variable that i need to translate in the override?

Example: if I want to change the email to display "Hi John" instead of "Hi John Smith".
HI_Customer is defined in the text version here in the preload version:
'HI_CUSTOMER' => JText::sprintf('HI_CUSTOMER', $customer_name),

I looked further and only see the $customer used one other place which is here in the preload,
$customer_name = @$customer->name;
if(empty($customer_name))
$customer_name = @$data->cart->billing_address->address_firstname.' '.@$data->cart->billing_address->address_lastname;

However,if I set this to
$customer_name = @$data->cart->billing_address->address_firstname;
if(empty($customer_name))
$customer_name = @$data->cart->billing_address->address_firstname.' '.@$data->cart->billing_address->address_lastname;

And I tried this:
'HI_CUSTOMER' => JText::sprintf('HI_CUSTOMER', $address_firstname),
and this
'HI_CUSTOMER' => JText::sprintf('HI_CUSTOMER', $data->cart->billing_address->address_firstname),

Well that doesn't do anything to get just the First Name shown in the email. So forgive my complete niavity but I can't figure this out to save my life...

I also need to change the line in the email that says "Thank you for your order at www.eutopiantrader.com/ ."

Which is URL appears to come from HIKASHOP_LIVE which is not defined in the preload. I have no idea how i would make that show a linked
text of Eutopian Trader with www.eutopiantrader.com .

So what I am confused about is when do you create an override, and when do you modify the preload? And if you modify the preload, do you have to modify the HTML and TEXT versions or do the HTML and TXT used use preload to define the variables?

Please bare with me but I really need to understand this..

Thanks


(HikaShop Business 3.2.0 [1709061916])
Last edit: 7 years 2 months ago by Dardwizzle.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 2 months ago #277588

Hi,

In your previous message, you said:

I would like the email to read

"Hi John,
Thank you for your order at Eutopian Trader Online Store ." or similar instead of

""Hi John,
Thank you for your order at www.eutopiantrader.com/ "


So basically, you want to change the name of the website to have only the URL in the sentence:
Thank you for your order at Eutopian Trader Online Store .

If you follow the documentation link I gave and search for the beginning of the sentence "Thank you for your order" in the translation file of your HikaShop, you'll find that entry:
THANK_YOU_FOR_YOUR_ORDER_BEGIN="Thank you for your order at %s."
As you can see, "Eutopian Trader Online Store" is a variable as %s is replaced by that text automatically by the system.
So, as you said, you could potentially mess with the preload of the email to change the content of the variable.
But a simpler approach is just to change the translation with a translation override, like I recommend.
For example, you could add the translation override:
THANK_YOU_FOR_YOUR_ORDER_BEGIN="Thank you for your order at www.eutopiantrader.com/ "

As a rule of thumb, if you don't want to add variables or change the content of the variables, but just modify/remove text from the translation string, a translation override is better. If you need to change the variables, like changing the name to not user the user account name but instead the firstname of the billing address of the customer, then it would require modifying the PHP code.

Please Log in or Create an account to join the conversation.

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277620

Well what I was hoping for was to make the %s a hyper link and not straight text which if I understand it is all the override would do. if I enter what you put

THANK_YOU_FOR_YOUR_ORDER_BEGIN="Thank you for your order at www.eutopiantrader.com/ "

Then I would get would I already have which is above. I would like it to say Eutopian Trader Online Store but make "Eutopian Trader Online Store" a hyper link to the URL www.eutopiantrader.com for the HTML version of the email.

The text version could stay as is or be changed to just say the words "Eutopian Trader Online Store"

So either I have misunderstood what you are trying to get across, or I wasn't clear with what I was wanting the variable of "THANK_YOU_FOR_YOUR_ORDER_BEGIN" to be.

Does this make sense?


(HikaShop Business 3.2.0 [1709061916])
Last edit: 7 years 2 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 2 months ago #277639

Hi,

Well, I'm not sure what you mean.
But if you want the text to be clickable that's not a problem in a translation override. You just need to add the necessary HTML.
For example:

THANK_YOU_FOR_YOUR_ORDER_BEGIN="Thank you for your order at <a href='http://www.eutopiantrader.com/'>www.eutopiantrader.com/</a> "

Please Log in or Create an account to join the conversation.

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277642

Yes Sir, That is exactly what I did and it's working great! I have been running into some area's where overrides are not working and I haven't found the right file to modify, but I will not bother you guys with those until I have exhausted all my thoughts first.

I am working on adding the Tracking Number, to the order status :) Little did I know what I got myself into there. lol

Cheers! :)


(HikaShop Business 3.2.0 [1709061916])

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 2 months ago #277647

Hi,

If you create a custom field of the table "order" via the menu Display>Custom fields for storing your tracking number in the order, you have display settings in the custom field to have it be displayed automatically in the email.
So normally, you don't need to add code. But you can also directly add it in the HTML version like that for example:

Your products have been shipped with the tracking code {VAR:order.XXX}.
where XXX is the column name of the custom field. So either way, it's quite easy to add.

Please Log in or Create an account to join the conversation.

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277721

Yes, I actually found out that the USPS Tracking Number does in fact display wonderfully in the Order Notification Status, however, my current problem is that while that was very well thought out and looks great, there are 2 very important paces missing, and sadly, I don't think I have the coding expertise to add them (though I am desperately trying with little luck.

The two areas that I am referring to are having the Tracking Number (and clickable link to the USPS Webtools to look up the Tracking Status in the Front End "Order / Show.php" so that is displays on the Order Details Pages for those orders that have USPS Tracking, and creating a Clickable Link to the USPS Webtools within the Order Status Notification Emails.

I have been researching and I have found some snippits that you and Mohamed assisted other with, but doing it that way seems like reinventing the wheel because there is obviously core code that already grabs the usps_tracking data from the order table (usps_tracking is the custom field I created in the order table. The code I found goes like this.

Your Example Code to the person you were helping.

Tracking Number: <a href="http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<?php echo $this->element->usps__tracking; ?>"><?php echo $this->element->usps_tracking; ?></a>

However, that code will not work in the Additional Info section "as is" II tried and I am missing parts even though I placed in inside a <?php ?> tag. But even is that were to work, it seems like I would just be recreating something that the system does (I believe in either the order_shipping_id or the order_product_shipping_id variables. Unfortunately I know that the shipping_id returns multiple variables, and I don't know which of them returns the usps_tracking (tracking number) since they are not in the language files as constants, so it's likely I would spend a long time trying to figure it out and the documentation doesn't go deep enough for me to figure out a way to use the code that was already part of the system.

If I were to use the method you suggested by writing the php code, well, that is a bit more involved then my skill set sadly, so I might just be out of luck there unless someone feel reeeeeeeeeeally generous. The problem is that my site can not go live until i have an easy solution for my customers to get, see, and tracking there packages with the USPS tracking number and having it on the Order Details Front End is my priority number one (along with adding the product thumbnails to the same same front end.

That does peek my curiosity though. Why add the things like product thumbnails and package tracking information to the Order Notification Emails but not have them in the Online Order Details Front End? I would have thought that would have been the first place to put them. Mind you, I am not complaining because the work gone into getting things where they are is a feat in and of itself and you guys just amaze me with your talent and willingness to share knowledge.

At this point, I am at a bit of a stand still until I can get these two issues resolved, and I don't want to take up your whole time with my issues. This is where I was mentioning before that having more live examples in the documentation might help people like me, as the support docs are written at somewhat of a high level that is a few steps above my skill set.

If you have an easy solutions, or reference material for me to learn from, I will dive right in as I have been doing and learn as much as I can. Thus far, I have (with your guys help) completed a very long task list of items that I originally had for escalation to my developer, but since he wants me to learn this, I have been learning as much as possible. Anyway, Cheers to you and I will go back under the hood and see what I can figure out here.

Thanks!


(HikaShop Business 3.2.0 [1709061916])

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
7 years 2 months ago #277776

Hello,

If I were to use the method you suggested by writing the php code, well, that is a bit more involved then my skill set sadly, so I might just be out of luck there unless someone feel reeeeeeeeeeally generous. The problem is that my site can not go live until i have an easy solution for my customers to get, see, and tracking there packages with the USPS tracking number and having it on the Order Details Front End is my priority number one (along with adding the product thumbnails to the same same front end.


Setting the "Front-end order details page" option to YES through the "DISPLAY" tab of your order custom field configuration page, should actually do the job.

Thank you for your feedback !

Please Log in or Create an account to join the conversation.

  • Posts: 140
  • Thank you received: 18
7 years 2 months ago #277806

Disregard my last msg if anyone saw it, I deleted it because I figured it out and it was a mistake on my end, not worth keeping here. Thanks


(HikaShop Business 3.2.0 [1709061916])
Last edit: 7 years 2 months ago by Dardwizzle.

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum