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

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

Posted 03 November 2015 - 09:55 AM #41

You should edit the following files:

 

design/themes/YOUR_THEME/mail/templates/orders/order_notification.tpl

design/backendmail/templates/orders/order_notification.tpl

 

Replace:

<b>{$order_header}:</b><br />

{include file="orders/invoice.tpl"}

with something similar to:

{if $order_info.status == 'P' || $order_info.status == 'C'}
<b>{$order_header}:</b><br />

{include file="orders/invoice.tpl"}
{/if}

Do not forget to clear cache


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • chris102
  • Member
  • Members
  • Join Date: 17-Sep 11
  • 49 posts

Posted 20 November 2015 - 07:43 AM #42

In 4.3.4 we had to create language variable without prefix "carrier_". Otherwise "_rolay_mail" was displayed everywhere.

 

How to deal with the situation if we have different tracking links for different languages?

 

i.e.

For English

gls-group.eu/EN/en/tracking?match=1234

 

For German

gls-group.eu/DE/de/paketverfolgung?match=1234


4.5.1


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

Posted 20 November 2015 - 09:18 AM #43

In 4.3.4 we had to create language variable without prefix "carrier_". Otherwise "_rolay_mail" was displayed everywhere.

 

How to deal with the situation if we have different tracking links for different languages?

 

i.e.

For English

gls-group.eu/EN/en/tracking?match=1234

 

For German

gls-group.eu/DE/de/paketverfolgung?match=1234

 

Try this code:

{elseif $carrier == "royal_mail"}
    {if $order_info.lang_code == 'de'}
        {$url = "http://gls-group.eu/DE/de/paketverfolgung?match=`$tracking_number`"}
        {$carrier_name = __("royal_mail")}
    {else}
	{$url = "http://gls-group.eu/EN/en/tracking?match=`$tracking_number`"}
	{$carrier_name = __("royal_mail")}
    {/if}
{else}

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • chris102
  • Member
  • Members
  • Join Date: 17-Sep 11
  • 49 posts

Posted 26 November 2015 - 05:14 PM #44

Hmm, doesn't seem to work or maybe I did sth somehow wrong. I get blank page after I click on "save" beeing in shipment view. There is neither notification displayed  nor email sent. Is variable $order_info.lang_code available at that stage?


4.5.1


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

Posted 27 November 2015 - 07:15 AM #45

Hmm, doesn't seem to work or maybe I did sth somehow wrong. I get blank page after I click on "save" beeing in shipment view. There is neither notification displayed  nor email sent. Is variable $order_info.lang_code available at that stage?

 

It should work. Please PM me temporary FTP access so that our specialists can examine the issue.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • chris102
  • Member
  • Members
  • Join Date: 17-Sep 11
  • 49 posts

Posted 13 December 2015 - 10:28 PM #46

I finally found some time to check it again and it works the way you sugessted.

I did it for more languages with elseif etc. and I forgot to colse {/if} tag a the end.

 

T H A N K    Y O U


4.5.1


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

Posted 14 December 2015 - 08:36 AM #47

I finally found some time to check it again and it works the way you sugessted.

I did it for more languages with elseif etc. and I forgot to colse {/if} tag a the end.

 

T H A N K    Y O U

 

We are glad to hear that the issue is solved!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • MrGrant
  • Junior Member
  • Members
  • Join Date: 07-Dec 06
  • 38 posts

Posted 14 June 2016 - 10:15 AM #48

I made a new carrier called "cpost" and everything works as intended.

 

I click the link in the invoice sent to Customer, it opens the correct Carrier tracking page.

I click the link in the shipments email sent to Customer, it opens the correct Carrier tracking page.

 

But when I click on the tracking link within an order (Admin side) it doesn't open to the Carrier tracking page like it should, it just opens the same order page.

 

I've double checked everything, cleared cache, searched the database etc to try and figure it out but can't make it work.

 

Any ideas?

Attached Files


CS-Cart V4.3.6, PHP 7.0.7, Linux VPS managed by www.serverpilot.io


 
  • MrGrant
  • Junior Member
  • Members
  • Join Date: 07-Dec 06
  • 38 posts

Posted 14 June 2016 - 10:32 AM #49

I found the problem. The new Carrier needs to be added to /app/schemas/shippings/carriers.php


CS-Cart V4.3.6, PHP 7.0.7, Linux VPS managed by www.serverpilot.io


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

Posted 14 June 2016 - 10:53 AM #50

I found the problem. The new Carrier needs to be added to /app/schemas/shippings/carriers.php

Yes, you right. You can do it through addon. For example create app/addons/my_changes/schemas/shippings/carriers.post.php file with the following code:

$schema['new_currier'] = array(
        'tracking_url_template' => 'http://tracking.url?id=[tracking_number]',
    );

return $schema;

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • MrGrant
  • Junior Member
  • Members
  • Join Date: 07-Dec 06
  • 38 posts

Posted 01 July 2016 - 05:06 AM #51

I have added my new Carriers and all works well. Now I want to remove the old Carriers from the dropdown.

 

I have double checked my files, cleared cache, template cache, manually cleared var/cache yet they still persist.

 

Is the most elegant way to remove it to just delete the language variable?

 

By 'elegant' I mean to make them cosmetically disappear without ripping them from the core, I don't want to throw too many errors in future upgrades :)

 

 

 

Attached Files


CS-Cart V4.3.6, PHP 7.0.7, Linux VPS managed by www.serverpilot.io


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

Posted 01 July 2016 - 06:36 AM #52

The list of carriers depends on the cscart_shipping_services table. But we do not recommend to change it. Please delete unused carriers in the fn_get_carriers function (app/functions/fn.cart.php)

 

Unfortunately it does not have hooks


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • MrGrant
  • Junior Member
  • Members
  • Join Date: 07-Dec 06
  • 38 posts

Posted 03 July 2016 - 11:15 PM #53

Ok I opened the file fn.cart.php and found

/**
 * Get all available carriers
 *
 * @return array List of available carrier codes
 */
function fn_get_carriers()
{
    $carriers = db_get_fields('SELECT module FROM ?:shipping_services GROUP BY module');

    return $carriers;
}

I see it pulls all the carriers from the db and puts them in an array.

 

But now I am stuck. Do I exclude (remove) the unwanted Carriers from the array, or do I need to re-write the db query to select only the wanted Carriers?

 

If so what would the query look like?


CS-Cart V4.3.6, PHP 7.0.7, Linux VPS managed by www.serverpilot.io


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

Posted 04 July 2016 - 07:58 AM #54

If you check example from the 1st page, please use the following query:

$carriers = db_get_fields('SELECT module FROM ?:shipping_services WHERE module = ?s GROUP BY module', 'royal_mail');

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • gijoy
  • Member
  • Members
  • Join Date: 29-Feb 16
  • 30 posts

Posted 09 August 2016 - 09:44 AM #55

 

This information should be already there. Try the following tracking URL:

{$url = "https:///www.internationalparceltracking.com/Main.aspx#/track/`$tracking_number`/`$order_info.s_country`/`$order_info.s_zipcode`"}

 

I am trying to do the same, also for PostNL. However the format in cscart changed with the recent version.

'tracking_url_template' => 'https://jouw.postnl.nl/#!/track-en-trace/[tracking_number]/{country}/{zipcode}',
 

Do you know how I can edit {country} and {zipcode} to the shipping country / zipcode in carriers.tpl?



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

Posted 09 August 2016 - 10:13 AM #56

In this case, please use the following format:

'tracking_url_template' => 'https://jouw.postnl.nl/#!/track-en-trace/[tracking_number]/[country]/[zipcode]',
 

then open the design/themes/responsive/templates/common/carriers.tpl and add the following code

{$url = $url|replace:"[country]":$order_info.s_country}
{$url = $url|replace:"[zipcode]":$order_info.s_zipcode}

after the following line:

{$url = $carriers_schema.$carrier.tracking_url_template|replace:"[tracking_number]":$tracking_number}

You can also use the carriers:list hook in this file


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • gijoy
  • Member
  • Members
  • Join Date: 29-Feb 16
  • 30 posts

Posted 09 August 2016 - 11:37 AM #57

Thanks a lot, the first part went fine but I am doing something wrong with the url replace. My edits seem to be ignored even though I clear the cache every time i edit something. I tried it both in the theme responsive as in our customized theme, which is a copy of responsive with some small edits. 

I even edited to 

    {$url = $carriers_schema.$carrier.tracking_url_template|replace:"[tracking_number]":"hihi"}

and the tracking number is not becoming hihi. So this part of the code is being completely ignored somehow. Any idea what I could be doing wrong?



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

Posted 09 August 2016 - 02:19 PM #58

For the store-front another file should be edited:

 

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • gijoy
  • Member
  • Members
  • Join Date: 29-Feb 16
  • 30 posts

Posted 10 August 2016 - 02:13 PM #59

Yes ive edited it there as well, but where should i see the effect? When i check the shipments of an order, nothing changes. I attached a screenshot to show which block i mean.

Attached Files



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

Posted 10 August 2016 - 02:23 PM #60

Please PM me temporary FTP access, we will check the issue


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.