Jump to content

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

How to add a Carrier in version 4? Rate Topic   - - - - -

 
  • Ausy
  • Advanced Member
  • Trial users
  • Join Date: 07-Mar 12
  • 56 posts

Posted 14 October 2013 - 08:53 AM #1

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.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11562 posts

Posted 15 October 2013 - 03:07 AM #2

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

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3905 posts

Posted 15 October 2013 - 07:16 AM #3

/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

 
  • Ausy
  • Advanced Member
  • Trial users
  • Join Date: 07-Mar 12
  • 56 posts

Posted 15 October 2013 - 08:49 AM #4

Thanks guys, ill have a go later on.

 
  • Ausy
  • Advanced Member
  • Trial users
  • Join Date: 07-Mar 12
  • 56 posts

Posted 01 November 2013 - 09:08 AM #5

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.

 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1451 posts

Posted 17 November 2013 - 06:12 PM #6

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:
  • /design/backend/templates/views/shipments/components/new_shipment.tpl
  • /design/backend/templates/common/carriers.tpl

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


<div class="control-group">
				<label class="control-label" for="carrier_key">{__("carrier")}</label>
				<div class="controls">
					{include file="common/carriers.tpl" id="carrier_key" name="shipment_data[carrier]"}
				</div>
			</div>

So just include file common/carriers.tpl.


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

{hook name="carriers:list"}
	{foreach from=$carriers item="code"}
	 <option value="{$code}" {if $carrier == "{$code}"}{$carrier_name = __("carrier_`$code`")}selected="selected"{/if}>{__("carrier_`$code`")}</option>
	{/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
Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3905 posts

Posted 18 November 2013 - 08:42 AM #7

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.?

Attached Files



 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1451 posts

Posted 18 November 2013 - 08:45 AM #8

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

Fotis
Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3905 posts

Posted 18 November 2013 - 09:03 AM #9

You posted before I could get the image posted.

It looks like you need to append the prefix "carrier_".

 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1451 posts

Posted 18 November 2013 - 09:08 AM #10

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!
Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3905 posts

Posted 18 November 2013 - 09:35 AM #11

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?

 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1451 posts

Posted 18 November 2013 - 10:14 AM #12

Did all that and checked twice, cleared cache but nothing

I am obviously missing something here.....

Fotis
Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11562 posts

Posted 18 November 2013 - 10:03 PM #13

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');

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • dvsgr
  • Senior Member
  • Authorized Reseller
  • Join Date: 14-Apr 09
  • 1451 posts

Posted 18 November 2013 - 11:06 PM #14

tbirnseth you're the man! nailed it.
Fotis Kourmadas
Cs-Cart Development - Cs-Cart Authorized Reseller 

 

Posted 15 July 2014 - 02:26 AM #15

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.

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 July 2014 - 02:40 PM #16

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.

Attached File  SP32-20140715-195524.png   16.2KB   62 downloads

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
Attached File  SP32-20140715-200720.png   12.02KB   63 downloads

Kindly help us understand if we have missed out with some changes.
Warm Regards,
Admin | MVE: 4.2.4

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 July 2014 - 08:53 PM #17

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.].

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.
Request you to please help us on same.
Attached document for reference. Attached File  Shipping Mail Issue.doc   310.5KB   32 downloads
Warm Regards,
Admin | MVE: 4.2.4

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3404 posts

Posted 16 July 2014 - 07:21 AM #18

Hello fleaffair,

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.


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`, `module`, `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.

Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


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

Posted 16 July 2014 - 08:21 AM #19

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.].

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.
Request you to please help us on same.
Attached document for reference. Attached File  Shipping Mail Issue.doc   310.5KB   32 downloads


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.
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    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 16 July 2014 - 10:53 AM #20

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`, `module`, `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.


Thanks Simtech,
These changes worked for me. Thanking you again for nailing this down.
Warm Regards,
Admin | MVE: 4.2.4