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

One-Page Checkout [Support Thread]

Views: 629,549

Results 1,621 to 1,640 of 3,078
11 May 2020, 7:24 PM
#1621
gernot avatar

gernot

Zen Follower

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

One-Page Checkout [Support Thread]

I've just tested OPC guest checkouts on my testshop with Paypal express, and with Square (creating a new App for the testshop), works wonderfully.
I have a question about the Paypal setup though, could not find any mention of this in the documentation.
For standard 3-page checkout processing, the Paypal return URL is supposed (I think) to be set to:
https://www.mysite.com/MY_SHOP/index.php?main_page=checkout_process
For OPC, is this supposed to be kept as is, or better changed to something specific to OPC?

11 May 2020, 7:50 PM
#1622
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

gernot:

I've just tested OPC guest checkouts on my testshop with Paypal express, and with Square (creating a new App for the testshop), works wonderfully.
I have a question about the Paypal setup though, could not find any mention of this in the documentation.
For standard 3-page checkout processing, the Paypal return URL is supposed (I think) to be set to:
https://www.mysite.com/MY_SHOP/index.php?main_page=checkout_process
For OPC, is this supposed to be kept as is, or better changed to something specific to OPC?
For OPC, it's to be kept as-is.

OPC provides a combination of the checkout_shipping, checkout_payment and checkout_confirmation pages. The actual order-processing remains the same.

12 May 2020, 1:02 AM
#1623
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

lat9:

For OPC, it's to be kept as-is.

OPC provides a combination of the checkout_shipping, checkout_payment and checkout_confirmation pages. The actual order-processing remains the same.

Thank you very much indeed!

25 May 2020, 7:48 PM
#1624
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

I've just submitted v2.3.2 of One-Page Checkout to the Zen Cart moderators for review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#251: Missing #otshipping in zc157.
#252: Guest Checkout, status-update emails still refer to account_history_info.
#253: Changes to a customer's address aren't recorded.
#254: Correct PHP warning if a store's "Gender" changes from not-required to required.
#255: Ensure that the "Add to Address Book" checkbox's visibility is correctly updated.
#256: Address-entry, account for browser autofill and always use a state dropdown if the country has zones.

Note: This version has been validated with the upcoming Zen Cart 1.5.7-alpha release.

26 May 2020, 11:35 AM
#1625
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

lat9:

I've just submitted v2.3.2 of One-Page Checkout to the Zen Cart moderators for review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#251: Missing #otshipping in zc157.
#252: Guest Checkout, status-update emails still refer to account_history_info.
#253: Changes to a customer's address aren't recorded.
#254: Correct PHP warning if a store's "Gender" changes from not-required to required.
#255: Ensure that the "Add to Address Book" checkbox's visibility is correctly updated.
#256: Address-entry, account for browser autofill and always use a state dropdown if the country has zones.

Note: This version has been validated with the upcoming Zen Cart 1.5.7-alpha release.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095

26 May 2020, 4:04 PM
#1626
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

Thank you so much! That is a lot of work in there.

27 May 2020, 9:34 AM
#1627
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

The account_create page shows the drop-down for state correctly.
In 2.3.1 the state was not available in the shipping/billing address change screen.
In 2.3.2 the field is now visible as per the changelog, many thanks, but it is not a drop-down for me, probably because I am using multi-language.
I'll see if I can fairly quickly port the jscript functions and template changes from the standard 3-page checkout, and report back.

27 May 2020, 11:35 AM
#1628
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

gernot:

The account_create page shows the drop-down for state correctly.
In 2.3.1 the state was not available in the shipping/billing address change screen.
In 2.3.2 the field is now visible as per the changelog, many thanks, but it is not a drop-down for me, probably because I am using multi-language.
I'll see if I can fairly quickly port the jscript functions and template changes from the standard 3-page checkout, and report back.
@gernot, what's your store's setting for that Customers::Always display state as dropdown value?

27 May 2020, 12:16 PM
#1629
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

Hi lat9, it is set to true.
Configuration -> Customer Details -> State - Always display as pulldown? -> true
I have jscript on the create_account and all other address_book related pages to handle the English and Japanese with multilanguage, converting the codes to the corresponding language text (since in Zen Cart the state code use is as far as I am concerned a bug).

In OPC it seems like create_account is used the same as the original Zen Cart page, so my customizations work, but when it comes to editing addresses in the one_page_checkout page with the tpl_modules_{billing,shipping}_address template I presume the code is not available.
I'll have to check exactly what page the standard flow uses there and see what changes I have there.
I do not get any error either though, so there is no conflict as far as I can tell.

27 May 2020, 12:37 PM
#1630
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

gernot:

Hi lat9, it is set to true.
Configuration -> Customer Details -> State - Always display as pulldown? -> true
I have jscript on the create_account and all other address_book related pages to handle the English and Japanese with multilanguage, converting the codes to the corresponding language text (since in Zen Cart the state code use is as far as I am concerned a bug).

In OPC it seems like create_account is used the same as the original Zen Cart page, so my customizations work, but when it comes to editing addresses in the one_page_checkout page with the tpl_modules_{billing,shipping}_address template I presume the code is not available.
I'll have to check exactly what page the standard flow uses there and see what changes I have there.
I do not get any error either though, so there is no conflict as far as I can tell.
For the country/zones in the OPC address-edits, there's a json_encoded array created by the *OnePageCheckout *class' *getCountriesZonesJavascript *method that is subsequently used by the jQuery present in /includes/modules/pages/checkout_one/jquery.checkout_one_addr.js:

    
    // -----
    // Creates the json-formatted array that maps countries to zones, for use in the
    // customer address-forms when dropdown states are enabled.
    //
    public function getCountriesZonesJavascript()
    {
        $countries = $GLOBALS['db']->Execute(
            "SELECT DISTINCT zone_country_id
               FROM " . TABLE_ZONES . "
                    INNER JOIN " . TABLE_COUNTRIES . "
                        ON countries_id = zone_country_id
                       AND status = 1
           ORDER BY zone_country_id"
        );
        
        $c2z = array();
        while (!$countries->EOF) {
            $current_country_id = $countries->fields['zone_country_id'];
            $c2z[$current_country_id] = array();

            $states = $GLOBALS['db']->Execute(
                "SELECT zone_name, zone_id
                   FROM " . TABLE_ZONES . "
                  WHERE zone_country_id = $current_country_id
               ORDER BY zone_name"
            );
            while (!$states->EOF) {
                $c2z[$current_country_id][$states->fields['zone_id']] = $states->fields['zone_name'];
                $states->MoveNext();
            }
            $countries->MoveNext();
        }
        
        if (count($c2z) == 0) {
            $output_string = '';
        } else {
            $output_string = 'var c2z = \'' . json_encode($c2z) . '\';' . PHP_EOL;
        }
        return $output_string;
    }

I'd be interested to know what modifications you needed to make to the 'stock' Zen Cart's state-dropdown handling.

27 May 2020, 1:39 PM
#1631
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

Hi lat9,
My understanding is nowhere near yours, so I'd gone and modified to use the original functions as much as possible, giving them modifications for language as needed. I've attached the functions_general.php which is the meat of it all, and one example jscript from the checkout payment page.

The main function called is:
functions/functions_general.php:function zen_js_country_list_default($selectedlanguage, $country, $form, $cfield, $selectedcountry, $showTextField = true, $language='') <- added in attachmend
And it is called in:
modules/pages/login/jscript_addr_pulldowns.php
modules/pages/create_account/jscript_addr_pulldowns.php
modules/pages/address_book_process/jscript_addr_pulldowns.php
modules/pages/checkout_payment_address/jscript_addr_pulldowns.php <- added in attachment
modules/pages/checkout_shipping_address/jscript_addr_pulldowns.php

Multi-language zones is a plugin, using a new table, TABLES_ZONES_NAME, so that would be a major difference I think.
The multi-language zones plugin is currently not official, and when it came out it did not support OPC, so any changes I guess need to be made by myself there.

Apart from that (not sure if countries tables also need changes) I also need to weave in the support for furigana for Japanese users, and the language option to write the address in English or in Japanese format :)

27 May 2020, 2:14 PM
#1632
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Thanks for that, @gernot. I'll give that a look-see later today.

28 May 2020, 5:13 PM
#1633
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

Hi lat9,
In preparation for migrating my changes to OPC, I checked the original Zen Cart and found I had forgotten something.
The checkout_{payment,billing}_address module does not do the work itself, it calls the tpl_modules_checkout_new_address.php template, which has my modifications in it, and where the onChange jscript is called from. I'm attaching that file here.
Since that is a common file (i.e., common to both modules) it made it easy to manage changes (only one template file for any new address changes in ZC).

To be honest, I haven't managed to follow how you do this in OPC, in includes/modules/pages/checkout_one/header_php.php I presume, but it does not look you are calling the generic tpl_modules_checkout_new_address Zen Cart template (unlike like what happens for create_account, for example). Is all the work happening via javascript there?

I wonder if it might be easier in the long run to use the Zen Cart template here, so people could take advantage of whatever standard Zen Cart version upgrades or personal customizations (even if it is only the order of fields, for example) more seamlessly? Perhaps that this might not be viable, with the way the OPC page opens up up a section to enter the address, but I will ask anyway.

28 May 2020, 7:15 PM
#1634
gernot avatar

gernot

Zen Follower

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

Re: One-Page Checkout [Support Thread]

Ah, I found the template used in OPC for the address block formatting:
tpl_modules_opc_address_block.php
So presumably similar changes to the layout made in the Zen Cart tpl_modules_checkout_new_address.php would need to be implemented here.
Javascript would be a related issue to handle, the scripts being different in OPC if I have that right.

28 May 2020, 7:17 PM
#1635
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

gernot:

Hi lat9,
In preparation for migrating my changes to OPC, I checked the original Zen Cart and found I had forgotten something.
The checkout_{payment,billing}_address module does not do the work itself, it calls the tpl_modules_checkout_new_address.php template, which has my modifications in it, and where the onChange jscript is called from. I'm attaching that file here.
Since that is a common file (i.e., common to both modules) it made it easy to manage changes (only one template file for any new address changes in ZC).

To be honest, I haven't managed to follow how you do this in OPC, in includes/modules/pages/checkout_one/header_php.php I presume, but it does not look you are calling the generic tpl_modules_checkout_new_address Zen Cart template (unlike like what happens for create_account, for example). Is all the work happening via javascript there?

I wonder if it might be easier in the long run to use the Zen Cart template here, so people could take advantage of whatever standard Zen Cart version upgrades or personal customizations (even if it is only the order of fields, for example) more seamlessly? Perhaps that this might not be viable, with the way the OPC page opens up up a section to enter the address, but I will ask anyway.
I'd tried, initially, to make use of the built-in Zen Cart formatting for those addresses but it (like OPC, unfortunately) got complicated since OPC renders both the billing and shipping addresses on a single page.

In OPC, those country/state 'associations' are built by the OPC class-method identified in post #1630. Perhaps, to enable additional customizations, I could include a notification in that method to allow your (and others') changes to override the 'base' OPC rendering.

30 May 2020, 11:12 PM
#1636
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I am assuming that this error is related to the fedex rate quote servers taking up to 60 seconds to respond today, followed by an additional 5-10 seconds for the USPS rate quote servers to respond... while, the customer only sees a blank white screen waiting for a response or indication that something is happening.

[30-May-2020 13:05:45 America/Los_Angeles] Request URI: /index.php?main_page=checkout_shipping, IP address: 108.175.192.91
#1  trigger_error() called at [/home/chainwea/public_html/includes/classes/order.php:363]
#2  order->cart() called at [/home/chainwea/public_html/includes/classes/order.php:48]
#3  order->__construct() called at [/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php:74]
#4  require(/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/chainwea/public_html/index.php:36]
--> PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in /home/chainwea/public_html/includes/classes/order.php on line 363.
31 May 2020, 1:16 PM
#1637
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

RixStix:

I am assuming that this error is related to the fedex rate quote servers taking up to 60 seconds to respond today, followed by an additional 5-10 seconds for the USPS rate quote servers to respond... while, the customer only sees a blank white screen waiting for a response or indication that something is happening.

[30-May-2020 13:05:45 America/Los_Angeles] Request URI: /index.php?main_page=checkout_shipping, IP address: 108.175.192.91
#1 trigger_error() called at [/home/chainwea/public_html/includes/classes/order.php:363]
#2 order->cart() called at [/home/chainwea/public_html/includes/classes/order.php:48]
#3 order->__construct() called at [/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php:74]
#4 require(/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/chainwea/public_html/index.php:36]
--> PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in /home/chainwea/public_html/includes/classes/order.php on line 363.

Rick, first that error is coming from the 3-page checkout's 'checkout_shipping' page and second, I don't see such an error in an as-shipped zc156c /includes/classes/order.php.

What additional modifications are present?
31 May 2020, 2:48 PM
#1638
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Rick, first that error is coming from the 3-page checkout's 'checkout_shipping' page and second, I don't see such an error in an as-shipped zc156c /includes/classes/order.php.

What additional modifications are present?

I cannot find a debug file like this prior to installing Dynamic Price Updater and the instances where the file is generated occurs a few moments before the first instance of an OPC logfile. The IP address in the file matches the IP address in the OPC file, so it related to the same customer.

I plan to do a bit more testing after the day gets started around here now that you have pointed me into some direction. There are so many debug warning files generated since updating to 156c that I just tend to ignore all of them until I have reason to look at the specifics.

Other mods (from Mod List)
Flexible Footer
Email Archive Manager
Sitemap XML
OPC
Clone a template
Mod List
DBIO
News Box Manager (to be removed)
SuperData
POSM
OT quantity discount

Shipping
Fedex
USPS
FreeShipper
FreeOptions
Specialty Options (don't remember source)

Payment
Square
Auth.net AIM,SIM, CIM all disabled
Free Order
PayPal

31 May 2020, 8:28 PM
#1639
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Not DPU related

It is repeatable

Login to account
Put anything in cart
Go to checkout
Select any USPS option
mydebug file generated

OPC 2.3.0

31 May 2020, 11:45 PM
#1640
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

It is also repeatable when OPC is set to false.

I've alternated between 156c orders.php and 157 orders.php. 156c orders.php was causing issues shortly after updating to 156c and DrByte suggested using the orders.php from 157 to remedy the issue.

156c version was in-use when the file posted above was generated. AFAIK, it was the as-shipped version.

All said and done, as you said... "not an OPC issue" TNX Cindy