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

One-Page Checkout [Support Thread]

Views: 629,287

Results 661 to 680 of 3,075
30 Nov 2017, 2:06 AM
#661
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]

Further investigation shows that Square Payment is somehow inserting itself into the OPC proccess. We were getting```
paymentform:1 Uncaught Error: SqPaymentForm element with id square_cc-number not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform
at s.buildIframeController (paymentform:1)
at s.buildIframeControllers (paymentform:1)
at s.build (paymentform:1)
at s.build (paymentform:1)
s.buildIframeController @ paymentform:1
s.buildIframeControllers @ paymentform:1
s.build @ paymentform:1
s.build @ paymentform:1

PayPal brings the customer back to OPC and Square is looking for the cc number.
When PayPal brings the customer back to Step 2 of 3 in the standard checkout, the Square error is also there BUT, it disappears when the customer goes to Step 3 of 3.  Once on Step 3 of 3, PayPal will confirm even with Square turned on as the error disappears between steps 2 and 3.


The system goes through all steps including registering the New Customer, emailing info, order shows up, etc.


Again, ALL failed testing is done as never before customer, using PayPal from Split-Page Login.


Conversely, when a logged-in user orders an item and clicks on Checkout (OPC ON - Square ON), the OPC is shown with the options for a CC or PayPal Express.  Choosing PayPal Express and clicking Confirm takes the logged-in user to PayPal and completes the order on return.  It does not return to OPC to give the user the option to confirm but, goes immediately to completion.


Synopsis:


We were wondering why some PayPal orders were coming in and we were getting emails that PayPal would not allow others to check out.  Current trials result in:


1.  Customer NOT logged in and NOT a previous customer with both Square and OPC enabled
	*	Places item in cart
	* Selects Check Out
	* Arrives a split-login
	* Selects PayPal Express
	* Browser opens PayPal
	* Customer selects method of payment and pays
	* Browser returns to site with "uncaught Error" from Square
	* Customer is unable to complete the transaction as the Confirm Order Button does nothing
	
2.  Returning Customer Or Newly Registered Customer, logged in with both Square and OPC enabled. 
	*	Places item in cart
	* Selects Check Out
	* Arrives at OPC with options for Square, PayPal, or Money Order
	* Selects PayPal Express
	* Browser opens PayPal
	* Customer selects method of payment and pays
	* Browser returns to site and completes the transaction without requiring any further action from the Customer


We are still not certain whether Square or OPC is the culprit but, one of them is "sticking it's nose in where it doesn't belong.":P
30 Nov 2017, 2:19 AM
#662
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, didn't catch my error until after edit time.> Further investigation shows that Square Payment is somehow inserting itself into the OPC proccess. We were gettingshould read> Further investigation shows that Square Payment is somehow inserting itself into the OPC proccess when a non-logged in customer selects PayPal Express from the split-login page. We were getting

30 Nov 2017, 12:45 PM
#663
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@dbltoe, thanks for the detailed investigation. I'm in the middle of another investigation right now, but will give this a look real-soon-now.

30 Nov 2017, 1:55 PM
#664
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Thank You Cindy

30 Nov 2017, 2:13 PM
#665
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

haredo:

Thank You Cindy
No problem. Is this available on the test site that @dbltoe provided me access to a couple of months ago?

30 Nov 2017, 2:30 PM
#666
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Give me an hour it will be there and I will PM you the access credentials

30 Nov 2017, 3:27 PM
#667
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

PM sent

30 Nov 2017, 9:35 PM
#668
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@dbltoe and @haredo, rather than replying with quote I thought I'd save the zen-cart site a little storage.:P

My initial hunch is that there's something that OPC needs to do to "convince" Square that the payment method is already determined and that it (and any other payment-module except for Express Checkout) can "bow out".

5 Dec 2017, 7:22 PM
#669
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

lat9:

@dbltoe and @haredo, rather than replying with quote I thought I'd save the zen-cart site a little storage.:P

My initial hunch is that there's something that OPC needs to do to "convince" Square that the payment method is already determined and that it (and any other payment-module except for Express Checkout) can "bow out".
OK, I've had a chance to look into this a bit more. It turns out that there is also an issue with OPC and payeezyjszc during PayPal Express Checkout (i.e. like the customer can't complete their PP-ec purchase due to a jQuery issue).:oops:

The issue with OPC (and possibly the 3-page-checkout mode as well) is that *all *enabled payment methods are being loaded when the current order is being paid with PayPal-ec and some of those methods' javascript/jQuery scripts are getting confused since their payment-selections aren't rendered during "special checkout".

It might take me a couple of days, but I've at least got a direction to look!

8 Dec 2017, 3:20 PM
#670
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

lat9:

OK, I've had a chance to look into this a bit more. It turns out that there is also an issue with OPC and payeezyjszc during PayPal Express Checkout (i.e. like the customer can't complete their PP-ec purchase due to a jQuery issue).:oops:

The issue with OPC (and possibly the 3-page-checkout mode as well) is that *all *enabled payment methods are being loaded when the current order is being paid with PayPal-ec and some of those methods' javascript/jQuery scripts are getting confused since their payment-selections aren't rendered during "special checkout".

It might take me a couple of days, but I've at least got a direction to look!
The issue with the integration of PayPal Express Checkout, One-Page Checkout and payment methods that use a separate checkout_payment page jscript module is as follows.

Requirements to "expose" the issue:
The site has enabled the PayPal Express Checkout (and its shortcut button) and either Square or Payeezyjs in addition to One-Page Checkout.
A new customer chooses to pay via the PP-EC shortcut button and the email address associated with the customer's PayPal account is not associated with a customer on the site.

The problem:
The jscript processing associated with those payment methods (and possibly others) currently loads so long as the associated payment-method is enabled in the admin. When the customer makes a purchase using the PP-ec Shortcut button, the payment-gathering page is rendered only with the PayPal-related form elements. Unfortunately, the jscript for these payment methods assumes that its form-elements have been rendered if the jscript is loaded. When that jscript attempts to verify settings of an unrendered HTML element, a javascript error is raised; that error subsequently results in the One-Page Checkout's "Confirm Order" button failing to activate.

The solution:
Unfortunately, this change requires updates to both the One-Page Checkout and the payment-methods' processing.

First, the OPC's entry-page processing will check to see if the customer is currently in "special checkout" (a.k.a. checkout using the PP-ec shortcut) and, if so, "resets" the payment methods to activate only the special-checkout payment method. Note that this is a chicken/egg situation, since for OPC to determine whether or not the customer is in "special checkout", all currently-enabled payment methods must be loaded.

When OPC sees that the customer is in "special checkout", OPC reloads the payment methods to specify that the active payment-method is the "special checkout" one. This does not remove the object-instances associated with the other enabled payment methods, but does ensure that only the active payment-method will be called for subsequent payment actions.

Secondly, each payment-method that has a separate jscript_*.php module requires update to that module's loading to ensure that the associated javascript is only loaded when the customer is not in "special checkout".

The changes:
The file /includes/modules/pages/checkout_one/header_php.php:

// load all enabled payment modules
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment;

[B]// -----
// Check to see if we're in "special checkout", i.e. the payment's being made via the PayPal Express
// Checkout's "shortcut" button.  If so, "reset" the payment modules to include **only** the payment
// method presumed to be recorded in the current customer's session.
//
if ($payment_modules->in_special_checkout()) {
    unset($payment_modules);
    $payment_modules = new payment($_SESSION['payment']);
}[/B]
$payment_selections = $payment_modules->selection();
$flagOnSubmit = count($payment_selections);

This change is available on the OPC plugin's GitHub repository.

The jscript_square.php module, distributed as part of the Square payment-method:

if ([B]$payment_modules->in_special_checkout() || [/B]!defined(MODULE_PAYMENT_SQUARE_STATUS) || MODULE_PAYMENT_SQUARE_STATUS != 'True' || (!defined('MODULE_PAYMENT_SQUARE_APPLICATION_ID') || MODULE_PAYMENT_SQUARE_ACCESS_TOKEN == '')) {
    return false;
}

The jscript_payeezy.php module, distributed as part of the PayeezyJsZc payment-method:

if ([B]$payment_modules->in_special_checkout() || [/B]!defined(MODULE_PAYMENT_PAYEEZYJSZC_STATUS) || MODULE_PAYMENT_PAYEEZYJSZC_STATUS != 'True' || (!defined('MODULE_PAYMENT_PAYEEZYJSZC_JSSECURITY_KEY') && !defined('MODULE_PAYMENT_PAYEEZYJSZC_JSSECURITY_KEY_SANDBOX') )) {
    return false;
}

I'll be cross-posting a link to this post to the Square and PayeezyJsZc payment methods' support threads.

8 Dec 2017, 4:15 PM
#671
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: One-Page Checkout [Support Thread]

Shouldn't the modification to the other payment methods depend on the use of this plugin instead of always returning false if in special_checkout?

8 Dec 2017, 4:42 PM
#672
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

mc12345678:

Shouldn't the modification to the other payment methods depend on the use of this plugin instead of always returning false if in special_checkout?
Nope, the issue with Square and PayeezyJs also rears its head during the 3-page checkout, with an error message displayed.

11 Dec 2017, 5:32 PM
#673
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

I've just submitted v1.4.2 of the One-Page Checkout to the Zen Cart plugins for review. Once reviewed and made available, the update can be downloaded from here.

That version contains the changes (both to the OPC's code and readme) associated with changes required for proper integration of the PayPal Express Checkout's shortcut button. Please refer to post#90 (above) of this support-thread for additional information.

I'll post back here once the download is available.

12 Dec 2017, 4:07 PM
#674
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Version 1.4.2 of One-Page Checkout is now available for download from the Zen Cart plugins section.

10 Jan 2018, 2:31 PM
#675
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

I've just submitted v1.5.0 of One-Page Checkout to the Zen Cart plugins' area for review; I'll post back here when it's available for download.

This version contains the changes associated with the following GitHub issues:

#104: Defer installation until admin login.
#105: Split template blocks into separate files for easier re-arrangement
#106: Move jQuery processing to separately-loaded .js file, with minified version.

It's a major move forward in OPC's release, making it easier to customize since each of the major template "blocks" (e.g. payment-address, shopping-cart) are moved to a separate file. That way, you can move the blocks around more easily by simply updating your template's version of tpl_checkout_one_default.php.

In addition, the main page's jQuery processing has been split into a constant-setting file that then loads the actual jQuery processing (full-size or minified, based on an admin configuration setting). This allows (a) the ever-growing script file to be minimized and (b) for that file to be loaded after the page has been rendered by the browser ... both page-level load-time improvements.

19 Jan 2018, 2:32 AM
#676
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

If I have plugin reward points, I have to add this to one page checkout correct? like it's done for ot_coupon module? Thanks

19 Jan 2018, 1:05 PM
#677
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

tmccaff:

If I have plugin reward points, I have to add this to one page checkout correct? like it's done for ot_coupon module? Thanks
As identified in OPC's readme, there are tweaks that need to be done for a successful integration of the reward-points plugin; see post #407 of this support thread for details.

19 Jan 2018, 6:59 PM
#678
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Partially working. I upgraded to 1.4.2 on a client site using 1.5.5f.

It works when paying via check/money order but not PayPal Express (selected on the payment page, not the shopping cart). I have not tried PayPal Payments Pro but that is the third payment option.

Shipping modules include:
Flat Rate
Free Shipping Options
Store PickUp
USPS

Order Total modules include:
ot_categoryorderfee
ot_coupon
ot_group_pricing
ot_insurance
ot_loworderfee
ot_manufacturer_discount
ot_reward_points (I did include the two changed per the instructions)
ot_reward_points_display
ot_shipping
ot_subtotal
ot_tax
ot_total

I know it's a lot. I can send the error log as well.

19 Jan 2018, 7:08 PM
#679
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Thanks I see that now; quick question it says to add this code in ot_reward_points.php after function collect_posts

if (isset($_SESSION['redeem_flag']) && $_SESSION['redeem_flag'])
            $_POST['redeem_flag'] = $_SESSION['redeem_flag']; 

Here is the code in that function. Do I need to replace this code with one above?

function collect_posts() 
	{
		if($_REQUEST['redeem_checkout_flag'])
		 if((isset($_REQUEST['redeem_flag']) && $_REQUEST['redeem_flag']) || (isset($_REQUEST['redeem_points']) && $_REQUEST['redeem_points']>0))
		 {
			$_SESSION['redeem_points']=$this->get_points_redeeming();
			$_SESSION['redeem_value']=$_SESSION['redeem_points']*GetRedeemRatio($_SESSION['customer_id']);
		 }
		 else
		  $this->clear_posts();
	}
19 Jan 2018, 7:17 PM
#680
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Jeking What errors you get?