Tracking-URL wenn versendet

  • Posts: 66
  • Thank you received: 1
2 years 4 months ago #337373

-- HikaShop version -- : HikaShop Business 4.4.4

Hallo

Ich habe im englischen Forum bereits einige Posts gefunden zum Thema Trackingcode per Mail aber so richtig hat das bei mir noch nicht funktioniert und hoffe dass ich hier auf Deutsch besser folgen kann.

Ich möchte, dass wenn ich den Bestellstatus auf "Versendet" stelle eine Mail raus geht mit einem Trackingcode-LINK

Der Link muss so aussehen www.post.ch/swisspost-tracking?formattedParcelCodes=xxxxx

xxxxx= ist der Code den ich vorher bei der Bestellung eingetragen habe.

im PDF ist schon mal was ich gemacht habe. Soweit funktioniert es ja auch und der Code wird angezeigt, aber selbst wenn ich den Name beim Benutzerdefinierten Feld leer lasse hat es dann vor dem Code noch ein Doppelpunkt und einen Lehrschlag davor.

Die Frage ist eigentlich nur wie ich es schaffe den Link mit dem eingetragenen Code zu verbinden?

Attachments:
Last edit: 2 years 4 months ago by Webmediacontent.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
2 years 4 months ago #337375

Hi,

You should turn off the display setting of the custom field for the email.
Instead, edit the "order status notification" via the menu System>Emails.
There, in the "HTML" section, you can add this:

Tracking code: <a href="https://www.post.ch/swisspost-tracking?formattedParcelCodes={VAR:order.trackingcode}">{VAR:order.trackingcode}</a>
The "list of available tags" button there is a great help to understand which tags you can add to the emails to customize them with extra data coming from the order.

Note however, that this will display regardless of whether you have something in the custom field or not. A simple solution to this, if that's a problem, based on how your shop is setup, would be to use the "per status override" in order to only add that text in the HTML for the order statuses where you know that the tracking code has already been filled, for all the orders.
A cleaner but more complex solution would be to add PHP code in the HTML, like this:
<?php if(!empty($data->trackingcode)) {
echo 'Tracking code: <a href="https://www.post.ch/swisspost-tracking?formattedParcelCodes='.$data->trackingcode.'">'.$data->trackingcode.'</a>';
}?>

Last edit: 2 years 4 months ago by nicolas.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum