zeeshop Posted December 26, 2020 Share Posted December 26, 2020 (edited) HI, @raiwa I installed this module (Ship In Cart 5.2 CE Phoenix) on Phoenix v1.0.7.12 (PHP 7.4.13) following the installation instructions, however there is one issue, when customer is not logged in (guest customer) on adding the product it goes to https://mysite.com//shopping_cart.php?ceid=57c6602bba76b4b4181caf6e61fed327, on a blank page with error This page isn’t working mysite.uk is currently unable to handle this request. HTTP ERROR 500 But When customer is logged in, there is not issue, all works well. Please advise how to fix this error. Thanks Edited December 26, 2020 by zeeshop Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted December 26, 2020 Share Posted December 26, 2020 Hi @zeeshop, Ship in cart requires an update for 1.0.7.12+ which will probably come for the 1.0.8.0 release. I recommend you to stick with 1.0.7.11 for now, other apps will probably also break. Merry christmas Rainer Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
zeeshop Posted December 26, 2020 Share Posted December 26, 2020 (edited) Thanks, Seasonal Greetings. Unable to go back to previous version. I will wait for your update for 1.0.7.12 +. Till then I will keep it disable. Edited December 26, 2020 by zeeshop Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted December 26, 2020 Share Posted December 26, 2020 Just now, zeeshop said: Thanks, unable to go back to previous version. I will wait for your update for 1.0.7.12 +. Till then I will keep it disable. You should always: - have a backup to be able to roll back - test an update on a separate sandbox store before updateing a live store zeeshop 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted December 26, 2020 Share Posted December 26, 2020 @zeeshop, Hotfix for Phoenix 1.0.7.12: In includes/modules/content/cm_sc_shipping.php line 64 add this: public function get_country_id() { return null; } public function get_zone_id() { return null; } so the whole snippet should look like this: if (!isset($GLOBALS['customer'])) { $GLOBALS['customer'] = new class { public function fetch_to_address($to = null) { return []; } public function get($key, $to = 0) { return null; } public function get_default_address_id() { return null; } public function get_country_id() { return null; } public function get_zone_id() { return null; } }; } or just use this file: cm_sc_shipping.php However there may appear other issues. zeeshop 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
zeeshop Posted December 26, 2020 Share Posted December 26, 2020 Thanks very much @raiwa, this fixed the issue on my Phoenix 1.0.7.12. Regards Quote Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 25, 2021 Share Posted January 25, 2021 No sure if this is because of version 0.13. I get the following errors Notice: Undefined index: subtotal in includes/modules/shipping/zipcanadapost.php on line 59 Notice: Undefined index: state in includes/modules/shipping/zipcanadapost.php on line 402 Notice: Undefined index: city in includes/modules/shipping/zipcanadapost.php on line 409 Notice: Undefined index: subtotal in includes/modules/shipping/zipcanadapost.php on line 374 Notice: Undefined index: customer_id in includes/modules/shipping/zipcanadapost.php on line 260 Error Code: Server Error Msg: /rs/ship/price: cvc-simple-type 1: element {http://www.canadapost.ca/ws/ship/rate}postal-code of type {http://www.canadapost.ca/ws/ship/rate}PostalCodeType may not be empty Warning: Invalid argument supplied for foreach() in includes/system/versioned/1.0.7.4/shipping.php on line 99 So it looks like its trying to get/use info before it's even been submitted After i entered the required info, it still complains about missing vars Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted January 25, 2021 Share Posted January 25, 2021 Subtotal: You need to have the order totals module installed. I checked and $order->info[subtotal] is set. State and Postal code gets set when the update button is submitted. You may add a text to make it more clear. City is not available for guests/not logged in users. Not sure why it is needed. Postal code should be enough to retrieve a quote. I you get a quote retrieved without it, just ignore the notice error. customer_id has already been discussed in the other thread. All notice errors can be ignored/supressed output or catched/checked if they are set in the shipping module. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted January 25, 2021 Share Posted January 25, 2021 @gsmiley007, Please confirm that you need the city input. I'll then consider it to be added in the next update. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 25, 2021 Share Posted January 25, 2021 Hi raiwa, @zipurman was kinda of enough to help me troubleshoot his shipping module with your in cart module. this is what he said: The issue with the errors is that the $order object should have those indexes. If another addon changes the values in the $order object, then all things after that wont work. I can only guess as to what is happening there, but something you are using is changing the $order object. The $order->info['subtotal'] is required for the value of the order, which is needed for insurance. The $order->delivery['city'] is required for calculating the destination. Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted January 25, 2021 Share Posted January 25, 2021 (edited) Hi Guy @gsmiley007, It's not that ship in cart changes the core $order object. Ship in cart creates the $order object already in the shopping cart where core doesn't have it created yet. Once the customer logs in, all indexes are correct created and there is no problem at all. The problem you report appears because ship in cart creates the $order object for not logged in customers with a minimum of indexes to show shipping costs. It works perfect for most shipping modules, but of course, if a specific shipping module requires additional indexes, they must be created specifically for this shipping module, I had a deeper look and yes, the $order->info['subtotal'] index is not available yet for the shipping modules, because the order total module loads after the ship in cart module. You can fix it using $_SESSION[cart]->show_total() instead of $order->info['subtotal'] if it is not set. Please ask @zipurman if he can do it and test it for you. Other shipping modules (fedex for example) use also $_SESSION[cart]->show_total(). There may appear also incompatibilities with other addons like the admin order editor. I have no canadapost account and can't test it. But something like this should do it: line 59 change to: 'total_value' => (isset($order->info['subtotal'])? number_format( ceil( $order->info['subtotal'] ), 2, '.', '' ) : number_format( ceil( $_SESSION[cart]->show_total() ), 2, '.', '' )), Or wait for the next update, I can then set $order->info['subtotal'] like this in the ship in cart module. For the city input, please wait a couple of days for the next update, I'll add it for you. best regards Rainer Edited January 25, 2021 by raiwa Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted January 25, 2021 Share Posted January 25, 2021 Hi @gsmiley007, @zipurman, Working on the ship in cart update I found that an error was introduced in one of the last updates. $GLOBALS['cart'] is wrong, it should be $_SESSION['cart']. Thats why $order->info[subtotal] is not set in the shipping modules, even it is set in the ship in cart module. To fix it, just replace for now in cm_sc_shipping.php all instances of $GLOBALS['cart'] with $_SESSION['cart']. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
zipurman Posted January 25, 2021 Share Posted January 25, 2021 @gsmiley007, @raiwa I have updated the Canada Post (2.1.1) Mod here: https://phoenixaddons.com/knowledgebase/canada-post-rest-module/ The 'city' is not required for this mod, but I have been keeping all of my shipping mods the same so it is required by others. For now, I have adjusted so the code is skipping 'city' if it is not defined. I also have it loading the $_SESSION['cart']->show_total() if the $order->info['subtotal'] is not defined. Hope that helps. Zip raiwa 1 Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted January 25, 2021 Share Posted January 25, 2021 (edited) @gsmiley007, Here is the updated cm_sc_shipping.php : cm_sc_shipping.php you need to uninstall/reinstall the module. city and subtotal are now available in the shipping modules. Please try and let me know .I'll then upload tomorrow the updated package. Edited January 25, 2021 by raiwa zipurman 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 26, 2021 Share Posted January 26, 2021 @raiwa Stupid question, but do i replace both cm_sc_shipping.php with the one you provided me? ./includes/modules/content/shopping_cart/cm_sc_shipping.php ./includes/languages/english/modules/content/shopping_cart/cm_sc_shipping.php Quote Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 26, 2021 Share Posted January 26, 2021 NVM, i figured it out, it's just the modules/content dir I still get errors, also now the drop downs are missing. Also does this module require a user login before the shipping quotes are shown? Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted January 26, 2021 Share Posted January 26, 2021 (edited) 6 hours ago, gsmiley007 said: @raiwa Stupid question, but do i replace both cm_sc_shipping.php with the one you provided me? ./includes/modules/content/shopping_cart/cm_sc_shipping.php ./includes/languages/english/modules/content/shopping_cart/cm_sc_shipping.php only: ./includes/modules/content/shopping_cart/cm_sc_shipping.php the other language file is different, just open both and you'll see. Please use the below new version and follow the update instructions. You need to switch on state, zip and city in the settings. To show a quote on first time page load, fill in a default zip and city. The customer_id error must be addressed in the canadapost shipping module. @zipurman did it i the newest version 2.1.1. Make sure you are using that one. Quote Also does this module require a user login before the shipping quotes are shown? If all the required fields are filled in, it shows the quote without login. Edited January 26, 2021 by raiwa zipurman 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted January 26, 2021 Share Posted January 26, 2021 Uploaded: Ship In Cart Phoenix 5.3 Compatibility: OsC CE Phoenix 1.0.5.1+ Tested with Phoenix 1.0.7.13/1.0.7.14 pre release PHP: 7.0 - 7.4 Changes Vers. 5.3: - Added optional City input required for some shipping modules. - Fixed wrong cart global to session. - tested with Phoenix 1.0.7.13 and 1.0.7.14 pre release. valquiria23 and zipurman 2 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 27, 2021 Share Posted January 27, 2021 Installed the new version - still having issues. I think you are missing a default state/province Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted January 27, 2021 Share Posted January 27, 2021 Hi @gsmiley007. The store country and store zone is used by default. This is the order object available in the shipping modules on first time load: order Object ( [info] => Array ( [subtotal] => 8.99 [total] => 8.99 [currency] => USD [currency_value] => 1.00000000 ) [totals] => Array ( ) [products] => Array ( [0] => Array ( [qty] => 1 [name] => Grapefruit [model] => GPF-1 [price] => 8.9900 [final_price] => 8.99 [weight] => 0.40 [id] => 8 [tax] => 0 [tax_description] => Unknown tax rate ) ) [customer] => Array ( ) [delivery] => Array ( [postcode] => 75203 [city] => Sant Iscle [country] => Array ( [id] => 223 [title] => United States [iso_code_2] => US [iso_code_3] => USA ) [country_id] => 223 [format_id] => 2 [zone_id] => 18 ) [billing] => Array ( ) [content_type] => physical [id] => ) As you can see $order->delivery['country']['id'] and $order->delivery['zone_id'] is set. I believe zone code or name should be retrieved in the shipping module. Other shipping modules are doing this. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted January 27, 2021 Share Posted January 27, 2021 If it is not possible/doable to retrieve the state in the canada shipping module, try this version which sets it also on first time load: cm_sc_shipping.php Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted January 27, 2021 Share Posted January 27, 2021 @gsmiley007, Please use this version. In the other version above I forgot to remove a debug line and I cleaned up some code: cm_sc_shipping.php Please report back, and I'll upload the updated package. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 27, 2021 Share Posted January 27, 2021 It's working much better. I don't get any errors for canada/us shipping quotes. When I tried international quotes, give me customer id error and no shipping quote. I've asked @zipurman about this error: Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted January 27, 2021 Share Posted January 27, 2021 Seems your postcode is wrong grouped. Try: E1 6AN Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 28, 2021 Share Posted January 28, 2021 Bug was in the canada post shipping module, but @zipurman fixed. So looks all good now. Thanks @raiwa and @zipurman for all the help in fixing this issue. zipurman and raiwa 2 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.