Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/18/2019 in all areas

  1. 1 point
    Hi, you are entirely correct, well spotted and that is odd! When using the code tags in this forum, if you edit the content of a code tag after setting it (which I did a few times), it translates the &amp; into &. Annoying!! Correct code below, unfortunately the forum isn't allowing me to edit my posts any longer. ANYONE READING THIS FOR THE FIRST TIME USE THE INSTRUCTIONS AND CODE BELOW AND NOT THE CODE ABOVE First of all in your store admin, make sure Telephone Number and Seamless Checkout is unticked, then save the settings. Note: Possible ongoing problems. Seamless checkout previously allowed users who have logged in via "Log In with PayPal" to continue to make payment without logging in again. As PayPal has removed Seamless as a scope item I'm not sure if customers will have to login again to PayPal once they get to payment method selection or click a Checkout with PayPal button. The new connect/api.js may compensate for this automatically but I haven't tested that far yet so cannot comment either way. In includes/modules/content/login/templates/paypal_login starting line 18 Find: <script type="text/javascript" src="https://www.paypalobjects.com/js/external/api.js"></script> <script type="text/javascript"> paypal.use( ["login"], function(login) { login.render ({ <?php if ( OSCOM_APP_PAYPAL_LOGIN_STATUS == '0' ) { echo ' "authend": "sandbox",'; } if ( OSCOM_APP_PAYPAL_LOGIN_THEME == 'Neutral' ) { echo ' "theme": "neutral",'; } ?> "locale": "<?php echo $cm_paypal_login->_app->getDef('module_login_language_locale'); ?>", "appid": "<?php echo (OSCOM_APP_PAYPAL_LOGIN_STATUS == '1') ? OSCOM_APP_PAYPAL_LOGIN_LIVE_CLIENT_ID : OSCOM_APP_PAYPAL_LOGIN_SANDBOX_CLIENT_ID; ?>", "scopes": "<?php echo implode(' ', $use_scopes); ?>", "containerid": "PayPalLoginButton", "returnurl": "<?php echo str_replace('&amp;', '&', tep_href_link(FILENAME_LOGIN, 'action=paypal_login', 'SSL', false)); ?>" }); }); </script> Replace with: <script type="text/javascript" src="https://www.paypalobjects.com/js/external/connect/api.js"></script> <script type="text/javascript"> paypal.use( ["login"], function(login) { login.render ({ <?php if ( OSCOM_APP_PAYPAL_LOGIN_STATUS == '0' ) { echo ' "authend": "sandbox",'; } if ( OSCOM_APP_PAYPAL_LOGIN_THEME == 'Neutral' ) { echo ' "theme": "neutral",'; } ?> "responseType" : "code id_Token", "locale": "<?php echo $cm_paypal_login->_app->getDef('module_login_language_locale'); ?>", "appid": "<?php echo (OSCOM_APP_PAYPAL_LOGIN_STATUS == '1') ? OSCOM_APP_PAYPAL_LOGIN_LIVE_CLIENT_ID : OSCOM_APP_PAYPAL_LOGIN_SANDBOX_CLIENT_ID; ?>", "scopes": "<?php echo implode(' ', $use_scopes); ?>", "buttonType" : "CWP", "buttonShape" : "rectangle", "buttonSize" : "md", "fullPage" : "false", "containerid": "PayPalLoginButton", "returnurl": "<?php echo str_replace('&amp;', '&', tep_href_link(FILENAME_LOGIN, 'action=paypal_login', 'SSL', false)); ?>" }); }); </script> In includes/modules/content/login/cm_paypal_login.php on line 259 (to prevent a blank/white screen once a user has logged in via PayPal when returning to the store). Find: echo '<script>window.opener.location.href="' . str_replace('&amp;', '&', $return_url) . '";window.close();</script>'; Replace with: echo '<script> if( typeof window.opener === \'undefined\' || window.opener === null ){ window.location.href="' . str_replace('&amp;', '&', $return_url) . '"; }else{ window.opener.location.href="' . str_replace('&amp;', '&', $return_url) . '"; window.close(); } </script>';
×