markscarts Posted September 5, 2005 Share Posted September 5, 2005 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: Quote Link to comment Share on other sites More sharing options...
Guest idara Posted September 29, 2005 Share Posted September 29, 2005 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 Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 29, 2005 Author Share Posted September 29, 2005 Hello idara, Which version are you using? I made those changes to 3.0.2. I know that the shipping has had a complete overhaul in 3.0.3, but I haven't looked at those files yet. It may be next week before I can look at them ;) Quote Link to comment Share on other sites More sharing options...
Guest idara Posted September 29, 2005 Share Posted September 29, 2005 Thanks markscarts I am using CC3.0.3 looking forward for CC3.0.5 next week ! Kind Regards Quote Link to comment Share on other sites More sharing options...
Guest agent Posted September 29, 2005 Share Posted September 29, 2005 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++; } Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 29, 2005 Author Share Posted September 29, 2005 Bad Advice Deleted Quote Link to comment Share on other sites More sharing options...
Guest agent Posted September 29, 2005 Share Posted September 29, 2005 I found where to change this and more in 3.0.3. It's in your lang.inc.php files under your_cc_dir/language/xx/lang.inc.php Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 29, 2005 Author Share Posted September 29, 2005 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: Quote Link to comment Share on other sites More sharing options...
Guest benlogan Posted September 29, 2005 Share Posted September 29, 2005 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 */* Quote Link to comment Share on other sites More sharing options...
markscarts Posted September 29, 2005 Author Share Posted September 29, 2005 Right, Ben, so I edited the original post to include new instructions for 3.0.3. Thanks for the help guys, I hadn't gotten round to re-implementing this in 3.0.3 yet - and I hadn't uploaded the new lang file for 3.0.3 yet, either. Kinda threw me off for a minute */* Quote Link to comment Share on other sites More sharing options...
Guest idara Posted October 30, 2005 Share Posted October 30, 2005 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 Quote Link to comment Share on other sites More sharing options...
markscarts Posted October 31, 2005 Author Share Posted October 31, 2005 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.