tucstore Posted March 11, 2021 Share Posted March 11, 2021 good afternoon i have had a lot of orders from prisons now to delivery parcels to the staff members etc it seems the package has a lot of delays in getting there as you can imagine i was wondering if someone could make me a module that i can input all the post codes of all the prisons in uk and isle british isles so that when the customer puts in the prison post code it only offers them tracked services? Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 11, 2021 Share Posted March 11, 2021 This is a pretty specific business requirement. The All In One Shipping method can drill to specific post codes. Setup a shipping zone for UK prisons by post code. Done! Link to comment Share on other sites More sharing options...
tucstore Posted March 11, 2021 Author Share Posted March 11, 2021 very quick response thank you x Link to comment Share on other sites More sharing options...
tucstore Posted March 11, 2021 Author Share Posted March 11, 2021 when i select country united kingdom is not on there "Select the country"] argentina brazil canada india indonesia japan mexico thailand usa those are my only options Link to comment Share on other sites More sharing options...
bsmither Posted March 11, 2021 Share Posted March 11, 2021 Did you recently install AIOS v1.0.20? If so, there is a fix applied that should now show only countries enabled in admin, Countries/Zones. Please verify that United Kingdom is enabled there. Link to comment Share on other sites More sharing options...
bsmither Posted March 11, 2021 Share Posted March 11, 2021 Looking at the new version's code and am somewhat disappointed that, it seems all countries get loaded into the drop-down - not just enabled. (Enabled states are fixed.) So, does United Kingdom even exist in admin, Countries/Zones? It would be very strange if it didn't. Link to comment Share on other sites More sharing options...
tucstore Posted March 11, 2021 Author Share Posted March 11, 2021 it says unitd kingdom enabled zone optional in countries united kingdom in zones is enabled Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 11, 2021 Share Posted March 11, 2021 1 hour ago, bsmither said: Looking at the new version's code and am somewhat disappointed that, it seems all countries get loaded into the drop-down - not just enabled. (Enabled states are fixed.) So, does United Kingdom even exist in admin, Countries/Zones? It would be very strange if it didn't. I'll look at that tomorrow. Link to comment Share on other sites More sharing options...
tucstore Posted March 11, 2021 Author Share Posted March 11, 2021 ok well im stil unable to select united kingdom Link to comment Share on other sites More sharing options...
bsmither Posted March 11, 2021 Share Posted March 11, 2021 Did you recently install AIOS v1.0.20? I am running it now and have all countries listed when I select the "One or more postal codes" radio button. If possible, edit the AIOS file /skin/admin/index.tpl. At the end of the file, add {debug}. When you next ask the browser to show the Add new Shipping Zone page, there will be a popup. The popup is Smarty's debug listing and will show what the variable $COUNTRIES contains. Please let us know if the array contents for $COUNTRIES is short (nine elements) or long (nearly 240 elements). Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 12, 2021 Share Posted March 12, 2021 10 hours ago, tucstore said: ok well im stil unable to select united kingdom Really? Can you show a screenshot? Link to comment Share on other sites More sharing options...
tucstore Posted March 12, 2021 Author Share Posted March 12, 2021 ok https://paste.pics/ba5eab4aa870760cf9b852af8425f4d9 https://paste.pics/a7c77bee4f941ad413fb5017efaa147f Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 12, 2021 Share Posted March 12, 2021 Hmm I can't reproduce that. Are you sure you are using the latest version? Link to comment Share on other sites More sharing options...
tucstore Posted March 12, 2021 Author Share Posted March 12, 2021 yes i am using latest version Link to comment Share on other sites More sharing options...
tucstore Posted March 12, 2021 Author Share Posted March 12, 2021 when looking at the html source of the page i see <div class="clear"> <select id="zone_countries" data-placeholder="Choose each country by typing here..." name="zone_countries[]" multiple="multiple" class="chzn-select" style="width:350px;"> <option value="AR" >Argentina</option> <option value="BR" >Brazil</option> <option value="CA" >Canada</option> <option value="CN" >China</option> <option value="IN" >India</option> <option value="ID" >Indonesia</option> <option value="JP" >Japan</option> <option value="MX" >Mexico</option> <option value="TH" >Thailand</option> <option value="US" >United States</option> </select> </div> </div> <div id="div_states" class="nostripe"> Link to comment Share on other sites More sharing options...
tucstore Posted March 12, 2021 Author Share Posted March 12, 2021 17 hours ago, bsmither said: Did you recently install AIOS v1.0.20? I am running it now and have all countries listed when I select the "One or more postal codes" radio button. If possible, edit the AIOS file /skin/admin/index.tpl. At the end of the file, add {debug}. When you next ask the browser to show the Add new Shipping Zone page, there will be a popup. The popup is Smarty's debug listing and will show what the variable $COUNTRIES contains. Please let us know if the array contents for $COUNTRIES is short (nine elements) or long (nearly 240 elements). $COUNTRIES Origin: "Smarty object" Value Array (10) 0 => Array (7) id => "10" iso => "AR" name => "Argentina" iso3 => "ARG" numcode => "032" eu => "0" status => "1" 1 => Array (7) id => "30" iso => "BR" name => "Brazil" iso3 => "BRA" numcode => "076" eu => "0" status => "1" 2 => Array (7) id => "38" iso => "CA" name => "Canada" iso3 => "CAN" numcode => "124" eu => "0" status => "1" 3 => Array (7) id => "44" iso => "CN" name => "China" iso3 => "CHN" numcode => "156" eu => "0" status => "1" 4 => Array (7) id => "99" iso => "IN" name => "India" iso3 => "IND" numcode => "356" eu => "0" status => "1" 5 => Array (7) id => "100" iso => "ID" name => "Indonesia" iso3 => "IDN" numcode => "360" eu => "0" status => "1" 6 => Array (7) id => "107" iso => "JP" name => "Japan" iso3 => "JPN" numcode => "392" eu => "0" status => "1" 7 => Array (7) id => "138" iso => "MX" name => "Mexico" iso3 => "MEX" numcode => "484" eu => "0" status => "1" 8 => Array (7) id => "211" iso => "TH" name => "Thailand" iso3 => "THA" numcode => "764" eu => "0" status => "1" 9 => Array (7) id => "226" iso => "US" name => "United States" iso3 => "USA" numcode => "840" eu => "0" status => "1" Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2021 Share Posted March 12, 2021 Did you recently install AIOS v1.0.20? Link to comment Share on other sites More sharing options...
Al Brookbanks Posted March 12, 2021 Share Posted March 12, 2021 Maybe remove the extension files and reinstall Link to comment Share on other sites More sharing options...
tucstore Posted March 12, 2021 Author Share Posted March 12, 2021 4 minutes ago, bsmither said: Did you recently install AIOS v1.0.20? yes i did if i reinstall it will i lose all my rates as it takes so long putting them all in and it would mean having to stop all orders coming in until i enter them all in again Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2021 Share Posted March 12, 2021 I am focusing on the resultset from the query at /admin/index.inc.php, near line 322. The query gets put into the Smarty template variable straight-away. No chance to change its contents - unless changed later. I'm looking for that possibility now. I have little confidence that re-installing the module code will do anything different. All the rates are databased. They will not get lost. Link to comment Share on other sites More sharing options...
bsmither Posted March 12, 2021 Share Posted March 12, 2021 In the AIOS file /admin/index.inc.php: Near line 322, find: $template_vars['COUNTRIES'] = $countries; Change to: $template_vars['COUNTRIES'] = $countries; $GLOBALS['debug']->debugMessage('The number of countries retrieved from the database is: '.count($countries)); In CubeCart's admin, Store Settings, Advanced tab, enable Cubecart's debug mode and enter your computer's public IP address in the next field (www.showmyip.com). Returning to the AIOS module, Add New Shipping Zone tab, scroll to the bottom of the page where there is a grey debug area. Below the list of SQL queries is a section called: Debug Messages. There should be one entry that says: [0] The number of countries retrieved from the database is: 241 Yours might say 10. If so, then we need to look again at the list of Countries in admin, Countries/Zones to determine how many there are. Link to comment Share on other sites More sharing options...
tucstore Posted March 13, 2021 Author Share Posted March 13, 2021 in debug messages i see no messages like that Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2021 Share Posted March 13, 2021 When viewing the "Add New Shipping Zone" screen, that message did not appear below the list of SQL queries? That's bizarre! So, I have to ask this stupid question: Did you edit the correct file? Link to comment Share on other sites More sharing options...
tucstore Posted March 13, 2021 Author Share Posted March 13, 2021 1 Hack: 1615653839.43690 --- Duration: 633 µs [NOT CACHED] SELECT SQL_CALC_FOUND_ROWS * FROM `ss_dbprefixCubeCart_sessions` WHERE ss_dbprefixCubeCart_sessions.session_id = 'df711d678d092481b97e775f6aedf074' LIMIT 1; 2 Hack: 1615653839.43710 --- Duration: 228 µs [NOT CACHED] SELECT FOUND_ROWS() as Count; 3 Hack: 1615653839.45730 --- Duration: 232 µs [NOT CACHED] SELECT * FROM `ss_dbprefixCubeCart_lang_strings` WHERE ss_dbprefixCubeCart_lang_strings.language = 'en-GB' ; 4 Hack: 1615653839.45980 --- Duration: 845 µs [NOT CACHED] SELECT * FROM `ss_dbprefixCubeCart_hooks` WHERE ss_dbprefixCubeCart_hooks.enabled = '1' ORDER BY priority ASC ; 5 Hack: 1615653839.46100 --- Duration: 528 µs [NOT CACHED] SELECT * FROM `ss_dbprefixCubeCart_code_snippet` WHERE ss_dbprefixCubeCart_code_snippet.enabled = '1' ORDER BY `priority` ASC ; 6 Hack: 1615653839.46560 --- Duration: 235 µs [NOT CACHED] SELECT `name` FROM `ss_dbprefixCubeCart_geo_country` WHERE ss_dbprefixCubeCart_geo_country.numcode = '826' ; 7 Hack: 1615653839.46800 --- Duration: 696 µs [NOT CACHED] SELECT C.cat_id, C.cat_name, C.cat_parent_id, S.path FROM `ss_dbprefixCubeCart_category` as C LEFT JOIN `ss_dbprefixCubeCart_seo_urls` as S ON S.item_id=C.cat_id WHERE S.type='cat' AND S.redirect='0' ORDER BY C.cat_id DESC 8 Hack: 1615653839.46960 --- Duration: 613 µs [NOT CACHED] SELECT `cat_id`, `cat_name` FROM `ss_dbprefixCubeCart_category_language` WHERE ss_dbprefixCubeCart_category_language.language = 'en-GB' ; 9 Hack: 1615653839.47420 --- Duration: 554 µs [NOT CACHED] SELECT SQL_CALC_FOUND_ROWS MIN(`live_from`) AS `next_time` FROM `ss_dbprefixCubeCart_inventory` WHERE `live_from` > UNIX_TIMESTAMP() LIMIT 1; 10 Hack: 1615653839.47440 --- Duration: 231 µs [NOT CACHED] SELECT FOUND_ROWS() as Count; 11 Hack: 1615653839.47700 --- Duration: 430 µs [NOT CACHED] SELECT * FROM `ss_dbprefixCubeCart_permissions` WHERE ss_dbprefixCubeCart_permissions.admin_id = '1' ; 12 Hack: 1615653839.48000 --- Duration: 313 µs [NOT CACHED] SELECT SQL_CALC_FOUND_ROWS `array` FROM `ss_dbprefixCubeCart_config` WHERE ss_dbprefixCubeCart_config.name = 'All_In_One_Shipping' LIMIT 1; 13 Hack: 1615653839.48040 --- Duration: 429 µs [NOT CACHED] SELECT FOUND_ROWS() as Count; 14 Hack: 1615653839.48190 --- Duration: 587 µs [NOT CACHED] SELECT SQL_CALC_FOUND_ROWS `status`, `countries` FROM `ss_dbprefixCubeCart_modules` WHERE ss_dbprefixCubeCart_modules.folder = 'All_In_One_Shipping' LIMIT 1; 15 Hack: 1615653839.48200 --- Duration: 128 µs [NOT CACHED] SELECT FOUND_ROWS() as Count; 16 Hack: 1615653839.48250 --- Duration: 353 µs [NOT CACHED] SELECT * FROM `ss_dbprefixCubeCart_modules` WHERE ss_dbprefixCubeCart_modules.folder = 'All_In_One_Shipping' ; 17 Hack: 1615653839.48480 --- Duration: 586 µs [NOT CACHED] SELECT `id`, `tax_name` FROM `ss_dbprefixCubeCart_tax_class` ORDER BY `tax_name` ASC ; 18 Hack: 1615653839.48590 --- Duration: 502 µs [NOT CACHED] SELECT * FROM `ss_dbprefixCubeCart_geo_country` WHERE ss_dbprefixCubeCart_geo_country.status = '1' ORDER BY `name` ASC ; All_In_One_Shipping: settings: Array ( [cc5_data] => 1 [countries] => [debug] => 0 [default] => 0 [disabled_countries] => [folder] => All_In_One_Shipping [group_name] => [module] => shipping [module_id] => 126 [multiple_zones] => all [position] => 0 [range_items] => 0 [range_subtotal] => 1 [range_weight] => 1 [status] => 1 [tax] => 3 [tax_included] => [use_flat] => 1 [use_item] => 0 [use_percent] => 0 [use_weight] => 0 Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2021 Share Posted March 13, 2021 Query #18 is interesting. My AIOS v1.0.20 does not have a WHERE clause. I wonder if this module got updated yet again. Apparently so. Still, the debug message should be there. But now that the list of countries is being restricted to only enabled counties, please review in admin, Countries/Zones to determine if UK is 'enabled'. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.