Add a shipping carrier in cs-cart 4.x

Adding a new shipping carrier in cs-cart is an ugly story. There is no administration page for that and to do it manually you have to follow a multi-part procedure. This procedure I will try to describe here in details. I thank cs-cart forum members for their posts, because from the information posted there I managed to put up the whole procedure here clearly.


To make things easier lets suppose that the new carrier is called “SlowMotion Courrier Services” (I dont know if somewhere that company really exists). Let’s go!

First you have to add a record for the new carrier in cscart_shipping_services table.

db_query("insert into ?:shipping_services (status, module, code, sp_file) values ('A', 'smcs', 'SlowMotion Courrier Services', '');

smcs is for module, will explain later what is this. ‘SlowMotion Courrier Services’ is for field named code, just put here something that makes sense and matches your carrier’s name.

Next you have to add a record in to cscart_settings_objects table.

$id2 = db_query("insert into ?:settings_objects (edition_type, name, section_id, section_tab_id, type, value, position, is_global, handler, parent_id)
values ('ROOT', 'smcs_enabled', 7, 0, 'C', 'N', 110, 'Y', '', 0)");
  • edition_type is set to ROOT, that means that it works to all cs-cart editions.
  • name is the setting name, it must be the value you set in module (see above) followed by ‘_enabled’.
  • section_id, is settings section (atleast in 4.2.4 shipping carriers section has id 7)
  • section_tab_id, is the settings section tab id. Shipping carriers section has no tabs, so set to 0
  • type, is C for checkbox
  • value, is N (No) meaning that our carrier will be disabled.
  • position, is the order shown in the settings page.
  • is_global, set to Y, so it will be accessible to all storefronts/vendors.
  • handler = ” (don’t ask)
  • parent_id=0 (no parent setting)

Now we have our setting, we must add language variable for that, in order to have some human readable text for that in admin page.

db_query("insert into ?:settings_descriptions (object_id, object_type, lang_code, value, tooltip) values (?i, 'O','en', 'Enable SlowMotion', '')", $id2);

$id2 is the Id of the record we added in cscart_settings_objects. You can add descriptions for any languages you need. Why it is set to ‘Enable SlowMotion’? because all settings in that page are like that (Enable FedEx, Enable DHL etc).

Finally we have to add a language variable, we just paste the line from my addon:

<item id="_carrier_smcs" lang="en">SlowMotion Courrier</item>

Note the variable, _carrier_+what we set to module in cscart_shipping_services table.

At this point we are data ready.


I presume that we will use my_changes add-on for the job.

We need a frontend hook to show the link to our carrier’s tracking service. Create the folder (if not already there) design/themes/responsive/templates/addons/my_changes/hooks/carriers. There create a file named with content:

{if $carrier == "smcs"}
 {assign var="url" scope="root" value="`$tracking_number`"}
 {assign var="carrier_name" scope="root" value=$carrier}

Note and do not forget scope=”root” !! Thanks to Raff that he posted that smarty detail.

Also need the same for order email, that is. Create folder design/themes/responsive/mail/templates/addons/my_changes/hooks/carriers and place the same file as previous case. That is named with content:

{if $carrier == "smcs"}
 {assign var="url" scope="root" value="`$tracking_number`"}
 {assign var="carrier_name" scope="root" value=$carrier}

… I think that something is missing … I will come back soon with verification that all this are enough.

Leave a Reply

Your email address will not be published. Required fields are marked *