huggettm Posted November 17, 2017 Share Posted November 17, 2017 Hi, I have done this on a cc6 store a long time ago and cant seem to recall the method, I would like the cart to display the most expensive shipping first as default instead of the cheapest? Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted November 17, 2017 Share Posted November 17, 2017 Our enhanced sorting plugin does this - along with a load of other possible sorting options that arent possible in standard CubeCart - see the list here : https://www.cubecart.com/extensions/plugins/enhanced-sorting Ian Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 17, 2017 Author Share Posted November 17, 2017 thank you, that looks good but a bit over the top for what i am trying to achieve Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 17, 2017 Share Posted November 17, 2017 In /classes/cubecart.class.php, near line 1676: Find: // Lets try to choose cheapest shipping option // for them if they haven't chosen already if ((!isset($this->_basket['shipping']) && !$digital_only) || (!$offset_matched && isset($this->_basket['shipping']['offset']) && !$digital_only)) { // Scanning for cheapest shipping because shipping has yet to be set and this basket is not digital only. foreach ($shipping_values as $value) { if (!isset($cheapest['value']) || $value['value'] < $cheapest['value']) { // Found a cheaper value! $cheapest = $value; Change the comparison of less than to greater than. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted November 17, 2017 Share Posted November 17, 2017 2 hours ago, huggettm said: thank you, that looks good but a bit over the top for what i am trying to achieve I agree that you get a lot of extra functionality over and above the shipping cost sorting which you asked about (although I am sure that you would probably start using that if you had the plugin) but the only other solution is changing core code as suggested which to my thinking is always a bad idea Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 18, 2017 Author Share Posted November 18, 2017 19 hours ago, bsmither said: In /classes/cubecart.class.php, near line 1676: Find: // Lets try to choose cheapest shipping option // for them if they haven't chosen already if ((!isset($this->_basket['shipping']) && !$digital_only) || (!$offset_matched && isset($this->_basket['shipping']['offset']) && !$digital_only)) { // Scanning for cheapest shipping because shipping has yet to be set and this basket is not digital only. foreach ($shipping_values as $value) { if (!isset($cheapest['value']) || $value['value'] < $cheapest['value']) { // Found a cheaper value! $cheapest = $value; Change the comparison of less than to greater than. Thanks brian, I tried this // Lets try to choose cheapest shipping option // for them if they haven't chosen already if ((!isset($this->_basket['shipping']) && !$digital_only) || (!$offset_matched && isset($this->_basket['shipping']['offset']) && !$digital_only)) { foreach ($shipping_values as $value) { if (!isset($cheapest['value']) || $value['value'] > $cheapest['value']) { $cheapest = $value; } but it makes no difference in the cart view Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 18, 2017 Share Posted November 18, 2017 You may need to start with an empty cart. Did you make the edit during an existing shopping basket? If so, then CubeCart is remembering the previous shipping cheapest selection. Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 20, 2017 Author Share Posted November 20, 2017 aha, thank you 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.