-
Paypal In-context popup does not load content, then proceeds to full-page payment
I'm trying to use the In-context option without success.
The popup opens, lightbox style, seems to be trying to load for a few seconds but then redirects to the usual full page for Express.
I have read that this symptom can occur when the shop is not in the accepted country list, this is Spain so should be valid.
The source code on the payment confirmation page seems correct:
Quote:
<form onsubmit="submitonce();" id="checkout_confirmation" method="post" action="https://www.mysite.es/subdir/ipn_main_handler.php?type=ec&markflow=1&clearSess=1&stage=final" name="checkout_confirmation"><input type="hidden" value="7249fe1578a4fdfaf92fd07bcb427f38" name="securityToken"> <script>
window.paypalCheckoutReady = function () {
paypal.checkout.setup('my merchant id', {
//locale: 'en_US',
container: 'checkout_confirmation',
button: 'btn_submit'
});
};
</script>
<script async="" src="//www.paypalobjects.com/api/checkout.js"></script><div class="buttonRow forward"><button id="btn_submit" name="btn_submit_x" value="Confirm Order" type="submit" onmouseout="this.className='cssButton submit_button button button_confirm_order'" onmouseover="this.className='cssButtonHover button_confirm_order button_confirm_orderHover'" class="cssButton submit_button button button_confirm_order">Confirm Order</button></div>
</form>
Setting the PPDEBUG cookie from the console yields this info
Quote:
{"status":"IC_SETUP","button-type":"JS","button-number":1,"merchantSite":"www.my_website.es","version":"3.0","token":null,"guid" :"f46da875-5c2d-7b58-260d-0715581980e3","oneTouchShowed":"false","jsBtnConfig":[]}
iframe
{"status":"IC_HERMES_PREFETCH_COMPLETE","elapsed":1203,"merchantSite":"
www.my_website.es ","version":"3.0","token":null,"guid":"f46da875-5c2d-7b58-260d-0715581980e3","oneTouchShowed":"false","jsBtnConfig":[]}
I note that after cancelling the paypal page to return to the shop and trying again, the in-context code is NOT generated...?
Quote:
<form onsubmit="submitonce();" id="checkout_confirmation" method="post" action="https://www.motorvista.es/tienda_155/ipn_main_handler.php?type=ec&markflow=1&clearSess=1&stage=final" name="checkout_confirmation"><input type="hidden" value="7249fe1578a4fdfaf92fd07bcb427f38" name="securityToken"><div class="buttonRow forward"><button id="btn_submit" name="btn_submit_x" value="Confirm Order" type="submit" onmouseout="this.className='cssButton submit_button button button_confirm_order'" onmouseover="this.className='cssButtonHover button_confirm_order button_confirm_orderHover'" class="cssButton submit_button button button_confirm_order">Confirm Order</button></div>
</form>
Often I come across stuff that fails when in Spanish, but this is generated with shop language as English.
I've tried this with my in-development 155 shop and a vanilla 155 on my hosting with the same result.
Since there are few/no queries about this, I assume it usually works.
All I have done to enable this is add my merchant id. From what I can see in the code, that is all that is necessary.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I am experiencing this also. Setup correctly as far as I know on UK store, with merchant ID after going to Paypal settings as instructed. I could see sometimes it starts to open a lightbox then goes to full page version. But right now it seems to go straight to normal paypal full page version.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Is there anything noted in the console-log?
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
No errors, only the info stuff due to the debug cookie being set.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Since this was added in 1.55, I would assume the lack of a comment from a dev implies it all worked first time when implemented/they have not seen this issue.
I note that the js code for in-context is added into the page only on the first attempt, after the failure/subsequently it is not, and so goes straight to the full-page screen.
If I try again "some time later" the code does get inserted on the first attempt again. This seems to be a consequence of the problem, not the problem itself. I assume this is a Paypal-controlled thing?
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
torvista
Since this was added in 1.55, I would assume the lack of a comment from a dev implies it all worked first time when implemented/they have not seen this issue.
I note that the js code for in-context is added into the page only on the first attempt, after the failure/subsequently it is not, and so goes straight to the full-page screen.
If I try again "some time later" the code does get inserted on the first attempt again. This seems to be a consequence of the problem, not the problem itself. I assume this is a Paypal-controlled thing?
They were having difficulty with reloading the applicable page to then cause/allow the javascript to reload, but I have seen it implemented on previous ZC versions outside of the changes made to support ZC 1.5.5 where 1) it continues to function, 2) does reload after a cancel operation, 3) is not going directly to the standard PP screen like is being seen on ZC 1.5.5.
Can't recall if the reload operation to provide the javascript again on cancellation required ZC code modification or was corrected by PP. Do know that one difference in application elsewhere as compared to how it was implemented in ZC 1.5.5 is that the PP variable SOLUTIONTYPE set to "sole" elsewhere was not modified to Mark. Not able at the moment to test whether that is related to this issue or not.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I just tested a newly upgraded 1.5.5a version and the popup does not display on it either, it just goes over to the paypal screen.
The Paypal Merchant ID is entered because I know it is required for this function to work. All other credentials are correct as well.
:please:
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Following @torvista's approach, I set the PPDEBUG cookie in the FireFox console and also clicked the "Persist" button so that any transitional issues would also be reported. What I was "rewarded with" was the following additional console-log that might shed some light on the issue:
Code:
{"status":"IC_DESTROY_NO_CANCEL_RETURN_URL","merchantSite":"mysite.com","version":"3.0","token":null,"guid":"a2aea560-b928-84ad-8604-fc98812b05d2","oneTouchShowed":"false","jsBtnConfig":[]}
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I was just asking another Zen Cart expert about this and she said we needed PayPal's AJAX. I am not a coder, so have no stinking clue what that means... but here is what I found on PayPal site
Quote:
Manual or AJAX Integrations
In certain use cases, you may want to manually initiate the checkout experience, such as, if you are calling the APIs with AJAX from the browser or from a Flash application. This can be done using the click setting, and manually calling paypal.checkout.initXO, paypal.checkout.startFlow, and paypal.checkout.closeFlow. See the following example:
paypal.checkout.setup('Your-Merchant-ID', {
environment: 'sandbox',
container: 'myContainer',
click: function () {
paypal.checkout.initXO();
var action = $.post('/set-express-checkout');
action.done(function (data) {
paypal.checkout.startFlow(data.token);
});
action.fail(function () {
paypal.checkout.closeFlow();
});
}
});
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I'm also testing this as well and the popup does not display for me, it goes straight to paypal's full screen checkout.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Seeing so many having difficulty using this added feature and while this (solution and addition to ZC) makes a plugin I offer obsolete, ZC 1.5.5x is missing an important part of the process outlined by PayPal to support In Context checkout. Namely the javascript code needed to support the operation.
The code needs to be incorporated first in the shopping_cart, and then anywhere from which the PayPal Express button can be applied and anywhere to which return from PayPal is expected in order to allow revisiting the in context operation and to "hold" the view in the original screen.
An easy solution that doesn't require any file overrides nor template modification is to place the following code in a file named jscript_paypal_incontext.php then place that file in the folders listed below:
jscript_paypal_incontext.php:
Code:
<?php
if (defined('MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE') && MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE == 'InContext' && defined('MODULE_PAYMENT_PAYPALWPP_MERCHANTID') && MODULE_PAYMENT_PAYPALWPP_MERCHANTID != '' && defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
?><!-- merchant site HTML page --><script> (function(d, s, id){ var js, ref = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)){ js = d.createElement(s); js.id = id; js.async = true; js.src = "//www.paypalobjects.com/js/external/paypal.js"; ref.parentNode.insertBefore(js, ref); } }(document, "script", "paypal-js")); </script><?php
}
Place the file in at least each of the folders in the path includes/modules/pages/
shopping_cart
login
checkout_shipping
checkout_payment
checkout_confirmation
checkout_success
time_out
index
Ie. includes/modules/pages/shopping_cart/jscript_paypal_incontext.php
And any other page that has the PayPal express checkout button or that is or could be a return page displayed to the customer in the checkout process as implemented by modifications made to your site to where a customer could return from PayPal express. (For example, the shipping page can be bypassed using PayPal Express, further the payment page can be bypassed also provided there is no possibility of a coupon being applied, which would deliver the customer to the checkout_confirmation page in a default ZC install.)
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
@mc12345678, would you provide a link to the associated PayPal documentation?
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
CRUD!! I was HOPING this would work... but it still opens up in a new window. Site is https://www.tjsattic.com
Site is using 1.5.5a and everything is correct in the admin under modules/payment
Quote:
Originally Posted by
mc12345678
Seeing so many having difficulty using this added feature and while this (solution and addition to ZC) makes a plugin I offer obsolete, ZC 1.5.5x is missing an important part of the process outlined by PayPal to support In Context checkout. Namely the javascript code needed to support the operation.
The code needs to be incorporated first in the shopping_cart, and then anywhere from which the PayPal Express button can be applied and anywhere to which return from PayPal is expected in order to allow revisiting the in context operation and to "hold" the view in the original screen.
An easy solution that doesn't require any file overrides nor template modification is to place the following code in a file named jscript_paypal_incontext.php then place that file in the folders listed below:
jscript_paypal_incontext.php:
Code:
<?php
if (defined('MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE') && MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE == 'InContext' && defined('MODULE_PAYMENT_PAYPALWPP_MERCHANTID') && MODULE_PAYMENT_PAYPALWPP_MERCHANTID != '' && defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
?><!-- merchant site HTML page --><script> (function(d, s, id){ var js, ref = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)){ js = d.createElement(s); js.id = id; js.async = true; js.src = "//www.paypalobjects.com/js/external/paypal.js"; ref.parentNode.insertBefore(js, ref); } }(document, "script", "paypal-js")); </script><?php
}
Place the file in at least each of the folders in the path includes/modules/pages/
shopping_cart
login
checkout_shipping
checkout_payment
checkout_confirmation
checkout_success
time_out
index
Ie. includes/modules/pages/shopping_cart/jscript_paypal_incontext.php
And any other page that has the PayPal express checkout button or that is or could be a return page displayed to the customer in the checkout process as implemented by modifications made to your site to where a customer could return from PayPal express. (For example, the shipping page can be bypassed using PayPal Express, further the payment page can be bypassed also provided there is no possibility of a coupon being applied, which would deliver the customer to the checkout_confirmation page in a default ZC install.)
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
stellarweb
CRUD!! I was HOPING this would work... but it still opens up in a new window. Site is
https://www.tjsattic.com
Site is using 1.5.5a and everything is correct in the admin under modules/payment
Generally speaking, it's still supposed to open in a new window, but the previous window is supposed to have a lightbox applied to it and the new window "hovering" over the existing.
Lat9, the reference I have for that code and direction has been replaced with the current in context information. That said, the src path can be modified to //www.paypalobjects.com/api/checkout.js and still function.
In further review, it appears that in includes/modules/payment/paypalwpp.php function process_button, the reason upon returning to the shopping cart and not being able to reuse incontext checkout is because the token has been provided back even though ec_cancel=1 and therefore when presenting the button code through process_button, the applicable javascript associated is not returned for display. This is also why after a "timeout" that the next visit to the shopping cart page will allow reuse of the in context method.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
mc12345678
... Lat9, the reference I have for that code and direction has been replaced with the current in context information. That said, the src path can be modified to //www.paypalobjects.com/api/checkout.js and still function. ...
mc12345678, I have absolutely no idea what you mean. Are you saying that the jscript code you posted was for an older implementation of the in-context processing?
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
So.... bottom line is.... how the heck do we get this to work properly? lol
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
mc12345678
Seeing so many having difficulty using this added feature and while this (solution and addition to ZC) makes a plugin I offer obsolete, ZC 1.5.5x is missing an important part of the process outlined by PayPal to support In Context checkout. Namely the javascript code needed to support the operation.
The code needs to be incorporated first in the shopping_cart, and then anywhere from which the PayPal Express button can be applied and anywhere to which return from PayPal is expected in order to allow revisiting the in context operation and to "hold" the view in the original screen.
An easy solution that doesn't require any file overrides nor template modification is to place the following code in a file named jscript_paypal_incontext.php then place that file in the folders listed below:
jscript_paypal_incontext.php:
Code:
<?php
if (defined('MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE') && MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE == 'InContext' && defined('MODULE_PAYMENT_PAYPALWPP_MERCHANTID') && MODULE_PAYMENT_PAYPALWPP_MERCHANTID != '' && defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
?><!-- merchant site HTML page --><script> (function(d, s, id){ var js, ref = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)){ js = d.createElement(s); js.id = id; js.async = true; js.src = "//www.paypalobjects.com/js/external/paypal.js"; ref.parentNode.insertBefore(js, ref); } }(document, "script", "paypal-js")); </script><?php
}
Place the file in at least each of the folders in the path includes/modules/pages/
shopping_cart
login
checkout_shipping
checkout_payment
checkout_confirmation
checkout_success
time_out
index
Ie. includes/modules/pages/shopping_cart/jscript_paypal_incontext.php
And any other page that has the PayPal express checkout button or that is or could be a return page displayed to the customer in the checkout process as implemented by modifications made to your site to where a customer could return from PayPal express. (For example, the shipping page can be bypassed using PayPal Express, further the payment page can be bypassed also provided there is no possibility of a coupon being applied, which would deliver the customer to the checkout_confirmation page in a default ZC install.)
Revision to the above which so far has worked in all testing and uses more recent/locatable information.
An easy solution that doesn't require any file overrides nor template modification is to place the following code in a file named jscript_paypal_incontext.php then place that file in the folders listed below:
jscript_paypal_incontext.php:
Code:
<?php
if (defined('MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE') && MODULE_PAYMENT_PAYPALWPP_CHECKOUTSTYLE == 'InContext' && defined('MODULE_PAYMENT_PAYPALWPP_MERCHANTID') && MODULE_PAYMENT_PAYPALWPP_MERCHANTID != '' && defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
require_once(DIR_WS_CLASSES . 'payment.php');
$paypalwpp_module = 'paypalwpp';
// init the payment object
$classPay = new payment($paypalwpp_module);
?><script>
paypal.checkout.setup('<?php echo MODULE_PAYMENT_PAYPALWPP_MERCHANTID; ?>', {
//locale: '<?php echo ${$paypalwpp_module}->getLanguageCode('incontext'); ?>',
<?php
echo (MODULE_PAYMENT_PAYPALWPP_SERVER == 'live' ? '' : "\n environment: 'sandbox',")?>
container: 'PPecic',
buttons: 'ecButton',
click: function() {
paypal.checkout.initXO();
var action = $.post('/set-express-checkout');
action.done(function (data) {
paypal.checkout.startFlow(data.token);
});
action.fail(function () {
paypal.checkout.closeFlow();
});
}
});
</script>
<!-- merchant site HTML page --><script src = "//www.paypalobjects.com/api/checkout.js" async></script><?php
}
Place the file in at least each of the folders in the path includes/modules/pages/
shopping_cart
login
checkout_shipping
checkout_payment
checkout_confirmation
checkout_success
time_out
index
Ie. includes/modules/pages/shopping_cart/jscript_paypal_incontext.php
And any other page that has the PayPal express checkout button or that is or could be a return page displayed to the customer in the checkout process as implemented by modifications made to your site to where a customer could return from PayPal express. (For example, the shipping page can be bypassed using PayPal Express, further the payment page can be bypassed also provided there is no possibility of a coupon being applied, which would deliver the customer to the checkout_confirmation page in a default ZC install.)
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
It looks like you're getting closer, mc12345678, incorporating the Advanced In-Context JavaScript settings suggested by PayPal.
There's an unclosed parentheses in your starting if-clause and I'm wondering what the purpose of setting the $classPay variable is (since it's not referenced within the code you posted).
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
lat9
It looks like you're getting closer, mc12345678, incorporating the
Advanced In-Context JavaScript settings suggested by PayPal.
There's an unclosed parentheses in your starting if-clause and I'm wondering what the purpose of setting the $classPay variable is (since it's not referenced within the code you posted).
If there is its a miracle that the code works on my test site without an error. There are 4 opening and 4 closing parentheses, and they are matched such that a close always closes an open one.
The assignment of $classPay is not as important as the function called to assign it. The variable could likely be unset at the end of the code or not assigned to begin with, but wanted to leave the maximum potential functionality without impacting existing code by otherwise reusing a variable (though somewhat too late in using $paypalwpp_module variable.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Thanks for all your help on this Chad!!
Tested with Firefox, Chrome and Windows Edge - still a "no go" on https://www.tjsattic.com. Have tried from the shopping cart page as well as the login page.
I can see the coding in view source mode. I have other modules and google schema on this site... wonder if I should be testing on a "vanilla" cart?
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
stellarweb
Thanks for all your help on this Chad!!
Tested with Firefox, Chrome and Windows Edge - still a "no go" on
https://www.tjsattic.com. Have tried from the shopping cart page as well as the login page.
I can see the coding in view source mode. I have other modules and google schema on this site... wonder if I should be testing on a "vanilla" cart?
You've definitely got something going on, as when I navigate down to the product level I don't get the css and the images/additional images are all that are presented. I'll try the "buy now" buttons unless you have a different way to get to adding a product to the cart.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
mc12345678
If there is its a miracle that the code works on my test site without an error. There are 4 opening and 4 closing parentheses, and they are matched such that a close always closes an open one.
The assignment of $classPay is not as important as the function called to assign it. The variable could likely be unset at the end of the code or not assigned to begin with, but wanted to leave the maximum potential functionality without impacting existing code by otherwise reusing a variable (though somewhat too late in using $paypalwpp_module variable.
Oops! That "missing" closing paren snuck in as the very last (undisplayed) line of the code.
It's still unclear to me what the instantiation of the paypalwpp payment-class is adding to the mix.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
mc12345678
You've definitely got something going on, as when I navigate down to the product level I don't get the css and the images/additional images are all that are presented. I'll try the "buy now" buttons unless you have a different way to get to adding a product to the cart.
Found that by selecting buy now (although I may want to shop for other things before final purchase) adds the product to the cart. Confirmed that selecting the PayPal express option did not open a new window, but instead redirected from the existing one. Did see the code in the source view. But, found that using an html validator that there are several errors on both the shopping_cart and login pages. Not sure (limited resources at the moment) of the effect of those errors. Seems a lot of odd quote issues and separation from another location. Could have an effect.
A clean install tends to be the best for figuring out an issue as if it works in the base install and not in some other "current" install then there is obviously a difference of importance. :) that's where the tough part comes.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
mc12345678
You've definitely got something going on, as when I navigate down to the product level I don't get the css and the images/additional images are all that are presented. I'll try the "buy now" buttons unless you have a different way to get to adding a product to the cart.
From the shopping-cart page, when I click the "Checkout with PayPal" button, there's the following javascript error reported in the console:
Code:
ReferenceError: paypal is not defined
paypal.checkout.setup('PAYPALCODE', {
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
lat9
Oops! That "missing" closing paren snuck in as the very last (undisplayed) line of the code.
It's still unclear to me what the instantiation of the paypalwpp payment-class is adding to the mix.
Well, as currently implemented in ZC technically nothing as the locale option was disabled in the paypalwpp function process_button, I left it disabled in the above code, but what it does is instantiate $paypalwpp to be of the class payment so that the built in ZC code to provide the getLanguageCode('incontext') response without repeating that code in the event it changes (PayPal modifies areas of concern and ZC follows).
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Ok Chad - I will set up a "vanilla" cart with no modifications to it and test it later today after I have woken up a little bit more! :laugh:
Quote:
Originally Posted by
mc12345678
Found that by selecting buy now (although I may want to shop for other things before final purchase) adds the product to the cart. Confirmed that selecting the PayPal express option did not open a new window, but instead redirected from the existing one. Did see the code in the source view. But, found that using an html validator that there are several errors on both the shopping_cart and login pages. Not sure (limited resources at the moment) of the effect of those errors. Seems a lot of odd quote issues and separation from another location. Could have an effect.
A clean install tends to be the best for figuring out an issue as if it works in the base install and not in some other "current" install then there is obviously a difference of importance. :) that's where the tough part comes.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Cindy - that is definitely in the code of the jscript file on line 9
PHP Code:
paypal.checkout.setup('<?php echo MODULE_PAYMENT_PAYPALWPP_MERCHANTID; ?>', {
I also noticed that when it goes to a new window, it says I can't log in with my own merchant account - but I am not logged into my merchant account at PayPal... so don't know what that's all about! lol
Quote:
Originally Posted by
lat9
From the shopping-cart page, when I click the "Checkout with PayPal" button, there's the following javascript error reported in the console:
Code:
ReferenceError: paypal is not defined
paypal.checkout.setup('PAYPALCODE', {
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
stellarweb
Ok Chad - I will set up a "vanilla" cart with no modifications to it and test it later today after I have woken up a little bit more! :laugh:
Notice that jquery is loaded after the above script instead of before it. That can wreak havoc on things as well...
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
OK - that is above my pay grade! How do I change that? I am using CSS/JS loader to minimize the files - don't know if that has anything to do with it or not.
Quote:
Originally Posted by
mc12345678
Notice that jquery is loaded after the above script instead of before it. That can wreak havoc on things as well...
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
mc12345678
Notice that jquery is loaded after the above script instead of before it. That can wreak havoc on things as well...
Correction, one of three versions of jQuery is loaded after the paypal script. Initially, version 1.7.1 (or whatever content is in the file with that version name in the template, then later if jQuery is not already loaded, version 1.10.2 is loaded (which should not be loaded because of the previous load), and then finally *after* the applicable includes/modules/pages/PAGE_NAME/jscript_ file(s) are loaded then version 1.12.0.min.js is loaded as provided in the template directory (but it is loaded after the occurrence of any other javascript/jquery action(s) and can basically cancel out the previous actions as has been found on the admin side with the way that jquery was implemented there in ZC 1.5.5.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
stellarweb
Cindy - that is definitely in the code of the jscript file on line 9
PHP Code:
paypal.checkout.setup('<?php echo MODULE_PAYMENT_PAYPALWPP_MERCHANTID; ?>', {
I also noticed that when it goes to a new window, it says I can't log in with my own merchant account - but I am not logged into my merchant account at PayPal... so don't know what that's all about! lol
Right, the code that's generating the error is that code on line 9; the paypal object doesn't exist, so the javascript call fails.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
stellarweb
OK - that is above my pay grade! How do I change that? I am using CSS/JS loader to minimize the files - don't know if that has anything to do with it or not.
I'd start at your template's includes/templates/2016/common/html_header.php file and then, well, I assume that the plugin splits off from there possibly before hand. (I've actually somewhat avoided that plugin because of the odd things that it does to a site, but to each their own)... the default html_header.php looks in part like this with jquery loaded before venturing into each of the subsequent load folders:
Code:
/** CDN for jQuery core **/
?>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="//code.jquery.com/jquery-1.12.0.min.js"%3E%3C/script%3E'));</script>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
<?php
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
}
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($page_directory . '/' . $value); echo "\n";
}
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
The solutions here do not work on my vanilla test shop, can someone post a link to a shop or demo that has this working please.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
torvista
The solutions here do not work on my vanilla test shop, can someone post a link to a shop or demo that has this working please.
Ditto, I've tried a couple of things on a ZC1.5.5a test-site to no avail.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I've spent a couple of hours fiddling with Paypals crappy demo and crappy documentation and checkng what it is doing and when before coming to the conclusion...it's complicated!
I don't have clear how the ZC form submission to ipn_handler joins hands with what the popup is expecting...and I need to get some real work done so can't waste all day on this.
Something seems broken in the zc core so some dev input would not go amiss...
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I've only just noticed that this works now, after having done precisely nothing to it since my last post...apart from keep ZC up to date.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
torvista
I've only just noticed that this works now, after having done precisely nothing to it since my last post...apart from keep ZC up to date.
Fascinating :)
Thanks for the update.
-
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Just wondered if this perhaps works for UK stores? I have merchant ID filled and switched on context, but seems to be the same as before. Unless its a template clash with ajax / Javascript, am not sure.