How To Add A New Carrier

!!! This instruction will not work for CS-Cart and Multi-Vendor 4.4.1 and latest versions

Let's image that we should add the Royal Mail carrier. We will use royal_mail string as carrier identifier.

The tutorial is actual for CS-Cart and Multi-Vendor 4.x

1. Versions 4.0.x-4.2.x: Create the var/database/new_carrier.sql file with the following content:
Versions 4.3.x: Create the var/backups/new_carrier.sql file with the following content:

INSERT INTO ?:shipping_services (`status`, `module`, `code`, `sp_file`) VALUES ('A', 'royal_mail', '', '');

2. Versions 4.0.x-4.2.x: Log in the admin panel, go to Administration -> Database -> Restore page, select the
new_carrier.sql file and restore it.
Versions 4.3.x: Log in the admin panel, go to Administration -> Backup/Restore page, select the
new_carrier.sql file and restore it.

3. Go to Administration -> Languages -> Translations page and create new language variable:

Language variable: carrier_royal_mail ("carrier_" + carrier identifier)
Value: Royal Mail

4. Versions 4.3.5-4.3.x: Go to point #6

Versions 4.0.x-4.3.5: Edit the design/themes/THEME/templates/common/carriers.tpl file of your CS-Cart installation and replace this part of code:

{else}

with this one:

{elseif $carrier == "royal_mail"}
{$url = "http://www.royalmail.com/portal/rm/track?trackNumber=`$tracking_number`"}
{$carrier_name = __("royal_mail")}
{else}

where $url means the URL which enables your customers to see carrier delivery tracking information without the need to link to the carrier website. If you do not know such URL, just leave it empty:

{$url = ""}

5. Edit the design/themes/THEME/mail/templates/common/carriers.tpl file and apply the same changes there

6. Versions 4.3.5-4.3.x only (!): Open the app/schemas/shippings/carriers.php file and add:

'royal_mail' => array(
    'tracking_url_template' => 'http://www.royalmail.com/portal/rm/track?trackNumber=[tracking_number]',
),

after the following lines of code:

'usps' => array(
    'tracking_url_template' => 'https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=[tracking_number]',
),

7. Clear the cache ( Administration > Storage > Clear cache )

8. Check the result


See also:
- [url="http://forum.cs-cart.com/topic/37510-how-to-add-custom-css-with-my-changes-addon/"]How To Add Custom Css With My Changes Addon[/url]
- [url="http://forum.cs-cart.com/topic/37758-how-to-add-custom-javascript-with-my-changes-addon/"]How To Add Custom Javascript With My Changes Addon[/url]

Good idea for addon? :)

@Darius - Why would you create an addon for a one time procedure? Seems the instructions are very complete and clear. Be nice if cs-cart added a hook to the carriers.tpl file so this could in fact be done from an addon (my_change). I.e. no need to modify a distributed file.

[quote name='tbirnseth' timestamp='1418177713' post='199282']

@Darius - Why would you create an addon for a one time procedure? Seems the instructions are very complete and clear. Be nice if cs-cart added a hook to the carriers.tpl file so this could in fact be done from an addon (my_change). I.e. no need to modify a distributed file.

[/quote]



hello

thanks



How addon (my_chang to)?

example

give away

course code path and codes



Thank you.

[quote name='eComLabs' timestamp='1418140945' post='199248']

Let's image that we should add the Royal Mail carrier. We will use royal_mail string as carrier identifier.



[color=#282828][font=arial, verdana, tahoma, sans-serif]The tutorial is actual for CS-Cart and Multi-Vendor 4.x[/font][/color]


  1. Create the var/database/new_carrier.sql file with the following content:



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




2. Log in the admin panel, go to Administration → Database → Restore page, select the

new_carrier.sql file and restore it.



3. Go to Administration → Languages → Translations page and create new language variable:



Language variable: carrier_royal_mail (“carrier_” + carrier identifier)

Value: Royal Mail



4. Edit the design/themes/THEME/templates/common/carriers.tpl file of your CS-Cart installation and replace this part of code:



{else}




with this one:



{elseif $carrier == "royal_mail"}
{$url = "http://www.royalmail.com/portal/rm/track?trackNumber="}
{$carrier_name = __("royal_mail")}
{else}




where $url means the URL which enables your customers to see carrier delivery tracking information without the need to link to the carrier website. If you do not know such URL, just leave it empty:



{$url = ""}




5. Edit the design/themes/THEME/mail/templates/common/carriers.tpl file and apply the same changes there



6. Clear the cache ( Administration > Storage > Clear cache )



7. Check the result





See also:

Contact the vendor of the vivashop theme.

Hi this is already an addon in our shop, with some added features



See this Νέα Μεταφορική για CS-Cart 4.x - CS-Cart Addons/Πρόσθετα at Cscart.Biz | CS-Cart Market by Dvs.gr



Fotis

[quote name='imporcayca' timestamp='1426784680' post='208445']

I have try this, but what about the tracking link, using vivashop theme, i have cscart 4x and i have try all posted in this forums about add tracking link to email notification to customer, and it doesnt work.





Any idea about it?

[/quote]



I am not sure about the code of this 3rd party theme. Try to contact them

Hi,



Everything works just fine, but the tracking url is not shown in email… I use a default responsive theme, version 4.2.3.



Thank you.

[quote name='jalnicu' timestamp='1432167433' post='215172']

Hi,



Everything works just fine, but the tracking url is not shown in email… I use a default responsive theme, version 4.2.3.



Thank you.

[/quote]



Please make sure that the point #5 is completed. Also try to delete the var/cache directory manually

Hi,



The #5 is completed:



{elseif $carrier == "royal_mail"}
{$url = "http://www.fancourier.ro/ro/tools/awb-tracking/"}
{$carrier_name = __("royal_mail")}
{else}
{$url = ""}
{$carrier_name = $carrier}
{/if}




I have deleted var/cache directory manually, but is still not working. This is how my email look:



"

[color=#000000]Draga Andrei,[/color]



[color=#000000]Produsele au fost trimise catre dvs. Informatii cu privire la comanda dvs. sunt precizate mai jos[/color]



[color=#000000]ID-ul comenzii[/color][color=#000000]: #26[/color]

[color=#000000]Metoda de expediere[/color][color=#000000]: Fan Courier[/color]

[color=#000000]Data expedierii[/color][color=#000000]: 05/06/2015, 07:41[/color]

[color=#000000]Numarul de urmarire[/color][color=#000000]: 1234567890 [/color]



[color=#000000]Produse:[/color][color=#000000]

1 x Manusi schi Fischer Fashion

Optiuni: Marime: M , Culoare: Alb

[/color]





[color=#000000]Comentarii[/color][color=#000000]: Test[/color][color=#000000]

Va multumim pentru ca ati ales magazinul nostru.[/color][color=#000000]

"[/color]

Please send me temporary FTP access so that our specialists can examine the issue

@Ecom-labs



I do not have var/database directory in our latest V4.3.3 installed shop. Is this tutorial also valid for V4.3.3 ?

[quote name='Webmaster_at_Mungotedo' timestamp='1437740690' post='224198']

@Ecom-labs



I do not have var/database directory in our latest V4.3.3 installed shop. Is this tutorial also valid for V4.3.3 ?

[/quote]



Due to new Backup feature, the database directory was replaced with backups one in the latest version. I will correct the instruction, thank you.

Hmm well, I do not even have that “database” directory

I mean var/database and var/backups

[quote name='eComLabs' timestamp='1437754430' post='224235']

I mean var/database and var/backups

[/quote]



That is weird, I have neither



[attachment=9939:novardatabase.png]

novardatabase.png

It should be installed by the upgrade. But you can always create it manually

[quote name='jalnicu' timestamp='1432167433' post='215172']

Hi,



Everything works just fine, but the tracking url is not shown in email… I use a default responsive theme, version 4.2.3.



Thank you.

[/quote]



Hi,



Same problem but I use basic theme Ver. 4.3.2



Do you find a way to make it work ?





tks

Please make sure that the step #5 is completed