You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi
Here in the UK I don't use UPS/USPS/FedEx for my courier services but, shall we say, cheaper options like myHermes, etc. These companies provide tracking information that I would like to include in the email that my customers receive when I update the system via the BOM xmod.
Would it simply be a case of adding an extra column to the relevant table and getting the email to pick this information up or something not quite as easy?
Thanks
Terry
Last edited by tguswell (08-20-2015 10:14:27)
Offline
it would be adding a column and printing that data in the order complete email.
However, I use UK Mail but I would assume myhermes would have a similar system.
UK Mail's website allows consignees to search using our reference number(ccp generated order number) and postcode.
Therefore we just provide a link in our order complete email along these lines:
http://www.ukmail.com/manage-my-deliver … de=MK427PN
This completely eliminates the need to do the modification you are considering as you only need to order number and postcode which are already available in the order complete email. You also don't need to waste time entering the consignment number into the BOM.
Obviously this relies on you entering the ccp order number into the myhermes consigment.
Offline
The bom already has a tracking code field for UPS:
https://kryptronic.com/demoeu/admin.php
It may only show if you have UPS enabled, but I expect it would be straightforward to edit the code and use the same field/column for myhermes.
Offline
Nick
Is Zanart's comments feasible? Could I alter one of the fields already in the BOM? I would imagine that the USPS would be the obvious one as we don't have the US Postal Service in the UK :-)
All that I want to do is enter my couriers tracking number and have the link (in the form of https://www.myhermes.co.uk/tracking-res … 1111111111) show in the email to customer.
Thanks
Terry
Last edited by tguswell (08-21-2015 08:04:32)
Offline
Add a column named 'trackhermes' to the ecom_orders table using Raw DB Admin's maintain function. It should be a Varchar (text) field with a length of about 50, and make sure it's not required. Name it what you like, and place it in the section you like. Make sure the column starts with the string 'track'. Then edit the file {private}/apps/ecom/ECOM/includes/ordersummaryxhtml.php. In there you will see the other tracking numbers being addressed. Your tracking number will be available as $order['order']['trackhermes'].
Offline
Nick
Thanks for that. Now I'm having a senior moment and being a bit stupid.
How do I change the coding to make this tracking code number a hyperlink and take the person to the Hermes website within the Order Complete email that is sent?
Terry
Last edited by tguswell (08-24-2015 08:44:40)
Offline
I think you need to edit the email that is sent: {private}/apps/ecom/ECOM/includes/xmodbommailxhtml.php
Last edited by nigel (08-24-2015 09:13:37)
Offline
Nigel - thank you for the pointer.
This is what I've amended:
foreach ($tracking_numbers as $tcol => $tval) {
if ($tcol == 'trackupstools') {$name = 'UPS Tracking Number(s)'; $trackable_online++;}
elseif ($tcol == 'trackusps') {$name = 'USPS Tracking Number(s)'; $trackable_online++;}
elseif ($tcol == 'trackfedex') {$name = 'FedEx Tracking Number(s)'; $trackable_online++;}
else {$name = strtoupper(preg_replace('/^track/','',$tcol)) . ' Tracking Number(s)';}
if ($tcol == 'trackhermes') {$name = 'myHermes Tracking Number(s)'; print '<p class="strong">' . $name . '</p><p><a href="https://www.myhermes.co.uk/tracking-results.html?trackingNumber=' . $tval . '&tracking-widget-search-submit=Go">' . $tval . '</a></p>' . $eol . $eol;}
else {print '<p class="strong">' . $name . '</p><p>' . $tval . '</p>' . $eol . $eol;}
} // End of foreach statement.Which I'm sure is not the most elegant of code, but it appears to be working.
Terry
Last edited by tguswell (09-24-2015 11:07:29)
Offline
That code above was missing a closing </a>. I updated it to add clickable links for USPS, UPS and FedEx:
foreach ($tracking_numbers as $tcol => $tval) {
if ($tcol == 'trackupstools') {$name = 'UPS Tracking Number(s)'; $trackable_online++;}
elseif ($tcol == 'trackusps') {$name = 'USPS Tracking Number(s)'; $trackable_online++;}
elseif ($tcol == 'trackfedex') {$name = 'FedEx Tracking Number(s)'; $trackable_online++;}
else {$name = strtoupper(preg_replace('/^track/','',$tcol)) . ' Tracking Number(s)';}
if ($tcol == 'trackupstools') {$name = 'UPS Tracking Number(s)'; print '<p class="strong">' . $name . '</p><p><a href="http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=' . $tval . '&loc=en_us">' . $tval . '</a></p>' . $eol . $eol;}
elseif ($tcol == 'trackusps') {$name = 'USPS Tracking Number(s)'; print '<p class="strong">' . $name . '</p><p><a href="https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=' . $tval . '">' . $tval . '</a></p>' . $eol . $eol;}
elseif ($tcol == 'trackfedex') {$name = 'Fed Ex Tracking Number(s)'; print '<p class="strong">' . $name . '</p><p><a href="https://www.fedex.com/apps/fedextrack/?tracknumbers=' . $tval . '&language=en&cntry_code=us">' . $tval . '</a></p>' . $eol . $eol;}
else {print '<p class="strong">' . $name . '</p><p>' . $tval . '</p>' . $eol . $eol;}
} // End of foreach statement.Offline