Jump to content

Change 1st Class, 2nd Class in Ship by Wt


markscarts

Recommended Posts

Just a little tutorial, in case it may help someone. I'll give my own case and my solution.

MY CASE:

I'm using ship-by-weight. The drop-ship folk who handle my product offer two shipping options: Priority Mail and Express Mail. Priority Mail is less expensive than Express Mail, and shipping is very expensive for these products (glassware) so I want the least expensive option to show as default in the cart.

THE PROBLEM:

With ship-by-weight, the choices in ACP are 1st Class and 2nd Class. 1st Class, which is the more expensive, shows up as default in the cart.

THE SOLUTION:

Put the ship-by-weight rates which are least expensive in the 1st Class textbox of the module in ACP, put the more expensive rates in the 2nd Class text box, and make the 1st Class read "Priority Mail" in the cart and on receipts or order forms, while the 2nd Class reads "Express Mail."

STEP ONE. OPEN ../<your cubecart folder>/admin/modules/shipping/By_Weight/index.php

FIND:

  <tr>



    <td align="left" valign="top" class="tdOdd"><span class="tdText"><strong>Zone 1 Shiping 1st Class Rates:</strong> <br />(Comma Separated)    </span></td>



    <td class="tdOdd"><input type="text" name="module[zone1RatesClass1]" value="<?php echo $module['zone1RatesClass1']; ?>" class="textbox" size="40" />	</td>



  </tr>




Replace the words "Shiping 1st Class" in the code above with the words you want for the default option to appear in your cart. In my case, this was the least expensive option, Priority Mail, so I replaced the words "Shiping 1st Class" with the words "Priority Mail."



Next, find just beneath it the similar code:




  <tr>



    <td align="left" valign="top" class="tdOdd"><span class="tdText"><strong>Zone 1 Shiping 2nd Class Rates:</strong> <br />



      (Comma Separated) </span></td>



    <td class="tdOdd"><input type="text" name="module[zone1RatesClass2]" value="<?php echo $module['zone1RatesClass2']; ?>" class="textbox" size="40" /></td>



  </tr>




Replace the words "Shiping 2nd Class" in the code above with the words you want for the second choice option to appear in your cart. In my case, this was the more expensive option, Express Mail, so I replaced the words "Shiping 2nd Class" with the words "Express Mail."



Save and close the file.



STEP TWO - CC 3.0.0 THRU 3.0.2 (3.0.3 AND HIGHER GIVEN BELOW) . 

OPEN ../<your cubecart folder>/modules/shipping/By_Weight/calc.php



FIND:




	if($i."C1" == $optNo){

  $shippingPrice .= "selected='selected'";

  $basket = $cart->setVar("By Weight (1st Class)","shipMethod");

	}

	

	$sum = $sumClass1;

	

	$shippingPrice .= ">".priceFormat($sumClass1)." (1st Class)</option>\r\n";

}




Replace both instances of the words 1st Class in the code above with the words you want for the default option to appear in your cart. In my case, this was the least expensive option, Priority Mail, so I replaced the words 1st Class with the words Priority Mail.



next, FIND:




	if($i."C2" == $optNo){



  $shippingPrice .= "selected='selected'";



  $basket = $cart->setVar("By Weight (2nd Class)","shipMethod");



	}



	



	$shippingPrice .= ">".priceFormat($sumClass2)." (2nd Class)</option>\r\n";



	



}




Replace the words 2nd Class in the code above with the words you want for the second choice option to appear in your cart. In my case, this was the more expensive option, Express Mail, so I replaced the words 2nd Class with the words Express Mail.



Save and close the file.



STEP TWO - CC 3.0.3 AND HIGHER.

OPEN ../<your cubecart folder>/language/xx/lang.inc.php



FIND the changes near the end of this file marked 3.0.3, in the $lang ['misc'] array,

LOOK FOR:




'byWeight1stClass' => "By Weight (1st Class)",



'1stClass' => "(1st Class)",



'byWeight2ndClass' => "By Weight (2nd Class)",



'2ndClass' => "(2nd Class)",

Make changes to the text on the right side of the => signs:

Change "By Weight (1st Class)" to "By Weight (your_new_name)"

Change "(1st Class)" to "(your_new_name)"

Same type of changes for 2nd Class lines.

STEP THREE. Upload both files to your site, to the appropriate folders.

STEP FOUR. Go to your ACP, under Shipping Modules, Ship By Weight, enter the shipping information in the format described for each shipping method. enable and save the settings.

You can make all the necessary changes by analogy in manner described above for zone 2 and 3 countries.

Have fun! :w00t:

Link to comment
Share on other sites

  • 4 weeks later...

Hi markscarts

Nice usefull tutorial !

I tried to follow the solution, and was able to modify

STEP ONE. OPEN ../<your cubecart folder>/admin/modules/shipping/By_Weight/index.php

but the STEP TWO couldn't be modified in CC 3.0.3 as I was unable to find 1st Class & 2nd Class in ../<your cubecart folder>/modules/shipping/By_Weight/calc.php

Need Help ;)

Regards

Link to comment
Share on other sites

I was wanting to change mine also and seen where it was different. Here's some code from the calc.php

if($sumClass1>0){



	if($taxVal>0){

	

  $val = ($taxVal / 100) * $sumClass1;

  $sumClass1 = $sumClass1 + $val;

	}



	$shippingPrice .= "<option value='".$shipKey."'";

	

	if($shipKey ==$basket['shipKey']){

  $shippingPrice .= " selected='selected'";

  $basket = $cart->setVar($lang['misc']['byWeight1stClass'],"shipMethod");

  $basket = $cart->setVar($sumClass1,"shipCost");

	}

	

	$sum = $sumClass1;

	

	$shippingPrice .= ">".priceFormat($sumClass1)." ".$lang['misc']['1stClass']."</option>\r\n";

	

	$shipKey++;

}



if($sumClass2>0){



	if($taxVal>0){

	

  $val = ($taxVal / 100) * $sumClass2;

  $sumClass2 = $sumClass2 + $val;

	}



	$shippingPrice .= "<option value='".$shipKey."'";

	

	if($shipKey ==$basket['shipKey']){

  $shippingPrice .= " selected='selected'";

  $basket = $cart->setVar($lang['misc']['byWeight2ndClass'],"shipMethod");

  $basket = $cart->setVar($sumClass2,"shipCost");

	}

	

	$sum = $sumClass2;

	

	$shippingPrice .= ">".priceFormat($sumClass2)." ".$lang['misc']['2ndClass']."</option>\r\n";

	$shipKey++;

}

Link to comment
Share on other sites

You are right - scratched my previous post.

Syntax looked like it had been moved to language file, when I checked, I didn't find it.

Turns out I was looking at a 3.0.2 lang file */*

Anyone following this, look for 1st Class and 2nd Class specified in lang.inc.php. Be sure to keep up with changes you make there, so you'll know what you've done in the future if upgrading make it necessary to overwrite the file :huh:

Link to comment
Share on other sites

Guest benlogan

ok, see where it says

.$lang['misc']['1stClass'].




liek you guys said it is refering to your language file so open up



cart/language/XX/lang.inc.php        (XX being your language)



then goto Search, type in '1stClass' without the marks.

you should get 2 results (same with 2nd class)



Now change:




'byWeight1stClass' => "By Weight (1st Class)",



'1stClass' => "(1st Class)",




to:




'byWeight1stClass' => "Express Mail",



'1stClass' => "Express Mail",

this way, when you check an order status or a new order comes in, it will display the correct method.

it is pretty self explanatory, but there is always someone */*

Link to comment
Share on other sites

  • 1 month later...

Hi Mark

What about CC v3.0.5 ? How to rename 1st class & 2nd class in v3.0.5

STEP ONE file index.php is not there at admin/modules/shipping/By_Weight/index.php

Only able to find STEP TWO file lang.inc.php at /language/xx/lang.inc.php

Need Help

Yunus

Link to comment
Share on other sites

Hello Yunus,

I am again behind the curve with 3.0.5, because the store where I use ship by weight is tied up with mod development for csv upload program . . .

I can tell you this much, step one changes the language that you see in ACP, while step two changes the language that customer sees.

I have not checked this, but it is possible that Brooky moved the language statements for ACP to the language file, as he did for the cart which the customer sees in v. 3.0.3

I will try to hunt it down for you, and post new instructions for 3.0.5 if necessary.

SW, please help me with a csv script <praying smiley> :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...