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

One-Page Checkout [Support Thread]

Views: 629,283

Results 2,221 to 2,240 of 3,074
5 May 2022, 7:18 PM
#2221
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

One-Page Checkout [Support Thread]

Latest WebPay and OPC installed to topkayakerDOTcom. PHP 7.4
getting```
[05-May-2022 18:54:50 UTC] Request URI: /index.php?main_page=checkout_process, IP address: ...
#1 var_export() called at [/includes/classes/OnePageCheckout.php:744]
#2 OnePageCheckout->updateOrderAddresses() called at [/includes/classes/observers/class.checkout_one_observer.php:422]
#3 checkout_one_observer->update() called at [/includes/classes/class.base.php:118]
#4 base->notify() called at [/includes/classes/order.php:425]
#5 order->cart() called at [/includes/classes/order.php:35]
#6 order->__construct() called at [/includes/modules/checkout_process.php:48]
#7 require(/includes/modules/checkout_process.php) called at [/includes/modules/pages/checkout_process/header_php.php:14]
#8 require(/includes/modules/pages/checkout_process/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 744.

6 May 2022, 2:28 AM
#2222
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

dbltoe:

Latest WebPay and OPC installed to topkayakerDOTcom. PHP 7.4
getting```
[05-May-2022 18:54:50 UTC] Request URI: /index.php?main_page=checkout_process, IP address: ...
#1 var_export() called at [/includes/classes/OnePageCheckout.php:744]
#2 OnePageCheckout->updateOrderAddresses() called at [/includes/classes/observers/class.checkout_one_observer.php:422]
#3 checkout_one_observer->update() called at [/includes/classes/class.base.php:118]
#4 base->notify() called at [/includes/classes/order.php:425]
#5 order->cart() called at [/includes/classes/order.php:35]
#6 order->__construct() called at [/includes/modules/checkout_process.php:48]
#7 require(/includes/modules/checkout_process.php) called at [/includes/modules/pages/checkout_process/header_php.php:14]
#8 require(/includes/modules/pages/checkout_process/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 744.

Zen Cart version?
6 May 2022, 2:47 AM
#2223
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: One-Page Checkout [Support Thread]

Sorry,
1.5.7d

6 May 2022, 2:44 PM
#2224
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: One-Page Checkout [Support Thread]

This is just a partial (had to cut it to fit) but, today, we have started getting the line 567 added to the mix.

[CODE][06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

[06-May-2022 03:09:59 UTC] Request URI: /index.php?main_page=checkout_one, IP address: 172.89.81.16
#1 var_export() called at [/includes/classes/OnePageCheckout.php:567]
#2 OnePageCheckout->startGuestOnePageCheckout() called at [/includes/modules/pages/checkout_one/header_php.php:41]
#3 require(/includes/modules/pages/checkout_one/header_php.php) called at [/index.php:35]
--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

6 May 2022, 8:48 PM
#2225
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@dbltoe, what happens if you change line 567 of /includes/classes/OnePageCheckout.php from

        $this->debugMessage('startGuestOnePageCheckout, exit: sendto: ' . ((isset($_SESSION['sendto'])) ? $_SESSION['sendto'] : 'not set') . ', billto: ' . ((isset($_SESSION['billto'])) ? $_SESSION['billto'] : 'not set') . [B]var_export($this, true)[/B]);

to

        $this->debugMessage('startGuestOnePageCheckout, exit: sendto: ' . ((isset($_SESSION['sendto'])) ? $_SESSION['sendto'] : 'not set') . ', billto: ' . ((isset($_SESSION['billto'])) ? $_SESSION['billto'] : 'not set') . j[B]son_encode($this)[/B]);

If that suppresses the error, would you turn on the OPC debug and send a copy of the generated log to my private email address? I have no idea where that circular reference is coming from.

6 May 2022, 9:00 PM
#2226
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: One-Page Checkout [Support Thread]

commented out line 567 and added your code to 569. Got

[06-May-2022 20:57:29 UTC] PHP Parse error: syntax error, unexpected ')' in /includes/classes/OnePageCheckout.php on line 569

[06-May-2022 20:57:29 UTC] Request URI: /index.php?main_page=index&Path=3, IP address: 157.55.39.46
--> PHP Parse error: syntax error, unexpected ')' in /includes/classes/OnePageCheckout.php on line 569.

so I put 567 back.

7 May 2022, 9:10 AM
#2227
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

Hi, me again!

I think that in checkout_one_confirmation/header_php.php there is a problem with the message stack.

Here's the code that handles the "translation" of messages to the correct class of message:

if ($error || $messageStack->size('checkout_payment') > 0 || !$order_confirmed) {
    // -----
    // Need to "redirect" any messages to 'checkout' (issued by ot_coupon and possibly others) so they display properly
    // on the checkout_one page.
    //
    if ($messageStack->size('checkout') > 0) {
        foreach ($messageStack->messages as $i => $current_message) {
            if ($current_message['class'] == 'checkout') {
                $messageStack->messages[$i]['class'] = 'checkout_payment';
            }
        }
    }

    $checkout_one->debug_message("Something causing redirection back to checkout_one, error ($error), order_confirmed ($order_confirmed)" . var_export($messageStack->messages, true) . var_export($ot_total, true));
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_ONE, '', 'SSL'));
}

The problem is that the method $messageStack->size includes a reset of the variable $_SESSION['messageToStack'] which means that one loses all the add_session messages.

I think you need to do something like:

$temp['checkout_payment'] = 0;
$temp['checkout'] = 0;
if (count($messageStack->messages)) {
    foreach ($messageStack->messages as $m) {
        switch ($m['class']) {
            case 'checkout_payment':
                $temp['checkout_payment']++;
                break;
            case 'checkout':
                $temp['checkout']++;
                break;
            default:
                break;
        }
    }

}

if ($error || $temp['checkout_payment'] > 0 || !$order_confirmed) {
    // -----
    // Need to "redirect" any messages to 'checkout' (issued by ot_coupon and possibly others) so they display properly
    // on the checkout_one page.
    //
    if ($temp['checkout'] > 0) {
        foreach ($messageStack->messages as $i => $current_message) {
            if ($current_message['class'] == 'checkout') {
                $messageStack->messages[$i]['class'] = 'checkout_payment';
            }
        }
    }
    $checkout_one->debug_message("Something causing redirection back to checkout_one, error ($error), order_confirmed ($order_confirmed)" . var_export($messageStack->messages, true) . var_export($ot_total, true));
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_ONE, '', 'SSL'));
}

Nick

7 May 2022, 11:29 AM
#2228
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@niccol, what version of Zen Cart are you running on? The zc157+ version of /includes/classes/message_stack.php don't include that session reset.

Update: Never mind; I'll get OPC updated.

7 May 2022, 11:40 AM
#2229
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

lat9:

@niccol, what version of Zen Cart are you running on? The zc157+ version of /includes/classes/message_stack.php don't include that session reset.

Update: Never mind; I'll get OPC updated.
GitHub tracking issue: https://github.com/lat9/one_page_checkout/issues/326

7 May 2022, 12:45 PM
#2230
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

lat9:

@niccol, what version of Zen Cart are you running on? The zc157+ version of /includes/classes/message_stack.php don't include that session reset.

Update: Never mind; I'll get OPC updated.

Oh, now I am not sure. This is a site I have inherited.

It says 1.5.7a but obviously the line is not in the default Zen code. (or in 1.5.0) So, I don't know.

What I am seeing on this site is this: (but it might be non-standard and someone has edited in the past.)

    function size($class) 
    {
        if (!empty($_SESSION['messageToStack'])) {
            foreach ($_SESSION['messageToStack'] as $next_message) {
                $this->add($next_message['class'], $next_message['text'], $next_message['type']);
            }
        }

        $_SESSION['messageToStack'] = array();

        $count = 0;

        foreach ($this->messages as $next_message) {
            if ($next_message['class'] == $class) {
                $count++;
            }
        }

        return $count;
    }

But your point about it being unnecessary anyway on Github makes a lot of sense :-)

7 May 2022, 8:58 PM
#2231
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

niccol:

Oh, now I am not sure. This is a site I have inherited.

It says 1.5.7a but obviously the line is not in the default Zen code. (or in 1.5.0) So, I don't know.

What I am seeing on this site is this: (but it might be non-standard and someone has edited in the past.)

function size($class) 
{
    if (!empty($_SESSION['messageToStack'])) {
        foreach ($_SESSION['messageToStack'] as $next_message) {
            $this->add($next_message['class'], $next_message['text'], $next_message['type']);
        }
    }

    $_SESSION['messageToStack'] = array();

    $count = 0;

    foreach ($this->messages as $next_message) {
        if ($next_message['class'] == $class) {
            $count++;
        }
    }

    return $count;
}
> 
> But your point about it being unnecessary anyway on Github makes a lot of sense :-)
niccol, you've got the correct zc157 version; my initial response was my foobar.
11 May 2022, 3:15 PM
#2232
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
362
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Hi lat9, I'm testing this one-page checkout module (v2.4.0) right now, and I noticed there might be a mistake for the installation notes. Step G is the following:

"Now, check your store's current /includes/modules/pages/checkout_payment directory's contents. The "base" Zen Cart distribution includes two files in that directory: header_php.php and jscript_main.php. If your directory contains any other files, be sure to copy them to your store's /includes/modules/pages/checkout_one directory. Those additional files come from plugins and additional payment methods and will be required for those modifications to operate correctly in the one-page checkout environment."

I checked the zen cart v1.5.7c and v1.5.7d zip files, there are five files under /includes/modules/pages/checkout_payment folder, which are the following:

header_php.php
jscript_main.php
jscript_double_submit.php
jscript_pmt_support.php
jscript_square.php

Maybe the early version zen cart only comes with 2 files for this folder and but now it have 5 files. It is not critical and you may clarify it in your next update.

Thanks in advance.

11 May 2022, 3:39 PM
#2233
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
362
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

@dbltoe, what happens if you change line 567 of /includes/classes/OnePageCheckout.php from

    $this->debugMessage('startGuestOnePageCheckout, exit: sendto: ' . ((isset($_SESSION['sendto'])) ? $_SESSION['sendto'] : 'not set') . ', billto: ' . ((isset($_SESSION['billto'])) ? $_SESSION['billto'] : 'not set') . [B]var_export($this, true)[/B]);
> to
> ```
        $this->debugMessage('startGuestOnePageCheckout, exit: sendto: ' . ((isset($_SESSION['sendto'])) ? $_SESSION['sendto'] : 'not set') . ', billto: ' . ((isset($_SESSION['billto'])) ? $_SESSION['billto'] : 'not set') . j[B]son_encode($this)[/B]);

If that suppresses the error, would you turn on the OPC debug and send a copy of the generated log to my private email address? I have no idea where that circular reference is coming from.

Hi Lat9, I just installed this plug-in (v2.4) on my testing site 1.5.7d, php 7.4. Under admin--One-Page Checkout Settings, I have enabled this plug-in. However, this plug-in does not show up like the demo website. The Guest checkout section did not show up if I clicked "Go to checkout" button in the shopping cart. When I checked the log file, I received the exact same warning:

--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 567.

I commented out this line and put your new code there. No warning file is generated but this plug-in still doesn't show up.

11 May 2022, 9:10 PM
#2234
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
362
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Ok. I found out why my plug-in didn't show up. After the plug-in is installed, two settings need to be changed manually:

Enable One-Page Checkout?
False => True

Enable Guest Checkout?
False => True

Now it works, other than the warning log generated:

--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 744.

When debug is ON, I received the following warning:

--> PHP Warning: var_export does not handle circular references in /includes/classes/observers/class.checkout_one_observer.php on line 690.

Line 567 warning is gone, by changing the code provided by Lat9 in the previous posts.

11 May 2022, 9:20 PM
#2235
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

njcyx:

Ok. I found out why my plug-in didn't show up. After the plug-in is installed, two settings need to be changed manually:

Enable One-Page Checkout?
False => True

Enable Guest Checkout?
False => True

Now it works, other than the warning log generated:

--> PHP Warning: var_export does not handle circular references in /includes/classes/OnePageCheckout.php on line 744.

When debug is ON, I received the following warning:

--> PHP Warning: var_export does not handle circular references in /includes/classes/observers/class.checkout_one_observer.php on line 690.

Line 567 warning is gone, by changing the code provided by Lat9 in the previous posts.
What version of PHP and Zen Cart? What payment and shipping methods are installed?

12 May 2022, 1:06 PM
#2236
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
362
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Sorry. zen cart 1.57d with php 7.4.

Shipping modules I'm using are: FedEx (fedexwebservices), USPS (k11), table and store pickup.

Payment modules I'm using are: PayPal pro (US), paypal express and check/money order. paypal standard is installed but not used.

12 May 2022, 5:07 PM
#2237
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,683
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

This is a real edge case, just reporting it in case you are working in this area and have an opportunity to fix.

On the checkout_one page, press the Edit button for Billing/Shipping Address.
Add a new address in a different country, press Save Changes.
Shipping does not reflect the new zone.

If you use the dropdown for saved addresses after pressing the edit button, the shipping correctly reflects the selected country's zone, it just fails on adding a new address.

13 May 2022, 2:33 PM
#2238
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
362
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I did some tests on my site. This plug-in is slow. Here is what I found.

Under the checkout page, if I selected a different shipping method in the shipping quote section, jquery-3.5.1.min.js will be reloaded remotely. It will take more than 1000ms to load this script. When I first enter this checkout page (shipping method is not selected), jquery-3.5.1.min.js is always loaded from cache with no delay. Even I refresh the whole checkout page, this script will be always loaded from the cache. But I don't know why it will be force to load from remote server when I choose a different shipping method every time, not from the cache. If this script file can be loaded from cache as well, it will be much faster. There is an option "Load Minified Script Files?" under the plug-in settings page. I tried both true and false, no difference. jquery-3.5.1.min.js will be loaded by both ways. Not sure if it is related to the warning generated before.

I tried the recommended code for jquery.checkout_one.js from @niccol post, seems better (by the original code, firefox sometimes will pop up slow load warning, new code does not show warning), but still over 1000ms.

       // -----
    // Monitor the billing- and shipping-address blocks for changes.
    //
    jQuery(document).on('change', '#select-address-bill', function(event) {
        jQuery('#checkoutPayment > .opc-overlay').addClass('active');
        useSelectedAddress('bill', this.value);
    });
    jQuery(document).on('change', '#select-address-ship', function(event) {
        jQuery('#checkoutPayment > .opc-overlay').addClass('active');
        useSelectedAddress('ship', this.value);
    });
13 May 2022, 3:34 PM
#2239
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
362
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Maybe my last post is not correct. I double checked the results from my browser's network console, when I selected a different shipping method, File called is "act=ajaxOnePageCheckout & method=updateShipping" Initiator is jquery-3.5.1.min.js. So it looks like JS script is pulled and updated something on the background. My site uses usps and fedex modules. When I select different FedEx shipping methods, the processing time is over 1000ms. When I select different USPS shipping methods, the time is about 800-900ms. When I selected store pickup, the time is only ~100ms. So there is a processing difference between two shipping modules. See screenshot attached.
Attachment 19985

13 May 2022, 5:33 PM
#2240
balaji avatar

balaji

New Zenner

Join Date:
Nov 2009
Location:
Chennai, India
Posts:
50
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Hi
I have installed the square payment method. I have two flat rate shipping methods enabled on the site.
When I change the shipping method at opc, the credit card fields goes missing. They are showing only refreshing the page.
Can any one please what is wrong.
Thanks