vidmarc Posted July 17, 2013 Posted July 17, 2013 Is there any way of changing the order in which the postage prices are displayed for customers? Although 1st Class is the first option in admin, 2nd Class is above 1st Class in the drop down menu. Can we make 1st class the default option rather than 2nd? Quote
bsmither Posted July 17, 2013 Posted July 17, 2013 The code for the shipping options will put the cheapest at the top and progress to the most expensive. A simple code hack can stop that sorting. Quote
vidmarc Posted July 17, 2013 Author Posted July 17, 2013 Will be in touch - we need your Additional Products mod too Quote
bsmither Posted July 17, 2013 Posted July 17, 2013 In the file /classes/cart.class.php, near line 923 (this is CC521, line 929 for CC522), find: uasort($packages,'price_sort'); Add two slashes in front to make that a comment: // uasort($packages,'price_sort'); This will keep each individual shipping gateway's multiple results from sorting by price. The next task is to not have CubeCart automatically pre-select the cheapest price (regardless where it may be in the list). In the file /classes/cubecart.class.php, near line 1445 (for CC521, line 1418 for CC522), find: foreach ($shipping_values as $value) { Make the line look like this: foreach ($shipping_values as $value) { break; Quote
vidmarc Posted July 19, 2013 Author Posted July 19, 2013 Thanks for this - it now lists "Please Select" rather than defaulting to 2nd Class, but the user now gets this message: The following errors were detected: Unfortunately there are no suitable shipping methods available for your order. This may be because the total weight of your order is too high or we cannot ship to your country. Please contact a member of our staff for any further inquiries. Is there a way to default it to First Class? Quote
vidmarc Posted August 5, 2013 Author Posted August 5, 2013 Can anybody please help with this? Sorting shipping by the cheapest first is causing problems as customers are automatically using the cheapest which is surface mail with takes a month or longer to arrive.I did what was suggested above but it didn't sort First Class/Airmail as the main shipping option, which is what we need by default. Quote
bsmither Posted August 5, 2013 Posted August 5, 2013 Unlike Payment modules, Shipping modules do not have a "Default" control panel setting. Because every admin will enable and configure the shipping modules in a different order, an approach to sort by order they appear in the modules database table won't work either. Then, within each shipping module, there can be any number of "Service"-based rates: Priority, First Class, Parcel, etc. Being able to pre-select a shipping module would solve nothing with respect to select a service as a default within the module. But actually, that is probably easier to code for a solution. Which specific shipping module are you using that has this "First Class/Airmail" service? Quote
vidmarc Posted August 5, 2013 Author Posted August 5, 2013 We are using the "By Weight" option. This means all items sent 1st Class are sent via Royal Mail 1st Class (UK) or Airmail( outside UK) and 2nd Class is 2nd Class UK and Surface Mail (outside the UK).<br /><br />However, we also use iPostParcels for larger shipments and we can find no way on including this as an option.<br /><br />Can this be combined with the "All In One Shipping" option? Would that help? Quote
bsmither Posted August 5, 2013 Posted August 5, 2013 I think we discussed iPostParcels not having a means for an external program (such as CubeCart) to make automated queries. (On their web site, they say, "At ipostparcels, our express delivery prices are calculated in real time by The UK Mail Group's superb delivery zone system which considers the weight, size and additional services of your order." UK Mail Group appears to be the parent organization. But I find no information, other than a brief mention of an API for iConsign, of the possibility of creating a Cubecart module for iPostParcels. They say, "Please contact your account manager to arrange access to the comprehensive documentation and implementation support services we can provide." I would think that, if you have a rate chart, you could recreate that chart in All-in-One. Quote
vidmarc Posted August 6, 2013 Author Posted August 6, 2013 If we could just get shipping to default to First Class that would be a good start. Quote
rusticc3 Posted January 27, 2014 Posted January 27, 2014 I would also like first class as the default, for exactly the same reasons as above.thanks Quote
Dirty Butter Posted January 27, 2014 Posted January 27, 2014 Bsmither helped me somewhere on the forum to get rid of the drop down box - instead displaying all the available choices. Quote
wilded1 Posted March 25, 2015 Posted March 25, 2015 In the file /classes/cart.class.php, near line 923 (this is CC521, line 929 for CC522), find: uasort($packages,'price_sort'); Add two slashes in front to make that a comment: // uasort($packages,'price_sort'); This will keep each individual shipping gateway's multiple results from sorting by price. The next task is to not have CubeCart automatically pre-select the cheapest price (regardless where it may be in the list). In the file /classes/cubecart.class.php, near line 1445 (for CC521, line 1418 for CC522), find: foreach ($shipping_values as $value) { Make the line look like this: foreach ($shipping_values as $value) { break; This hack no longer works in version 6.0.1 and the script is completely different now. Is there a hook we can use to make this work? If not, would you have a suggestion for a new hack? TIA Quote
bsmither Posted March 25, 2015 Posted March 25, 2015 This line: uasort($packages, 'price_sort'); for CC602 is line 946. This line: foreach ($shipping_values as $value) { for CC602 is 1533, but that edit will no longer be used. Instead, where the $cheapest shipping rate would be saved in the basket, a logical false value will be used. Try, on line 1540:Was: if (!empty($cheapest)) { Now: if (!empty($cheapest)) { $cheapest = false; I need to run a tracer on this to make sure I am right. Quote
wilded1 Posted March 25, 2015 Posted March 25, 2015 Previously I had it so that none of the shipping methods were selected, so the customer had to actively select the shipping method rather than the cheapest be selected by default. CC 6.0.1 Is the script we are working with still classes/cart.class.php ? I ask because I am unable to find: if (!empty($cheapest)) { Quote
bsmither Posted March 25, 2015 Posted March 25, 2015 The code between CC5216 (near 1468) and CC602 (near 1540) is the same. So if your results are satisfactory in CC5216, then try the same edit in CC602. I was concerned about the following test on $cheapest, because if that's empty(), the next test is to check the store setting of "allowing no shipping". If no shipping is not allowed, CubeCart displays a warning. Quote
wilded1 Posted March 25, 2015 Posted March 25, 2015 It is on line 1466 of classes/cubecart.class in CC6.0.1 was: foreach ($shipping_values as $value) { now: foreach ($shipping_values as $value) { break; Edited the warning to be more of a notice and that works well. "Please note the following: No Delivery Zone is currently selected. Please select the delivery option below. Be sure to check which delivery zone you fall into and select the appropriate option to be able to continue to the Checkout" Will update to 6.0.2 most likely tonight as the site is live: www.topsoil4u.co.uk Quote
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.