Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How to add a Carrier in version 4? Rate Topic   - - - - -

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 517 posts

Posted 16 July 2014 - 11:00 AM #21

At first, make a backup of the following file:

design/themes/VIVASHOP_THEME/mail/templates/shipments/shipment_products.tpl

and replace the original file with this one:

design/themes/basic/mail/templates/shipments/shipment_products.tpl

Hope that helps.


Thanks eComLab for reverting back on this post. What I observe is that I don't have design/themes/basic path available in my root directory. Seems like it got replaced by the VIVAShop theme installation. But when I downloaded the fresh CS-cart, there also the file under design/themes/basic/mail/templates/shipments/shipment_products.tpl is same to as of VIVAShop.

Seems like problem is something else. Kindly help on this.

NOTE: Do you think if I create basic/mail/templates/shipments/shipment_products.tpl path under design/themes/ will make this work?
Warm Regards,
Admin | MVE: 4.2.4

 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2,163 posts

Posted 16 July 2014 - 11:15 AM #22

Thanks Simtech,
These changes worked for me. Thanking you again for nailing this down.


We are glad to help you.
Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Testing by QA and personal manager for free.

 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2,163 posts

Posted 16 July 2014 - 12:34 PM #23

As regards the other issue, as far as I see from the .doc file provided earlier, you used your custom carrier in the first case and the standard one in the second one. So it seems to me that the URL was not set for the new carrier. Please check if the modifications Swimcommunications mentioned are applied properly:

3. Open the design/themes/[YOUR_ACTIVE_THEME]/templates/common/carriers.tpl file of your CS-Cart installation and add this part of code:

{elseif $carrier == "NEW_CARRIER"}
	{$url = "http://YOUR_TRACKING_URL"}
	{$carrier_name = __("NEW_CARRIER")}

below this one:
{elseif $carrier == "temando"}
	{$url = "https://temando.com/education-centre/support/track-your-item?token=`$tracking_number`"}
	{$carrier_name = __("temando")}

where NEW_CARRIER should be replaced with your carrier name and YOUR_TRACKING_URL with the URL provided by your shipping carrier to track orders. Save the file.

Add the same part of code to the design/themes/[YOUR_ACTIVE_THEME]/mail/templates/common/carriers.tpl file of your CS-Cart installation. Save the file and check the results.

Please note that in case you create multiple custom carriers, you should add such parts of code for each of them. I hope this will help.
Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Testing by QA and personal manager for free.

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 517 posts

Posted 16 July 2014 - 02:11 PM #24

Hi Simtech,
We have followed each and every step which were given by swimcom but problem is same what I have reported that Tracking Links in emails are not Clickable. Instead of adding NEW CARRIERS to existing, we have removed existing and replaced them with new ones at below mentioned paths:

/public_html/design/themes/vivashop/templates/common/carriers.tpl
/public_html/design/themes/vivashop/mail/templates/common/carriers.tpl
/public_html/design/themes/responsive/templates/common/carriers.tpl
/public_html/design/themes/responsive/mail/templates/common/carriers.tpl
/public_html/var/themes_repository/vivashop/templates/common/carriers.tpl
/public_html/var/themes_repository/vivashop/mail/templates/common/carriers.tpl
/public_html/var/themes_repository/responsive/templates/common/carriers.tpl
/public_html/var/themes_repository/responsive/mail/templates/common/carriers.tpl
/public_html/var/themes_repository/basic/templates/common/carriers.tpl
/public_html/var/themes_repository/basic/mail/templates/common/carriers.tpl

Below is the code in old file.
{hook name="carriers:list"}
{if $carrier == "usps"}
	{$url = "https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=`$tracking_number`"}
	{$carrier_name = __("usps")}
{elseif $carrier == "ups"}
	{$url = "http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=`$tracking_number`"}
	{$carrier_name = __("ups")}
{elseif $carrier == "fedex"}
	{$url = "http://fedex.com/Tracking?action=track&tracknumbers=`$tracking_number`"}
	{$carrier_name = __("fedex")}
{elseif $carrier == "aup"}
	{$url = "http://auspost.com.au/track/track.html?id=`$tracking_number`"}
	{$carrier_name = __("australia_post")}
{elseif $carrier == "can"}
	{$url = "http://www.canadapost.com/cpotools/apps/track/personal/findByTrackNumber?trackingNumber=`$tracking_number`"}
	{$carrier_name = __("canada_post")}
{elseif $carrier == "dhl" || $shipping.carrier == "ARB"}
	{$url = "http://www.dhl-usa.com/en/express/tracking.shtml?ShipmentNumber=`$tracking_number`"}
	{$carrier_name = __("dhl")}
{elseif $carrier == "swisspost"}
	{$url = "http://www.post.ch/swisspost-tracking?formattedParcelCodes=`$tracking_number`"}
	{$carrier_name = __("chp")}
{elseif $carrier == "temando"}
	{$url = "https://temando.com/education-centre/support/track-your-item?token=`$tracking_number`"}
	{$carrier_name = __("temando")}
{else}
	{$url = ""}
	{$carrier_name = $carrier}
{/if}{/hook}
{capture name="carrier_name"}
{$carrier_name}
{/capture}{capture name="carrier_url"}
{$url nofilter}
{/capture}

Replaced by code.

{hook name="carriers:list"}
{if $carrier == "aramex"}
	{$url = "http://www.aramex.com/track-results-multiple.aspx?ShipmentNumber=`$tracking_number`"}
	{$carrier_name = __("Aramex")}
{elseif $carrier == "blazeflash"}
	{$url = "http://www.blazeflash.com/TrackDetail.aspx?awbno=`$tracking_number`"}
	{$carrier_name = __("Blazeflash")}
{elseif $carrier == "bluedart"}
	{$url = "http://bluedart.com/servlet/RoutingServlet?action=awbquery&awb=awb&handler=tnt&numbers=`$tracking_number`"}
	{$carrier_name = __("Bluedart")}
{elseif $carrier == "delhivery"}
	{$url = "http://track.delhivery.com/p/`$tracking_number`"}
	{$carrier_name = __("Delhivery")}
{elseif $carrier == "dhl"}
	{$url = "http://www.dhl.co.in/content/in/en/express/tracking.shtml?brand=DHL&AWB=`$tracking_number`"}
	{$carrier_name = __("DHL")}
{elseif $carrier == "dtdc"}
	{$url = "http://dtdc.com/tracking/tracking.asp`$tracking_number`"}
	{$carrier_name = __("DTDC")}
{elseif $carrier == "ecomex"}
	{$url = "http://eepl.ecomexpress.in/track_me/scan_open/1/?awb=`$tracking_number`&order="}
	{$carrier_name = __("eComExpress")}
{elseif $carrier == "fedex"}
	{$url = "http://fedex.com/Tracking?action=track&tracknumbers=`$tracking_number`"}
	{$carrier_name = __("Fedex")}
{elseif $carrier == "ffc"}
	{$url = "http://www.firstflight.net/n_contrac_new_12Digit_New.asp?tracking1=`$tracking_number`"}
	{$carrier_name = __("First Flight")}
{elseif $carrier == "gojavas"}
	{$url = "http://track.gojavas.com/Track/MyTrackResult.aspx?Dockno=`$tracking_number`&Flag=D"}
	{$carrier_name = __("goJavas")}
{elseif $carrier == "India Post"}
	{$url = "http://services.cept.gov.in/Speednettracking/Track.aspx?articlenumber=`$tracking_number`"}
	{$carrier_name = __("India Post")}
{elseif $carrier == "overnitex"}
	{$url = "http://www.overnitenet.com/Webtrack.aspx`$tracking_number`"}
	{$carrier_name = __("Overnite Express")}
{elseif $carrier == "redex"}
	{$url = "https://www.getsetred.net/Tracking?WayBills=`$tracking_number`_WayBill&Type=WayBill&IsOutSidePage=yes&Ref=`$tracking_number`"}
	{$carrier_name = __("Red Express")}
{elseif $carrier == "tpc"}
	{$url = "http://www.tpcindia.com/Tracking2014.aspx?id=`$tracking_number`&type=0&service=0#"}
	{$carrier_name = __("The Professional Couriers")}{else}
	{$url = ""}
	{$carrier_name = $carrier}
{/if}
{/hook}{capture name="carrier_name"}
{$carrier_name}
{/capture}
{capture name="carrier_url"}
{$url nofilter}
{/capture}

Kindly refer post http://forum.cs-cart...post__p__187654
Attached File  Shipping Mail Issue.doc   310.5KB   11 downloads
Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,955 posts

Posted 17 July 2014 - 08:35 AM #25

Thanks eComLab for reverting back on this post. What I observe is that I don't have design/themes/basic path available in my root directory. Seems like it got replaced by the VIVAShop theme installation. But when I downloaded the fresh CS-cart, there also the file under design/themes/basic/mail/templates/shipments/shipment_products.tpl is same to as of VIVAShop.

Seems like problem is something else. Kindly help on this.

NOTE: Do you think if I create basic/mail/templates/shipments/shipment_products.tpl path under design/themes/ will make this work?


Please attach the design/themes/VIVASHOP_THEME/mail/templates/shipments/shipment_products.tpl file here
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 517 posts

Posted 28 July 2014 - 07:17 PM #26

Sorry for late response. Please find code of the below template file.
design/themes/VIVASHOP_THEME/mail/templates/shipments/shipment_products.tpl

{include file="common/letter_header.tpl"}[/b]
[b]{__("dear")} {$order_info.firstname},<br /><br />[/b]
[b]{__("products_were_sent")}<br /><br />[/b]
[b]<strong>{__("order_id")}</strong>:&nbsp;#{$order_info.order_id}<br />
<strong>{__("shipping_method")}</strong>:&nbsp;{$shipment.shipping}<br />
<strong>{__("shipment_date")}</strong>:&nbsp;{$shipment.timestamp|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}<br />
{if $shipment.carrier}
	{include file="common/carriers.tpl" carrier=$shipment.carrier tracking_number=$shipment.tracking_number}
	<strong>{__("carrier")}</strong>:&nbsp;{$smarty.capture.carrier_name nofilter}<br />
{/if}
{if $shipment.tracking_number}
	<strong>{__("tracking_number")}</strong>:&nbsp;
	{if $smarty.capture.carrier_url}
		<a {if $smarty.capture.carrier_url|strpos:"://"}target="_blank"{/if} href="{$smarty.capture.carrier_url nofilter}">{$shipment.tracking_number}</a>
	{else}
		{$shipment.tracking_number}
	{/if}
	<br /><br />
{/if}[/b]
[b]<strong>{__("products")}:</strong>
<p>
{foreach from=$shipment.items key="hash" item="amount"}
	{if $amount > 0}
		{$amount}&nbsp;x&nbsp;{$order_info.products.$hash.product}<br />
		{if $order_info.products.$hash.product_options}
			{include file="common/options_info.tpl" product_options=$order_info.products.$hash.product_options}<br />
		{/if}
		<br />
	{/if}
{/foreach}
</p>[/b]
[b]{if $shipment.comments}
<br /><br />
<strong>{__("comments")}</strong>:
{$shipment.comments}
{/if}[/b]
[b]{include file="common/letter_footer.tpl"}

Warm Regards,
Admin | MVE: 4.2.4

 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2,163 posts

Posted 29 July 2014 - 06:08 AM #27

Hello,

Sorry for late response. Please find code of the below template file.
design/themes/VIVASHOP_THEME/mail/templates/shipments/shipment_products.tpl


It looks like this file is unmodified.

If you did not clear the template cache after modifying the carriers.tpl files, please try it.
Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Testing by QA and personal manager for free.

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 517 posts

Posted 29 July 2014 - 06:48 AM #28

Please let us know what modifications are required in this file so that we can make those changes. Is there some specific template cache we have to clear. I am aware of normal cache clear which we perform from Admin panel.
Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,955 posts

Posted 29 July 2014 - 07:40 AM #29

Please let us know what modifications are required in this file so that we can make those changes. Is there some specific template cache we have to clear. I am aware of normal cache clear which we perform from Admin panel.


Yes, the file looks unmodified. To clear the cache, please use the following URL:

http://mydomain.com/myadmin.php?cc&ctpl

where

mydomain.com - domain of your store
myadmin.php - your admin index script

Thanks
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 517 posts

Posted 31 July 2014 - 08:12 PM #30

I tried clearing cache but nothing worked for me. Not sure what the issue is?
Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,955 posts

Posted 01 August 2014 - 07:27 AM #31

If you provide us with the temporary FTP access to PM, we can examine the issue.
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • mymart
  • Newbie
  • Trial users
  • Join Date: 14-Jul 14
  • 3 posts

Posted 01 September 2014 - 08:27 AM #32

Hi
  • Thanks to swimcommunications. I have created new carriers and tracking links. But I still have a small issue.
  • For example, my new carrier name is ket, in the language I added carrier_ket KET.
  • When the vendor choose carrier, KET is displayed.
  • But when the customer checks the order, _ket is displayed as shown below.
    Shipping information

    KET Singapore Local Delivery
    Carrier: _ket (tracking #1408291111)

  • Another example

  • Shipping information

    KET Singapore Local Delivery

    Carrier: _taqbin (tracking #134134)

Anyone knows how to make this right? So _ket should be displayed as KET or ket at least....

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 2,900 posts

Posted 09 September 2014 - 11:36 AM #33

Can someone tell me the right way to do it?

1. DB

INSERT INTO cscart_shipping_services (`status`, `module`, `code`, `sp_file`) VALUES ('A', '?????', '', '');

2. variable: ltpost and name: Lithuanian Post

3. Cant understand apart from url what goes where?

{elseif $carrier == "NEW_CARRIER"}
	{$url = "http://YOUR_TRACKING_URL"}
	{$carrier_name = __("NEW_CARRIER")}

Thank you


This was the response i got from cscart, which i assume they won't mind me reposting. Thought i'd post for others. Note this worked for me in cs-cart v 4.1.3.

1. Create the new_carrier.sql file with the following content:

INSERT INTO cscart_shipping_services (`status`, `module`, `code`, `sp_file`) VALUES ('A', 'NEW_CARRIER', '', '');

where NEW_CARRIER should be replaced with your carrier name.

Restore this file in the Restore tab of the Administration > Database page in your admin panel.

2. Open the Administration > Languages > Translations page and create the carrier_NEW_CARRIER language variable where NEW_CARRIER is your new carrier name. Enter your carrier name in the Value field of this variable.

3. Open the design/themes/[YOUR_ACTIVE_THEME]/templates/common/carriers.tpl file of your CS-Cart installation and add this part of code:
{elseif $carrier == "NEW_CARRIER"}
	{$url = "http://YOUR_TRACKING_URL"}
	{$carrier_name = __("NEW_CARRIER")}

below this one:
{elseif $carrier == "temando"}
	{$url = "https://temando.com/education-centre/support/track-your-item?token=`$tracking_number`"}
	{$carrier_name = __("temando")}

where NEW_CARRIER should be replaced with your carrier name and YOUR_TRACKING_URL with the URL provided by your shipping carrier to track orders. Save the file.

Add the same part of code to the design/themes/[YOUR_ACTIVE_THEME]/mail/templates/common/carriers.tpl file of your CS-Cart installation. Save the file and check the results.


4.5.2 SP2


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,955 posts

Posted 09 September 2014 - 03:03 PM #34

In your case it will be

INSERT INTO cscart_shipping_services (`status`, `module`, `code`, `sp_file`) VALUES ('A', 'ltpost', '', '');

and

{elseif $carrier == "ltpost"}
	    {$url = "http://www.post.lt/en/help/parcel-search/index?num=`$tracking_number`"}
	    {$carrier_name = __("ltpost")}

Hope this willl help
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 2,900 posts

Posted 09 September 2014 - 04:49 PM #35

Well this has resulted in to having _carrier_ltpost as selection in creating new shippment page.

Here is how I have sorted this:

INSERT INTO cscart_shipping_services (`status`, `module`, `code`, `sp_file`) VALUES ('A', 'ltp', '', '');

Added lang:

variable ltp_post value Lithuanian Post
variable carrier_ltp value Lithuanian Post

{{elseif $carrier == "ltp"}
	{$url = "http://www.domain.com/parcel-search/index?num=`$tracking_number`"}
	{$carrier_name = __("ltp_post")}

PS this will solve mymart problem.

4.5.2 SP2


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,955 posts

Posted 10 September 2014 - 07:18 AM #36

Darius, thank you for keeping us informed. Hope this information will be useful for many CS-Cart users
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • raff
  • Member
  • Members
  • Join Date: 23-Feb 12
  • 21 posts

Posted 10 September 2014 - 01:30 PM #37

I tried to make similar amends but wanted to avoid having to modify carriers.tpl and instead use hooks or when necessary overrides.
Creating a hook for design/themes/[YOUR_ACTIVE_THEME]/templates/common/carriers.tpl simply would not work. whether .pre.tpl, .post.tpl or .override.tpl
This was apparently due to Smarty not being able to pass variables between hook template and parent template.
So instead I opted for creating full template override:
design/themes/[YOUR_ACTIVE_THEME]/templates/addons/my_changes/overrides/common/carriers.tpl

This worked first time and all is great.

However, I tried similar approach to mail templates and this simply refuses to work.
even when placing full override template in directory:
design/themes/[YOUR_ACTIVE_THEME]/mail/templates/addons/my_changes/overrides/common/carriers.tpl
the override of mail template is not registering nor working.
Is the directory structure for mail templates different to the front end templates?
Should I place mail override in different directory?

Any advice would be appreciated.

 
  • raff
  • Member
  • Members
  • Join Date: 23-Feb 12
  • 21 posts

Posted 10 September 2014 - 03:47 PM #38

OK I solved it.

I actually went back to using the hook instead of override and found the way to pass back the variables $carrier_name and $url back to parent template.
the trick was in using scope="root" in assign:

{assign var="carrier_name" value=$carrier_name scope="root"}
{assign var="url" value=$url scope="root"}

so if anybody prefers not to touch original templates the way to achieve this via hook is as follows:

for frontend, place file
design/themes/[YOUR_ACTIVE_THEME]/templates/addons/my_changes/hooks/carriers/list.post.tpl
for mail, place the file:
design/themes/[YOUR_ACTIVE_THEME]/mail/templates/addons/my_changes/hooks/carriers/list.post.tpl

change the citylink and ups to your courier codes and link to your tracking links

{if $carrier == "citylink"}
	{$url = "http://www.city-link.co.uk/dynamic/track.php?parcel_ref_num=`$tracking_number`"}
	{$carrier_name = __("carrier_citylink")}
{elseif $carrier == "ups"}
	{$url = "http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&amp;tracknums_displayed=1&amp;TypeOfInquiryNumber=T&amp;loc=en_GB&amp;InquiryNumber1=`$tracking_number`&amp;AgreeToTermsAndConditions=yes&amp;track.x=18&amp;track.y=11"}
	{$carrier_name = __("ups")}
{else}
	{$url = ""}
	{$carrier_name = $carrier}
{/if}

{assign var="carrier_name" value=$carrier_name scope="root"}
{assign var="url" value=$url scope="root"}

this still does not explain why override does not seem to work for mail templates... anyone knows?

 
  • remoteone
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 609 posts

Posted 12 May 2015 - 03:02 AM #39

Do the CSCart designers realise that there are other competitors that have Carrier customisation/functionallity straight out of the box??
No addon needed, no code changes. Some of them are free! FFS, c'mon cscart!

 
  • Snytefant
  • Newbie
  • Trial users
  • Join Date: 19-Jan 16
  • 3 posts

Posted 19 January 2016 - 02:35 PM #40

I have followed these steps (Database insert and the two Carriers.tpl), and I get the new carrier in the list. I am able to choose it.

The link in the email is not clickable. 
Is there any easy fix for this?

CS-cart-team should really implement a FREE integrated module for this, Since this is a basic task ..
There is one carrier module, but it cost 45 euro ..