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

One-Page Checkout [Support Thread]

Views: 629,515

Results 1,841 to 1,860 of 3,078
9 Nov 2020, 12:41 PM
#1841
lat9 avatar

lat9

Administrator

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

One-Page Checkout [Support Thread]

I guess it's time to ask: What Zen Cart version? What OPC version? Are there template overrides for OPC's template modules?

Update: Noting that while the "Apply" button is just a span, it's got an id that's used by OPC's jQuery to "fire" the request.

9 Nov 2020, 1:09 PM
#1842
niccol avatar

niccol

Totally Zenned

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

Re: One-Page Checkout [Support Thread]

Zen 1.5.6c
OPC 2.3.4 (2020-08-28)

Same on Localhost and Production versions. On local I am reverting to 'classic green' so there are no template alterations.

The issue appears to be with the ID then. I am tracking that backwards to see what is what.

9 Nov 2020, 1:32 PM
#1843
niccol avatar

niccol

Totally Zenned

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

Re: One-Page Checkout [Support Thread]

Here's the section in tpl_modules_opc_credit_selections.php

        if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
            $secondary_class = 'opc-cc-submit';
            $additional_parms = '';
        } else {
            $secondary_class = '';
            $additional_parms = 'name="apply_' . $ot_class . '"' . ' class="opc-cc-submit"';
        }

I emerge out of that with:

$secondary_class = 'opc-cc-submit';
$additional_parms = '';

As expected.

Those values get sent to :

echo zen_image_button(BUTTON_IMAGE_SUBMIT, ALT_TEXT_APPLY_DEDUCTION, $additional_parms, $secondary_class);

But that will not produce an ID (or a class for that matter). So, I must be missing something, I just don't know what it is.

(
Just out of interest so far, the critical line in Zen 1.5.0 in html_output reads
$css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $style . ' > ' . $text . ' </span>'; // add $parameters ???
In my version of 1.5.6c it doesn't appear that the 2nd class is actioned at all. But I am going to have to check that.
)

9 Nov 2020, 3:27 PM
#1844
niccol avatar

niccol

Totally Zenned

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

Re: One-Page Checkout [Support Thread]

So, with css buttons disabled the behaviour is as expected. The submit button looks like this:

<img src="includes/templates/template_default/buttons/english/button_submit.gif" alt="Apply" title=" Apply " width="51" height="15" name="apply_gv" class="opc-cc-submit">

So, I am guessing that the class is what triggers the javascript. But without dismantling the javascript I am not 100% on that. It feels like a glitch in html_output.php rather than with OPC.

Moving forward with that theory:
Changing line 395 of html_ouptut.php to something like the following works for me but I have no idea if that has consequences beyond the scope here.

    ```

$css_button = '<span class="'.$sec_class.'" ' . $tooltip . $parameters . '> ' . $text . ' </span>';

9 Nov 2020, 3:47 PM
#1845
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

niccol:

So, with css buttons disabled the behaviour is as expected. The submit button looks like this:

<img src="includes/templates/template_default/buttons/english/button_submit.gif" alt="Apply" title=" Apply " width="51" height="15" name="apply_gv" class="opc-cc-submit"> ``` > > So, **I am guessing that the class is what triggers the javascript**. But without dismantling the javascript I am not 100% on that. It feels like a glitch in html_output.php rather than with OPC. > > Moving forward with that theory: > Changing line 395 of html_ouptut.php to something like the following works for me but I have no idea if that has consequences beyond the scope here. > > ``` $css_button = '<span class="'.$sec_class.'" ' . $tooltip . $parameters . '> ' . $text . ' </span>'; ``` Correct; sorry for sending you in the wrong direction on the 'id' attribute. Are you using CSS buttons or not?
9 Nov 2020, 3:54 PM
#1846
niccol avatar

niccol

Totally Zenned

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

Re: One-Page Checkout [Support Thread]

Production version - using cssButtons

Local Version - if I turn cssButtons off, then the behaiour is as you describe. Yay!

Local Version - If I turn cssButtons on, then no class is added to <span> and therefore the behaviour is not as expected.

This behaviour makes sense with the code that is in html_output.php

(but also means that at the moment I cannot enable OPC on the production site)

9 Nov 2020, 3:59 PM
#1847
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

niccol:

Production version - using cssButtons

Local Version - if I turn cssButtons off, then the behaiour is as you describe. Yay!

Local Version - If I turn cssButtons on, then no class is added to <span> and therefore the behaviour is not as expected.

This behaviour makes sense with the code that is in html_output.php

(but also means that at the moment I cannot enable OPC on the production site)
I'm baffled as the majority of my testing on both the zc156 and zc157 series has been with css buttons enabled.

9 Nov 2020, 4:07 PM
#1848
niccol avatar

niccol

Totally Zenned

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

Re: One-Page Checkout [Support Thread]

It is weird.

If there was a flaw in html_output then one would have expected it to not remain uncovered.

Going through the versions now.

1.5.4 the line is

$css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $tooltip . $parameters . '> ' . $text . ' </span>';

This would work because sec_class is included in $mouse_out_class

Working my way forward now ...

9 Nov 2020, 4:15 PM
#1849
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Noting that the current version of OPC doesn't support zc154.

9 Nov 2020, 4:34 PM
#1850
niccol avatar

niccol

Totally Zenned

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

Re: One-Page Checkout [Support Thread]

My turn to be confused. My version of html_output.php is the problem.

The critical line does not exist in any version downloaded. So, I am embarrassed. But still puzzled because why would that have changed??

Anyway, it is not your problem so I will get off your thread.

The plugin is great by the way. Particularly the 1.5.7 version :-)

13 Nov 2020, 4:15 AM
#1851
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

v1.5.5f php 7.1 OPC v2.3.4

Hello Cindy,

I have been getting PayPal error code 10730 'Shipping Address Postal Code Empty - The field Shipping Address Postal Code is required'... only when checking out as a Guest and electing to pay via PayPal. There are no other issues with checkout and OPC, just this.

I have applied the patch you posted here (https://www.zen-cart.com/showthread.php?220781-One-Page-Checkout-Support-Thread&p=1374172#post1374172) however it is not working for me. (ever the pessimist I figure it may be a v155F quirk (???) )

I am not getting an OPC debug report but am getting PayPal CURL debugs (see example below)

2020-11-13 01:02:51
-------------------
(live transaction) --> https://api-3t.paypal.com/nvp
Request Headers: 
Array
(
    [0] => Content-Type: text/namevalue
    [1] => X-VPS-Timeout: 90
    [2] => X-VPS-VIT-Client-Type: PHP/cURL
    [3] => X-VPS-VIT-Integration-Product: PHP::Zen Cart(R) - PayPal/NVP
    [4] => X-VPS-VIT-Integration-Version: 1.5.5
)


Request Parameters: {DoExpressCheckoutPayment} 
Array
(
    [PAYMENTREQUEST_0_AMT] => 17.46
    [PAYMENTREQUEST_0_ITEMAMT] => 12.56
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 4.9
    [L_PAYMENTREQUEST_0_NUMBER0] => ClipOn_433
    [L_PAYMENTREQUEST_0_NAME0] => Silver Clip On Earrings, Fashion Earrings, Turkish Influence [212]
    [L_PAYMENTREQUEST_0_QTY0] => 1
    [L_PAYMENTREQUEST_0_AMT0] => 12.56
    [PAYMENTREQUEST_0_SHIPTONAME] => Guest Customer, **do not remove**
    [PAYMENTREQUEST_0_SHIPTOSTREET] => Default billing address
    [PAYMENTREQUEST_0_SHIPTOCITY] => 
    [PAYMENTREQUEST_0_SHIPTOSTATE] => SA
    [PAYMENTREQUEST_0_SHIPTOZIP] => 
    [PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => AU
    [BUTTONSOURCE] => ZenCart-EC_us
    [ADDROVERRIDE] => 1
    [RETURNFMFDETAILS] => 0
    [PAYMENTREQUEST_0_CUSTOM] => EC-33-1605232971
    [PAYMENTREQUEST_0_INVNUM] => 33-1605232971-[DazzlersClipOnEarrings]
    [PAYMENTREQUEST_0_CURRENCYCODE] => AUD
    [TOKEN] => EC-45W88961NA283840S
    [PAYERID] => DFX4AE5BAT5QU
    [PAYMENTREQUEST_0_PAYMENTACTION] => Sale
    [NOTIFYURL] => https://www.dazzlerscliponearrings.com.au/ipn_main_handler.php
    [METHOD] => DoExpressCheckoutPayment
    [USER] => dazzlers2009_api1.hotmail.com
    [PWD] => ****************
    [VERSION] => 124.0
    [SIGNATURE] => ****************************************************SLns
)


Response: 
Array
(
    [TOKEN] => EC-45W88961NA283840S
    [SUCCESSPAGEREDIRECTREQUESTED] => false
    [TIMESTAMP] => 2020-11-13T02:02:51Z
    [CORRELATIONID] => 1ebb03776eb0d
    [ACK] => Failure
    [VERSION] => 124.0
    [BUILD] => 55058010
    [L_ERRORCODE0] => 10730
    [L_SHORTMESSAGE0] => Shipping Address Postal Code Empty
    [L_LONGMESSAGE0] => The field Shipping Address Postal Code is required
    [L_SEVERITYCODE0] => Error
    [CURL_ERRORS] => 
)


DoExpressCheckoutPayment, Elapsed: 387ms -- Failure

TOKEN=EC%2d45W88961NA283840S&SUCCESSPAGEREDIRECTREQUESTED=false&TIMESTAMP=2020%2d11%2d13T02%3a02%3a51Z&CORRELATIONID=1ebb03776eb0d&ACK=Failure&VERSION=124%2e0&BUILD=55058010&L_ERRORCODE0=10730&L_SHORTMESSAGE0=Shipping%20Address%20Postal%20Code%20Empty&L_LONGMESSAGE0=The%20field%20Shipping%20Address%20Postal%20Code%20is%20required&L_SEVERITYCODE0=Error&CURL_ERRORS=

This is a copy of the segment of my includes/modules/payment/paypalwpp.php (hopefully the patch is inserted correctly)

/**
   * Get Override Address (uses sendto if set, otherwise uses customer's primary address)
   */
  function getOverrideAddress() {
    global $db;

    // Only proceed IF *in* markflow mode AND logged-in (have to be logged in to get to markflow mode anyway)
    if (!empty($_GET['markflow']) && isset($_SESSION['customer_id']) && $_SESSION['customer_id']) {
      // From now on for this user we will edit addresses in Zen Cart, not by going to PayPal.
      $_SESSION['paypal_ec_markflow'] = 1;


      // debug
      $this->zcLog('getOverrideAddress - 1', 'Now in markflow mode.' . "\n" . 'SESSION[sendto] = ' . (int)$_SESSION['sendto']);


      // find the users default address id
      if (!empty($_SESSION['sendto'])) {
        $address_id = $_SESSION['sendto'];
      } else {
        $sql = "SELECT customers_default_address_id
                FROM " . TABLE_CUSTOMERS . "
                WHERE customers_id = :customerId";
        $sql = $db->bindVars($sql, ':customerId', $_SESSION['customer_id'], 'integer');
        $default_address_id_arr = $db->Execute($sql);
        if (!$default_address_id_arr->EOF) {
          $address_id = $default_address_id_arr->fields['customers_default_address_id'];
        } else {
          // couldn't find an address.
          return false;
        }
      }
	  
	  // -----
      // Give a watching observer the opportunity to bypass this address-override.  An observer
      // can disable the address-override processing by setting the $disable_address_override
      // parameter to specifically (bool)true.
      //
      $disable_address_override = false;
      $this->notify('NOTIFY_PAYPALWPP_DISABLE_GET_OVERRIDE_ADDRESS', $address_id, $disable_address_override);
      if ($disable_address_override === true) {
        $this->zcLog('getOverrideAddress - 1a', "Override disabled by observer request.\n");
        return false;
      }
	  

cheers,
Mike

13 Nov 2020, 11:27 AM
#1852
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Mike, that's because the addition I'd posted for paypalwpp.php was necessary but not sufficient to correct the problem. I've got the full update staged on OPC's GitHub repository (https://github.com/lat9/one_page_checkout/commit/4d7ffe7a685477cc203492f9d017cbe0f8166ec3) for the upcoming 2.3.5 release.

13 Nov 2020, 4:59 PM
#1853
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 OPC v2.3.5 to the downloads area.

 This release contains changes associated with the following GitHub issues:

#265: Form entries, use placeholder instead of trailing span to identify required fields.
#271: Correct checkout-loop when an order's total goes negative, which can happen with "Reward Points".
#272: Add a diagnostic tool to help identify the cause of checkout-redirection loops.
#274: Update the jQuery handling to address 'double-submit' concerns.
#275: Correct "Error 10730 Shipping Address Postal Code Empty" error when using paypalwpp payments.
#276: Remove unwanted HTML generation from the base OPC class.

14 Nov 2020, 7:34 PM
#1854
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 OPC v2.3.5 to the downloads area.

 This release contains changes associated with the following GitHub issues:

#265: Form entries, use placeholder instead of trailing span to identify required fields.
#271: Correct checkout-loop when an order's total goes negative, which can happen with "Reward Points".
#272: Add a diagnostic tool to help identify the cause of checkout-redirection loops.
#274: Update the jQuery handling to address 'double-submit' concerns.
#275: Correct "Error 10730 Shipping Address Postal Code Empty" error when using paypalwpp payments.
#276: Remove unwanted HTML generation from the base OPC class.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095

17 Nov 2020, 8:00 PM
#1855
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

lat9:

Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095
:oops:
v2.3.5 introduced a change that renders Guest Checkout 'unusable' for sites that have Configuration :: Customer Details :: State - Always display as pulldown? set to true. These sites can work around the issue by temporarily setting that value to ***false ***while I get a v2.3.6 correction released.

That'll be (hopefully) tomorrow.

18 Nov 2020, 12:42 PM
#1856
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.6 of One Page Checkout for the Zen Cart moderators' review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#278: Remove unneeded create_account.css files.
#279: Correct CSS validation issues for the checkout_one.css files.
#280: Correct "Guest checkout can't complete when country/state dropdowns are used". This bug was introduced in v2.3.5.

18 Nov 2020, 7:21 PM
#1857
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: One-Page Checkout [Support Thread]

I know I have encountered this before and it was an easy fix but darned if I can remember it!

1.5.6c site and latest version of OPC - I cannot enter credit card info when using guest checkout. Everything is all "blurred out" except for the name, email and phone. They are using SQUARE as the payment module. I faintly remember having to copy a file to another directory......

HELP!!

18 Nov 2020, 7:35 PM
#1858
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: One-Page Checkout [Support Thread]

Was it the /includes/modules/checkout_payment/jscript_square.php file to copy into the /includes/modules/checkout_one directory?
I think it's mentioned in the bottom of the checkout-one docs.

18 Nov 2020, 7:46 PM
#1859
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: One-Page Checkout [Support Thread]

Upgrading the SQUARE module right now - slow and go out here in the forest of Montana! lol But I don't see a file like that in the mod.... even under /pages/ section.... will keep reading on down the mod help file to see if I find anything.

Thanks Chris!

18 Nov 2020, 8:08 PM
#1860
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: One-Page Checkout [Support Thread]

DrByte:

Was it the /includes/modules/checkout_payment/jscript_square.php file to copy into the /includes/modules/checkout_one directory?
I think it's mentioned in the bottom of the checkout-one docs.

Ok just tried that and it did not work. :(