rssurvivor Posted December 10, 2012 Share Posted December 10, 2012 (edited) Hi, I am currently working on a shop, and am having some issues with modifying a module. Because I want to offer a separate link for Paypal and Creditcard through Paypal, my first thought was to duplicate the module, with the only difference that one of the modules had the flag LANDINGPAGE set to Billing, which will result in showing the credit card input form, and the other LANDINGPAGE flag set to Login which will show the Paypal login page. But, duplicating the Paypal module seems to be impossible. Is there a better solution, or is there a way I can duplicate the module? Thanks! EDIT: I solved this as following (using express checkout): Duplicate /expresscheckout/paypal_express_checkout.php and /expresscheckout/submit.php and rename them paypal_express_checkout2.php and submit2.php. Then open /views/templates/front/express_checkout/paypal.tpl and find: <form id="paypal_payment_form" action="{$base_dir_ssl}modules/paypal/express_checkout/submit.php" data-ajax="false" title="{l s='Pay with Creditcard' mod='paypal'}" method="post"> <input type="hidden" name="express_checkout" value="{$PayPal_payment_type}"/> <input type="hidden" name="current_shop_url" value="{$PayPal_current_shop_url}" /> </form> After this add: <!-- Second push button for creditcard --> <p class="payment_module"> <a href="javascript:void(0)" onclick="$('#paypal_payment_form2').submit();" id="paypal_process_payment" title="{l s='Pay with Creditcard' mod='paypal'}"> {if isset($use_mobile) && $use_mobile} <img src="{$base_dir_ssl}modules/paypal/img/logos/express_checkout_mobile/CO_{$PayPal_lang_code}_orange_295x43.png" /> {else} {if isset($logos.LocalPayPalHorizontalSolutionPP) && $PayPal_payment_method == $PayPal_integral} <img src="{$logos.LocalPayPalHorizontalSolutionPP}" alt="{$PayPal_content.payment_choice}" height="48px" /> {else} <img src="{$logos.LocalPayPalLogoMedium}" alt="{$PayPal_content.payment_choice}" /> {/if} {l s='Pay with Credit Card' mod='paypal'} {/if} </a> </p> <form id="paypal_payment_form2" action="{$base_dir_ssl}modules/paypal/express_checkout/submit2.php" data-ajax="false" title="{l s='Pay with Credit Card' mod='paypal'}" method="post"> <input type="hidden" name="express_checkout" value="{$PayPal_payment_type}"/> <input type="hidden" name="current_shop_url" value="{$PayPal_current_shop_url}" /> </form> Save your files and it should work! Edited December 10, 2012 by rssurvivor (see edit history) Link to comment Share on other sites More sharing options...
xavdpub Posted March 20, 2013 Share Posted March 20, 2013 Hi Great insights ! 2 remarks and 1 question : - i assume the file to duplicate is "payment;php" - On prestashop 1.5.2, this file is on templates/hook (not front) Now the question, managing your solution and the above, i manage to duplicate the button but both are landing on the same spot (paypal account) and i can t have one opening the credit card one directly How did you make it ? Any change to perform on submit2 and/or payment2 ? Thanks Link to comment Share on other sites More sharing options...
maximilian8777 Posted September 14, 2015 Share Posted September 14, 2015 This solution works with prestashop 1.6 and last versione of paypal module? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now