Claudia Posted July 5, 2023 Share Posted July 5, 2023 I just upgraded to 1.0.26 AIOS and my shipping rates are showing twice on the checkout page. This has always happened and I was given code to correct this, but I'm not sure it would work now. Here is the change from some previous version of CC. What should I do? In All in One Shipping module, shipping.class.php, near line 212, find: $this->debug(sprintf('<strong>>>> Shipping zone [ID %s] matches the delivery address! Use this zone for shipping calculations.</strong>', $this->_all_zones[$i]['id'])); if ($this->_settings['multiple_zones'] == 'first') { $this->debug('Looking for first matching zone of best match (instead of searching for all matching zones - see AIOS module settings)'); } else { $this->debug('Searching for all matching shipping zones (instead of stopping at first matching zone - see AIOS module settings)'); } Change to: $this->debug(sprintf('<strong>>>> Shipping zone [ID %s] matches the delivery address! Use this zone for shipping calculations.</strong>', $this->_all_zones[$i]['id'])); if ($this->_settings['multiple_zones'] == 'first') { $this->debug('Looking for first matching zone of best match (instead of searching for all matching zones - see AIOS module settings)'); $closest_match_zone_id = $this->_all_zones[$i]['id']; break; } else { $this->debug('Searching for all matching shipping zones (instead of stopping at first matching zone - see AIOS module settings)'); } Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 5, 2023 Share Posted July 5, 2023 AIOS v1.0.26 restricts showing the debug report to only those who are configured to see CubeCart's debug data (admin, Store Settings, Advanced tab, "IP Addresses". So, no worries about customers seeing weird stuff. In AIOS, enable verbose debugging. Start a checkout. There should now be a red preamble to CubeCart's checkout page detailing how AIOS module calculated the package of rates. Please copy/paste that to a text file and attach it to a reply. Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 5, 2023 Author Share Posted July 5, 2023 Here you go debug.txt Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 5, 2023 Share Posted July 5, 2023 (edited) Sorry, no, not what I was looking for. In admin, Store Settings, Advanced tab, Make sure you have your local IP address in the "Restrict..." text entry field (www.showmyip.com). Then, in the AIOS module settings screen, enable the AIOS Verbose debugging. There should now be a red preamble to CubeCart's checkout page. This is what I would like to see. Edited July 5, 2023 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 5, 2023 Author Share Posted July 5, 2023 Here you go .... debug 2.txt Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 5, 2023 Share Posted July 5, 2023 (edited) Good. There seems to be an extensive collection of zones based on ranges of ZIP codes. There seems to be an extensive collection of zones based on sets of States. So, there is a match on Zone 2 Zips, and a match on Zone 2 States. Aside from the idea that ranges of zips versus sets of states could be considered the exact same thing, I see that the setting "First Match" isn't working as expected. So, as a work around, which the edit you posted above seems to be that solution, we might try to make that edit to AIOS v1.0.26. Instead of line 212, look at the code starting at line 237. Edited July 6, 2023 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 5, 2023 Author Share Posted July 5, 2023 As Estelle stated when she created this make a zone for zip codes and one for each state in case all the zip codes aren't covered. So I did that. I'm not sure where to make the edits for 1.0.26 Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 6, 2023 Share Posted July 6, 2023 In shipping.class.php: Find near lines 237-240: $this->debug(sprintf('<strong>>>> Shipping zone [ID %s] matches the delivery address! Use this zone for shipping calculations.</strong>', $this->_all_zones[$i]['id'])); if ($this->_settings['multiple_zones'] == 'first') { $this->debug('Looking for first matching zone of best match (instead of searching for all matching zones - see AIOS module settings)'); } else { Change to: $this->debug(sprintf('<strong>>>> Shipping zone [ID %s] matches the delivery address! Use this zone for shipping calculations.</strong>', $this->_all_zones[$i]['id'])); if ($this->_settings['multiple_zones'] == 'first') { $this->debug('Looking for first matching zone of best match (instead of searching for all matching zones - see AIOS module settings)'); $closest_match_zone_id = $this->_all_zones[$i]['id']; break; } else { The above is the exact same edit as was posted earlier, just the line numbers have changed. 1 Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 6, 2023 Author Share Posted July 6, 2023 That did it .... Thank You! Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 6, 2023 Share Posted July 6, 2023 I believe the essential difference with why your rate schedules require this edit is because, among more than one zone, there are same-named Shipping Rates. That is to say: Zone 2 Zips has a selection rule for 40100 - 40299, with a rate rule named "USPS First Class" equals 4.81. Zone 2 States has a selection rule for [IN, KY] named "USPS First Class" equals 4.81. So, the "First Match" feature seems to be working correctly as it finds the first match in each Zone, on the assumption only one Zone would find any match. Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 6, 2023 Author Share Posted July 6, 2023 That makes sense. I think I'll keep making the change instead of changing the rate rule. Thanks! 1 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.