Jump to content

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

How To Add A New Carrier Rate Topic   * * * * * 2 votes

 
  • victorb
  • Advanced Member
  • Members
  • Join Date: 29-Oct 12
  • 137 posts

Posted 06 December 2017 - 10:19 AM #81

!!! 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:
- How To Add Custom Css With My Changes Addon
- How To Add Custom Javascript With My Changes Addon

will work for ver 4.6.x ?



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

Posted 06 December 2017 - 12:53 PM #82

will work for ver 4.6.x ?

 

Unfortunately, no. Since version 4.4.1 carriers are linked with shipping services and corresponding functions does not have any hook.


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 Русская Версия

 
  • victorb
  • Advanced Member
  • Members
  • Join Date: 29-Oct 12
  • 137 posts

Posted 07 December 2017 - 11:47 AM #83

Unfortunately, no. Since version 4.4.1 carriers are linked with shipping services and corresponding functions does not have any hook.

 

Is possible to modify an existing carrier( UPS for example) and modify  carrier name  and carrier tracking url ?



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

Posted 07 December 2017 - 01:13 PM #84

Is possible to modify an existing carrier( UPS for example) and modify  carrier name  and carrier tracking url ?

 

app/Tygh/Shippings/Services/Ups.php

 

Check the getInfo function. It contains both parameters


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 Русская Версия

 
  • victorb
  • Advanced Member
  • Members
  • Join Date: 29-Oct 12
  • 137 posts

Posted 07 December 2017 - 02:43 PM #85

app/Tygh/Shippings/Services/Ups.php

 

Check the getInfo function. It contains both parameters

thanks,  is working but do not execute any search on carrier url according number



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

Posted 08 December 2017 - 05:20 AM #86

thanks,  is working but do not execute any search on carrier url according number

 

Sorry, I cannot help you without code review


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 Русская Версия

 
  • victorb
  • Advanced Member
  • Members
  • Join Date: 29-Oct 12
  • 137 posts

Posted 08 December 2017 - 11:01 AM #87

Sorry, I cannot help you without code review

code review provided by carrier company ?



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

Posted 08 December 2017 - 01:20 PM #88

code review provided by carrier company ?

 

I mean changes that you made in the Ups.php file.


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 Русская Версия