greasemonkey Posted January 21, 2018 Share Posted January 21, 2018 On 2018-01-19 at 8:32 AM, luvubeauty said: I am having issues with the Small Packet Air showing up in the shipping quotes when someone goes to checkout. I do have insurance turned off and CP tech support is useless, so here I am. I saw that there were the same issues, but I tried the suggested and still didn't work. Any other suggestions? Why not just “dis-allow” the service in the modules configuration? (side note: I believe the insurance issue was related to the Tracked Package service) Quote Link to comment Share on other sites More sharing options...
luvubeauty Posted January 22, 2018 Share Posted January 22, 2018 On 1/21/2018 at 8:05 AM, greasemonkey said: Why not just “dis-allow” the service in the modules configuration? (side note: I believe the insurance issue was related to the Tracked Package service) The small packet is extremely cheaper than tracked package and am positive I am loosing sales because the shipping to the US is so high (tracked package is $25 and small packet is $9). When it is calling for quotes, it just isn't returning a quote for Small Packet, all other options are available. Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted January 22, 2018 Share Posted January 22, 2018 @luvubeauty just so I understand.... Small Packet is “not” showing up? And you have it allowed in the config? Can you tell me the weight of one of you items? Small Packet Air (and tracked package) has a max of 1 kg. Quote Link to comment Share on other sites More sharing options...
luvubeauty Posted January 22, 2018 Share Posted January 22, 2018 Yes, correct. I have the weight all under 1kg, I tried with a few different items (individually) and each weigh under a lbs. Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted January 22, 2018 Share Posted January 22, 2018 51 minutes ago, luvubeauty said: Yes, correct. I have the weight all under 1kg, I tried with a few different items (individually) and each weigh under a lbs. in includes/modules/shipping/canadapost.php Find return $xmlRequest; And just above "as a test" add echo $weight; What is the weight printed to the screen? Quote Link to comment Share on other sites More sharing options...
luvubeauty Posted January 22, 2018 Share Posted January 22, 2018 There isn't a weight showing? It would show with the quotes correct? Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted January 22, 2018 Share Posted January 22, 2018 (edited) It would show before everything - most likely in the top left corner. As an weird, out of place number Edited January 22, 2018 by greasemonkey * Quote Link to comment Share on other sites More sharing options...
luvubeauty Posted January 23, 2018 Share Posted January 23, 2018 It's showing as 1.364 Not sure why because I have the weight at zero, then I changed it to .1 and it is still showing the same. Sooo...somewhere down the line it isn't allowing for the weight change? Quote Link to comment Share on other sites More sharing options...
luvubeauty Posted January 23, 2018 Share Posted January 23, 2018 However, it is set for lbs, not kg so it still should be ok? It does change the weight when I go higher, just not lower and it does convert when I change it to KG instead of LBS Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted January 23, 2018 Share Posted January 23, 2018 36 minutes ago, luvubeauty said: It's showing as 1.364 Not sure why because I have the weight at zero, then I changed it to .1 and it is still showing the same. Sooo...somewhere down the line it isn't allowing for the weight change? Yes, small packet air will not show with a weight of 1.364.... (has a max of 1.0 kg - see below note about lbs/kg) Double check in your admin -> Configurations -> Shipping/Packaging -> Package Tare Weight.... Should be blank or 0. 36 minutes ago, luvubeauty said: However, it is set for lbs, not kg so it still should be ok? It does change the weight when I go higher, just not lower and it does convert when I change it to KG instead of LBS If I recall the lbs/kg config in the current version did not work (and cannot work - as Canada Post only accepts kg... so no matter the number sent CP see's it as kg). I had been working on a new version to fix a bunch of other bugs where I have removed lbs as an option. Please confirm (once you have checked the tare weight): edit one product from your store to a weight of 1 - then add that same item to your cart (so it is the only item in your cart) and navigate to checkout_shipping.php. What number shows when you "echo" the weight (still 1.364)? Triple check by changing config in shipping module from lbs to kg. Quote Link to comment Share on other sites More sharing options...
luvubeauty Posted January 23, 2018 Share Posted January 23, 2018 You are amazing! All options have come up! Weight showed up as 0.45, which would be the conversion to KG from lbs (I have it as 0.10 in the product page). Is there a way to have the cheapest option on top? Quote Link to comment Share on other sites More sharing options...
waheed146 Posted February 23, 2018 Share Posted February 23, 2018 On 7/5/2014 at 6:24 AM, RS Designs said: Hello, I am also getting the same error as "simple190" It is happening in the checkout when try to show sipping options. Also is there any way to make it print out the error code it is getting? I am running this on Version: 2.3.3.4 Thanks, I can fix it Quote Link to comment Share on other sites More sharing options...
Druid6900 Posted November 2, 2019 Share Posted November 2, 2019 @greasemonkey Here we go again....Do we know if this package will work in Phoenix (1.0.3.0)? Quote No Good Deed EVER Goes Unpunished Link to comment Share on other sites More sharing options...
greasemonkey Posted November 2, 2019 Share Posted November 2, 2019 7 hours ago, Druid6900 said: @greasemonkey Here we go again....Do we know if this package will work in Phoenix (1.0.3.0)? I haven’t tested it... give it a try and report back. Quote Link to comment Share on other sites More sharing options...
Druid6900 Posted November 2, 2019 Share Posted November 2, 2019 Yeah, I'll do that. I'm just playing with Phoenix in (what little) spare time I have. I haven't decided if it's going to be worth the trouble, but, I suppose this will be a good first test.... Quote No Good Deed EVER Goes Unpunished Link to comment Share on other sites More sharing options...
tacman Posted November 27, 2019 Share Posted November 27, 2019 I'm looking for help in implementing this module in version 2.2. Is there anyone in the Toronto area that can do this? Quote Link to comment Share on other sites More sharing options...
Druid6900 Posted November 27, 2019 Share Posted November 27, 2019 Well, I'm in Hamilton, and I was one of the people that helped keep this going, way back when. but 2.2 is a long time ago. You might be better upgrading your database through a number of versions (there are scripts) to something like 2.3.3.4 BS reactive and install GreaseMonkey's latest iteration. That's what I'm running on my shop and I started with 2.2 and cranked it up through the versions just as I mentioned above. Quote No Good Deed EVER Goes Unpunished Link to comment Share on other sites More sharing options...
greasemonkey Posted November 28, 2019 Share Posted November 28, 2019 Working on updating this for Phoenix - and I'm having one issue (which I believe I've confused with a similar issue on the UPS XML thread) Thank you @azpro and @ecartz for your help... and sorry if I caused any additional confusion... The issue I'm having is when "disallowing" a shipping service I'm receiving the following error: Quote Warning: constant(): Couldn't find constant CANADA_POST_Array in /home/********/public_html/*********/includes/modules/shipping/canadapost.php on line 452 Disallow array is built here: tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Disallowed Shipping Methods', 'MODULE_SHIPPING_CANADA_POST_TYPES', '', 'Select the Canada Post services <span style=\'color: red; font-weight: bold\'>not</span> to be offered.', '6', '12', 'get_multioption_canadapost_xml', 'canadapost_cfg_select_multioption(array(\'D.RP\',\'D.EP\',\'D.XP\',\'D.XP.CERT\',\'D.PC\',\'D.LIB\',\'U.EP\',\'U.PW.ENV\',\'U.PW.PAK\',\'U.PW.PARCEL\',\'U.SP.AIR\',\'U.SP.SURF\',\'U.XP\',\'I.XP\',\'I.IP.AIR\',\'I.IP.SURF\',\'I.PW.ENV\', \'I.PW.PAK\',\'I.PW.PARCEL\',\'I.SP.AIR\',\'I.SP.SURF\'),', now())"); With this function: function canadapost_cfg_select_multioption($select_array, $key_value, $key = '') { for ($i=0; $i<sizeof($select_array); $i++) { $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value'); $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"'; $key_values = explode( ", ", $key_value); if ( in_array($select_array[$i], $key_values) ) $string .= ' checked="checked"'; $string .= '> ' . constant('CANADA_POST_' . get_canada_post_service_code($select_array[$i])); } $string .= '<input type="hidden" name="' . $name . '" value="--none--">'; return $string; } It would seem the result of the function = Array ... Inputting "Array" into the DB as the "disallowed" service (in place of the service code) .... hence why it cannot find the constant.... As a test, I can manually remove Array from the DB and replace it with any (multiple service codes) and it works perfectly. I have no issues on Gold, Edge/Frozen... I've attached a screen cap.... Quote Link to comment Share on other sites More sharing options...
Druid6900 Posted November 28, 2019 Share Posted November 28, 2019 @greasemonkey You think it might work better if it was set up to disallow everything as default and then add the ones you want to use? Quote No Good Deed EVER Goes Unpunished Link to comment Share on other sites More sharing options...
greasemonkey Posted November 29, 2019 Share Posted November 29, 2019 On 11/28/2019 at 9:16 AM, Druid6900 said: @greasemonkey You think it might work better if it was set up to disallow everything as default and then add the ones you want to use? I've figured out the issue - just not sure how to fix it yet... Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted November 29, 2019 Share Posted November 29, 2019 So coders, assuming I'm correct (in my testing I am...lol). How do we take the add to admin/modules.php if (is_array($value) ) { $value = implode( ", ", $value); $value = preg_replace ("/, --none--/", "", $value); } And incorporate it with the the actual shipping modules set function (in my very limited skill - the set function is building an array, which when saved, modules.php with the additional code above, is imploding the or replacing (???) the array before inserting into the configuration value) function upsxml_cfg_select_multioption($select_array, $key_value, $key = '') { $string = ''; $key_values = explode( ", ", $key_value); for ($i=0, $n=sizeof($select_array); $i<$n; $i++) { $name = ((tep_not_null($key)) ? 'configuration[' . $key . '][]' : 'configuration_value'); $string .= '<br /><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"'; if (in_array($select_array[$i], $key_values)) $string .= ' CHECKED'; $string .= '> ' . $select_array[$i]; } return $string; } Sorry for the cross post mods.... I was trying to keep this in one place but messed up.... Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted November 29, 2019 Share Posted November 29, 2019 (edited) What the set_function does is it creates the form input that you use to edit it. In this case, a bunch of checkboxes. That is then saved in admin/modules.php . It's the save case towards the top of the file. Try changing it to look like case 'save': foreach ($_POST['configuration'] as $key => $value) { if (isset($value) && is_array($value)) { implode(', ', $value); $value = str_replace(', --none--', '', $value); } tep_db_query("update configuration set configuration_value = '" . tep_db_input(tep_db_prepare_input($value)) . "' where configuration_key = '" . tep_db_input(tep_db_prepare_input($key)) . "'"); } tep_redirect(tep_href_link('modules.php', 'set=' . $set . '&module=' . $_GET['module'])); break; case 'install': case 'remove': Expect this to change in a future version of Phoenix. Sorry, I was getting distracted by the fact that this section of code has not significantly changed in a long time. If the problem is that other Apps were changing admin/modules.php to add this code, then that makes a lot more sense. Edited November 29, 2019 by ecartz Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
cinolas Posted February 4, 2021 Share Posted February 4, 2021 @greasemonkey I'm having the same problem with the CanadaPost module not accepting the disallowed services, and storing 'array' in the DB instead.... I don't mind entering the disallowed services into the DB manually (unless there's an easy fix) but I can't figure out the proper format for the multiple choices. Specifically I entered those 2 services I need to disallow: I.IP.SURF, I.SP.SURF But when I look at the web interface it only seems to recognize Small Packet International Surface and not I.I P.SURF as "International Parcel Surface". Maybe it's not the format but the code... Is there a different code for that service now? Cheers! Quote Link to comment Share on other sites More sharing options...
cinolas Posted February 4, 2021 Share Posted February 4, 2021 Never mind got it: I.IP.SURF,I.SP.SURF No space.... 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.