How to add a Carrier in version 4?

Does anyone know how to add new carriers to version 4. In 3 there was an article in the knowledge base but files have changed in version 4.

Not aware of any “file” for creating a carrier. But you can look at others in the DB and replicate.

/design/backend/templates/common/carriers.tpl



/design/themes/basic/mail/templates/common/carriers.tpl



/design/themes/basic/templates/common/carriers.tpl



/design/backend/templates/views/shipments/components/new_shipment.tpl

Thanks guys, ill have a go later on.

I could not figure out how to do it as the code has changed a lot in 4.02



I contacted support and they said I would have to pay to have it done. Im a bit dissapointed as I feel the software should have that functionality.



If anyone has time to look at it and help I am sure there are a lot of us that would appreciate knowing how to do it.

Hi



I also tried to fix this manually adding the appropriate fields in all files but no luck.



I only have a question for The Tool.



Why do I even need to open those two files:[list]

[]/design/backend/templates/views/shipments/components/new_shipment.tpl

[
]/design/backend/templates/common/carriers.tpl

[/list]



First one (design/backend/templates/views/shipments/components/new_shipment.tpl ) has only this




```php


{__("carrier")}

{include file="common/carriers.tpl" id="carrier_key" name="shipment_data[carrier]"}

```

So just include file common/carriers.tpl.


Second one (/design/backend/templates/common/carriers.tpl) has only one hook

```php
{hook name="carriers:list"}
{foreach from=$carriers item="code"}
{__("carrier_`$code`")}
{/foreach}
{/hook} ```

I can't figure out where to look for these values ($carriers and code)

PS: I have set the language values correct for the new Carriers

To be honest, I didn't look at the files. I was posting the equivalent paths for the 4.x branch. After looking at them, it appears that they are now pulling the data from the data base.?

carriers.jpg

I have searched also in the database, but this is nowhere to find!



Fotis

You posted before I could get the image posted.



It looks like you need to append the prefix “carrier_”.

I already did that as I mentioned on my first post. Thats the language entries.



I created 3 new ones with the same prefis. Nothing!

If you also added the code in /design/themes/basic/mail/templates/common/carriers.tpl, then I don't know what else to tell you. Clear cache?

Did all that and checked twice, cleared cache but nothing



I am obviously missing something here…



Fotis

Carriers are listed in the DB in the shipping_serivices table.

They used to be separate from the available methods (services) but now it appears that the carrier is just the 'module' column in the table. $carriers = db_get_fields('SELECT module FROM ?:shipping_services GROUP BY module');

tbirnseth you're the man! nailed it.

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.

Hi Swim Communication,

Thanks for the post. These changes really worked for us but there is something more which we need help on.



We have made all the relevant changes as per your guidance but still we are able to see existing carriers like [AUP, DHL,Can,UPS, SwissPost, Temando etc] mentioned in screenshot.



[attachment=8226:SP32-20140715-195524.png]



Highlighted Carrier are the one which exist by default in cs-cart. We have removed these carriers from all the carriers.tpl file existing on below paths but still getting these values displayed at Carriers dropdown.



/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



We have also uncheck all the Shipping processors which were enabled by default under Settings–>Shipping Settings → Shipping processors

[attachment=8227:SP32-20140715-200720.png]



Kindly help us understand if we have missed out with some changes.

SP32-20140715-195524.png

SP32-20140715-200720.png

[color=#474C59]We have also started getting Shipment triggered email on customer's id with Tracking information but problem is that a “Tracking LINK” should get generated which should be displayed as link in Email so that if customer hits that hyperlink, he should get redirected to Courier company website for detailed tracking [refer attached doc.]. [/color]



[color=#474C59]Now when we turn back our theme to BASIC [default], this functionality starts working and hyperlink starts working. But when we apply Vivashop theme it doesn't work. [/color]

[color=#474C59]Request you to please help us on same. [/color]

[color=#474C59]Attached document for reference. [/color][attachment=8228:Shipping Mail Issue.doc]

Shipping Mail Issue.doc

Hello fleaffair,


[quote name='fleaffair' timestamp='1405435220' post='187583']

Highlighted Carrier are the one which exist by default in cs-cart. We have removed these carriers from all the carriers.tpl file existing on below paths but still getting these values displayed at Carriers dropdown.

[/quote]



Some database modifications are required in order to remove standard carriers from this list. You can export the cscart_shipping_services table of your database on the Administration > Database page of your CS-Cart admin panel. Open the export file and remove the Insert lines in that the module value is equal to the name of the service you want to remove. For example:



INSERT INTO cscart_shipping_services (service_id, status, [b]module[/b], code, sp_file) VALUES ('65', 'A', 'dhl', 'N', '');



Save the file and import it back on the Administration > Database page.



Please make sure to back up the original export file in case something goes wrong. I hope this will help you.

[quote name='fleaffair' timestamp='1405457603' post='187603']

[color=#474C59]We have also started getting Shipment triggered email on customer's id with Tracking information but problem is that a “Tracking LINK” should get generated which should be displayed as link in Email so that if customer hits that hyperlink, he should get redirected to Courier company website for detailed tracking [refer attached doc.]. [/color]



[color=#474C59]Now when we turn back our theme to BASIC [default], this functionality starts working and hyperlink starts working. But when we apply Vivashop theme it doesn't work. [/color]

[color=#474C59]Request you to please help us on same. [/color]

[color=#474C59]Attached document for reference. [/color][attachment=8228:Shipping Mail Issue.doc]

[/quote]



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.

[quote name='simtechdev' timestamp='1405495304' post='187630']

Hello fleaffair,







Some database modifications are required in order to remove standard carriers from this list. You can export the cscart_shipping_services table of your database on the Administration > Database page of your CS-Cart admin panel. Open the export file and remove the Insert lines in that the module value is equal to the name of the service you want to remove. For example:



INSERT INTO cscart_shipping_services (service_id, status, [b]module[/b], code, sp_file) VALUES ('65', 'A', 'dhl', 'N', '');



Save the file and import it back on the Administration > Database page.



Please make sure to back up the original export file in case something goes wrong. I hope this will help you.

[/quote]



Thanks Simtech,

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