Jeff, see your Private Messages.
ZC v1.57
PHP v7.2.10
OPC v2.3.4
CEON
DPU
SBA
Quantity Discounts
CSS_JS Loader
IH5
Colorbox
Structured Data
Upgraded an existing ZC v1.56c site to ZC v1.57 and I'm have difficulty debugging this issue:
Checking out as a guest I'm successfully directed to the OPC checkout_one page and all's well. But checking out as a logged in customer I'm taken to Step 1 (checkout_shipping) page - it's as if OPC is not kicking in (unlike in ZC v1.56c w/OPC v2.3.4). There are no errors in the browser console (I'm not loading OPC minified script files) or logs directory.
Any ideas where I would start looking?
Simon
Simon, have you applied all the zc157 bugfixes? Does OPC generate a customer-specific log for the situation?
Yes it just occurred to me to check the ZC v157 bug fixes, I thought I could get away with waiting until ZC v1.57a was released. I'll apply those, try again and then post a customer log if neccessary - thank you. In the meantime the customer log generated in this instance is:
Code:2020-09-28 16:16:24 OnePageCheckout: updateOrderAddresses, on entry:order::__set_state(array( 'orderId' => NULL, 'info' => array ( 'order_status' => '1', 'currency' => 'GBP', 'currency_value' => '1.000000', 'payment_method' => '', 'payment_module_code' => '', 'coupon_code' => '', 'shipping_method' => 'Standard Delivery (No Charge)', 'shipping_module_code' => 'flat_flat', 'shipping_cost' => 0, 'subtotal' => 0, 'shipping_tax' => 0, 'tax' => 0, 'total' => 0, 'tax_groups' => array ( ), 'comments' => '', 'ip_address' => '127.0.0.1 - 127.0.0.1', ), 'totals' => array ( ), 'products' => array ( ), 'customer' => array ( 'firstname' => 'Simon', 'lastname' => '[hidden]', 'company' => NULL, 'street_address' => '[hidden]', 'suburb' => '', 'city' => '[hidden]', 'postcode' => '[hidden]', 'state' => '[hidden]', 'state_code' => NULL, 'zone_id' => '0', 'country' => array ( 'id' => '222', 'title' => 'United Kingdom', 'iso_code_2' => 'GB', 'iso_code_3' => 'GBR', ), 'format_id' => 8, 'telephone' => '[hidden]', 'email_address' => '[hidden]', ), 'delivery' => array ( 'firstname' => 'Simon', 'lastname' => '[hidden]', 'company' => NULL, 'street_address' => '[hidden]', 'suburb' => '', 'city' => '[hidden]', 'postcode' => '[hidden]', 'state' => '[hidden]', 'state_code' => NULL, 'zone_id' => '0', 'country' => array ( 'id' => '222', 'title' => 'United Kingdom', 'iso_code_2' => 'GB', 'iso_code_3' => 'GBR', ), 'country_id' => '222', 'format_id' => 8, ), 'billing' => NULL, 'content_type' => 'physical', 'email_low_stock' => NULL, 'products_ordered_attributes' => NULL, 'products_ordered' => NULL, 'products_ordered_email' => NULL, 'products_ordered_html' => NULL, 'attachArray' => NULL, 'email_order_message' => NULL, 'extra_header_text' => NULL, 'doStockDecrement' => NULL, 'send_low_stock_emails' => NULL, 'queryReturnFlag' => NULL, 'bestSellersUpdate' => NULL, 'use_external_tax_handler_only' => NULL, 'products_ordered_attributes_html' => array ( ), 'observerAliases' => array ( 'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE', ), ))OnePageCheckout::__set_state(array( 'isGuestCheckoutEnabled' => true, 'registeredAccounts' => false, 'guestIsActive' => false, 'isEnabled' => true, 'tempAddressValues' => NULL, 'guestCustomerInfo' => NULL, 'guestCustomerId' => 51, 'tempBilltoAddressBookId' => 68, 'tempSendtoAddressBookId' => 69, 'dbStringType' => 'stringIgnoreNull', 'customerInfoOk' => NULL, 'billtoTempAddrOk' => NULL, 'sendtoTempAddrOk' => NULL, 'isVirtualOrder' => NULL, 'billtoAddressChangeable' => NULL, 'sendtoAddressChangeable' => NULL, 'observerAliases' => array ( 'NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE' => 'NOTIFY_ORDER_CART_SUBTOTAL_CALCULATE', ), )) 2020-09-28 16:16:24 OnePageCheckout: Current sendto: 107 2020-09-28 16:16:24 OnePageCheckout: updateOrderAddresses, , , 222, 0 {"firstname":"Simon","lastname":"[hidden]","company":null,"street_address":"[hidden]","suburb":"","city":"[hidden]","postcode":"[hidden]","state":"[hidden]","state_code":null,"zone_id":"0","country":{"id":"222","title":"United Kingdom","iso_code_2":"GB","iso_code_3":"GBR"},"format_id":8,"telephone":"[hidden]","email_address":"[hidden]"} null {"firstname":"Simon","lastname":"[hidden]","company":null,"street_address":"[hidden]","suburb":"","city":"[hidden]","postcode":"[hidden]","state":"[hidden]","state_code":null,"zone_id":"0","country":{"id":"222","title":"United Kingdom","iso_code_2":"GB","iso_code_3":"GBR"},"country_id":"222","format_id":8}
Simon
The bug-fix that most likely is "getting you" is in post#8 of that bugfix thread (https://www.zen-cart.com/showthread....v1-5-7-series).
This was the bugfix that needed to be applied - Re: 157: plugins watching shared notifiers may not all trigger properly , I should have paid more attention to that thread.
Last edited by simon1066; 28 Sep 2020 at 05:18 PM. Reason: 'SNAP'
Simon
Hello,
I am finally finding time to work further on trying to add support for Japanese (some issues with zones, as well as adding language and hiragana fields) to OPC.
I have had to disable OPC because while it worked beautifully for guest checkout and registrations, it gave an error when trying to add addresses, since my shop's user creation and address book registration/changing code has been modified to support the needs of users here in Japan (selecting a language for the address, so that users can register an address in either English or Japanese, and then fields for hiragana name/surname as appropriate, plus multilanguage zone and country support).
I am working now using the code of OPC 2.3.4.
I suspect most of my work will be limited to editing files in includes/modules/pages/checkout_one/, with no changes needed in modules/pages/create_account/ unless I want to change the default population of an account.
I understand I will need to change the function "saveAddressValues" in the file jquery.checkout_one.js. This seems fairly simple.
However, in the file jquery.checkout_one_addr.js there is mention of an array "z2c" in function "updateCountryZone", but I cannot find this anywhere.
Apparently it is supposed to be supplied by jscript_main.php, but there is no mention of it there. I definitely need to edit the creation of this array. Can anyone point out where I may find it?
Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.0.1.
Sorry, meant to write "c2z", not "z2c". Still, cannot find the array anywhere.
Apart from the page files above, most of the work will be in includes/classes/OnePageCheckout.php to add Japanese address requirements (language choice for address, hiragana support in new name fields, and multilanguage country and zone support). In standard Zen Cart this is done in the PHP and the JavaScript files (for real-time zone updates when country or language selection changes, so one more level added: address language change also changes display of country and zones).
Plus then adding new fields to the various template files, just like in standard Zen Cart.
Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.0.1.
@gernot, that c2z (country-to-zone) lookup table is generated by the OnePageCheckout class' getCountriesZonesJavascript method (as called by /includes/modules/pages/checkout_one/jscript_main.php) when state dropdowns are enabled for a site.
I'll suggest, if you're planning on "tinkering" with OPC's innards (i.e. /includes/classes/OnePageCheckout.php) that you create a Japanese version that uses class-inheritance so that you override only what's needed. That will save you a 'world-of-hurts' if/when that class is updated in the future.
That class is loaded at CP-0 and instantiated into the session at CP-75 by its auto_loader. If your class-override was loaded at CP-1 (so that it can extend OnePageCheckout) and instantiated into the session at CP-74, then the base OPC class will not be loaded, since it checks for instantiation prior to its load.
@lat9
Many thanks for the pointer, I saw the function in the class file, not sure why search for c2z in Windows did not show me that file. I know I need to modify many of the functions in the class, and was only too aware of the world of hurts you speak of (and which I have at each Zen Cart upgrade too).
I will play with the auto_loader method, although I need to first figure out class inheritance, and the implementation of loading and instantiation. All good basic study for further work on Zen Cart!
Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.0.1.
Bookmarks