Zen Cart Logo
Forums / All Other Contributions/Addons / One-Page Checkout [Support Thread]

One-Page Checkout [Support Thread]

Views: 629,530

Results 1,761 to 1,780 of 3,078
29 Aug 2020, 9:24 PM
#1761
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

One-Page Checkout [Support Thread]

Jeff_Mash:

Out of curiosity, is there still an issue with Guest Checkout for virtual products? I am trying to work-around the reality of our customers buying a digital download that we sell, but using the guest checkout feature. Since they are purchasing it without an account, it would seem like there is no way to give them the access to the file.

If that's the case, do you know of anyway to PREVENT a customer from checking out as guest IF they have any virtual items in their cart? Perhaps a way to disable guest checkout if they have any products from Category XYZ (where XYZ equals the product category we have for digital items)?
Guest checkout order reviews are via the 'orders_status' page, as reflected in guest-checkout orders' emails.

29 Aug 2020, 9:45 PM
#1762
riomaha avatar

riomaha

New Zenner

Join Date:
Oct 2013
Location:
MTL
Posts:
66
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

One thought came to me but it requires lots of digging unless someone already knows where and what. In one page checkout there is the function that "updates". The function could serve a double purpose to register customer or pre order before confirming the order. or event at the confirm order. Unfortunately, time is something i don't have right now to fiddle with it.

R

30 Aug 2020, 2:05 AM
#1763
riomaha avatar

riomaha

New Zenner

Join Date:
Oct 2013
Location:
MTL
Posts:
66
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

I looked through the code and it seems there isn't a single insert statement or update in the guest checkout, customer info, or confirm order. On the other hand, I found a statement that updates the address or resets it but still no insert statement and yes I looked in the tpl files.

30 Aug 2020, 11:44 AM
#1764
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Within OPC, the *primary *elements that control the database manipulations are the OnePageCheckout.php and ajax/zcAjaxOnePageCheckout.php classe-files.

7 Sep 2020, 6:55 PM
#1765
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Hi Lat9 - I'm not sure if this is a bug or not, but I wanted to report it here.

Do you know of any issues with a customer using your module with a NEGATIVE order total?

Here is what I am seeing.

Customer goes to buy something in our store for $80.25.

We have the Reward Points module, so customer has 81 reward points to apply towards the order. 1 point = $1.00.

Orders new total is -$0.25.

When the Confirm Order button is hit, you are simply taken back to the main checkout_one page.

If you think there is a problem with submitting negative orders, perhaps we can adjust the module so that if order total < 0, than order total = 0.

7 Sep 2020, 7:51 PM
#1767
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Yeah I tried that but no luck. Is there an area in your module code that I should look for in order to initialize the order total back to zero IF the value is a negative number? I was looking in the jquery.checkout_one.js file but didn't see where to change it (even just to test if that would fix the problem).

8 Sep 2020, 10:54 AM
#1768
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Jeff_Mash:

Yeah I tried that but no luck. Is there an area in your module code that I should look for in order to initialize the order total back to zero IF the value is a negative number? I was looking in the jquery.checkout_one.js file but didn't see where to change it (even just to test if that would fix the problem).
I'll come up with a set of instructions that you (and others!) can use to determine what's causing that 'kick-back' from the confirmation page back to the data-collecting one.

It's normally some session value that's different between the session-state on entry to the confirmation page and that 'state' after going through the order's final checks (i.e. interrogating the shipping, payment and order-total modules).

8 Sep 2020, 10:57 AM
#1769
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Jeff, after ***actually *reading your post (I was seeing that the Reward Points' contribution to the order was a negative value), I'll need to review whether OPC 'cares' that the order's value is negative.

8 Sep 2020, 6:18 PM
#1770
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

I'll come up with a set of instructions that you (and others!) can use to determine what's causing that 'kick-back' from the confirmation page back to the data-collecting one.

I think that would be an EXCELLENT addition to your already excellent module! Can't wait to see it and try it out.

lat9:

Jeff, after ***actually *reading your post (I was seeing that the Reward Points' contribution to the order was a negative value), I'll need to review whether OPC 'cares' that the order's value is negative.

Okay, I will wait to hear back from you. I just assumed it was your module spitting it back because it isn't liking "something" from the values being submitted to it. I did confirm that the issue (regardless of which module is causing it) is definitely with the negative value. If I submit the order without a negative value, it goes through the OPC confirmation just fine.

Granted, the situation I describe isn't very common (but does happen from time to time). Since reward points are always in whole round numbers, they usually will create some kind of negative order_total when applied fully to an order. And normal non-OPC checkout handles it fine........meaning the order gets submitted with a negative number. If I can help test anything out for you, please let me know.

8 Sep 2020, 6:28 PM
#1771
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Jeff, see your Private Messages.

28 Sep 2020, 2:25 PM
#1772
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

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?

28 Sep 2020, 3:03 PM
#1773
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Simon, have you applied all the zc157 bugfixes? Does OPC generate a customer-specific log for the situation?

28 Sep 2020, 3:24 PM
#1774
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

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:

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}
30 Sep 2020, 3:08 AM
#1777
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

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?

30 Sep 2020, 5:53 AM
#1778
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

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.

30 Sep 2020, 10:54 AM
#1779
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

@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.

1 Oct 2020, 5:00 AM
#1780
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

@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!