Jump to content
138th st

Remove "choose your payment method" if there is only one payment method

Recommended Posts

Is there an easy way to do this? We are using paypal API and it seems redundant to say okay at that point, again.
It would be great to jump from shipping right to the Order Summary

Any way to do this for paypal api
Thank you guys!

Share this post


Link to post
Share on other sites

I would also like to know how to do this. I am only using Google Checkout and would like to go directly to the google page or even integrate it into the payment page

Share this post


Link to post
Share on other sites

The problem with this is that each payment method handles the "click" on it differently.
Some redirect to a new page, but some have a hidden form with variables that need to be sent.
Not sure how hard it would be to overcome that.

Share this post


Link to post
Share on other sites
The problem with this is that each payment method handles the "click" on it differently.
Some redirect to a new page, but some have a hidden form with variables that need to be sent.
Not sure how hard it would be to overcome that.


I would like to modify my ordering process by skiping some oredering steps. below is explanation of my problem

I have two carriers and for each carrier there is only one payment option available. Is it possible to modify ordering steps so after the carrier option is selected in next step also specific payment option is validated. There is no need in the second step after the selection of carrier to choose the payment option again.

So It should go like this:

Step1 (registration or login)
Step2 (confirming addresses)
Step3 (choosing carrier)
Step 4 (comfirming order/validation)

Please someone help me with instruction how to modify the code or with other advices how to acheive this.

Kind regards,

Tine Chem

Share this post


Link to post
Share on other sites

@Tine Chem

We have also had this scenario - to skip the Payment Provider choice page you need to edit the order-carrier.tpl file within your theme. In other words the page before the Payment Provider choice page and change the form action so that it goes straight to your preferred payment providers form.

We are using SagePay/Protx VSP Direct so I modified my order-carrier.tpl at line 29:

From:

<form id="form" action="{$base_dir_ssl}order.php" method="post">



To:

<form id="form" action="{$base_dir_ssl}modules/vspdirect/form.php" method="post">



This takes me straight into my preferred provider and retains all of the choices made so far (address, cart contents, value etc).

Hope this helps you
Clive

Share this post


Link to post
Share on other sites
@Tine Chem

We have also had this scenario - to skip the Payment Provider choice page you need to edit the order-carrier.tpl file within your theme. In other words the page before the Payment Provider choice page and change the form action so that it goes straight to your preferred payment providers form.

We are using SagePay/Protx VSP Direct so I modified my order-carrier.tpl at line 29:

From:

<form id="form" action="{$base_dir_ssl}order.php" method="post">



To:

<form id="form" action="{$base_dir_ssl}modules/vspdirect/form.php" method="post">



This takes me straight into my preferred provider and retains all of the choices made so far (address, cart contents, value etc).

Hope this helps you
Clive





Thanks Clive!!!
I adjusted for PayPal, So if anyone else needs PayPal to be auto selected then use this line instead of Clives SagePay (VSPDirect) line.

<form id="form" action="{$base_dir_ssl}modules/paypal/redirect.php" method="post"> 



Regards
Dan.

Share this post


Link to post
Share on other sites

Is there any way to do this with the paypal that comes with prestashop v 1.2.5? I have no redirect.php in the paypal module folder.

Share this post


Link to post
Share on other sites

Is this still do-able with the new theme? Really need to get this working .

Share this post


Link to post
Share on other sites

I also need this customization any ideas for prestashop version 1.4.7

Share this post


Link to post
Share on other sites

For 1.4.8, it's located near line 84.

 

E.g. change

<form id="form" action="{$link->getPageLink('order.php', true)}" method="post" onsubmit="return acceptCGV();">

 

to

 

<form id="form" action="{$link->getPageLink('modules/paypal/redirect.php', true)}" method="post" onsubmit="return acceptCGV();">

 

(note: I didn't test this myself)

Share this post


Link to post
Share on other sites

Here's a tested and working solution for 1.4.8:

 

Edit OrderController.php (in override folder):

 

Addt his after $this->_assignPayment(); , in case 3: of switch ((int)$this->step) in public function process()

 

Tools::redirect('modules/YOUR_PAYMENT_MODULE/validation.php');

 

 

I also edited the validation.tpl of the payment provider I use so the 'Go Back' button works properly:

 

<a href="{$link->getPageLink('order.php', true)}?step=2" class="button">{l s='Terug' mod='cashondelivery'}</a> <!-- step 2 instead of 3 -->

 

Cheers,

Edited by Tito (see edit history)

Share this post


Link to post
Share on other sites

I tried your solution Tito, but i get a blank page. Could you please explain in steps?

 

thanks

Share this post


Link to post
Share on other sites

I tried your solution Tito, but i get a blank page. Could you please explain in steps?

 

thanks

 

This is my process method in OrderController.php:

 

public function process()
{
 global $cookie;
 parent::process();
 //print_r($this->step);

 /*
 echo "<pre>";
  print_r($cookie->id_customer);
  print_r($cookie->id_customer);
 echo "</pre>";
 //*/
 /* 4 steps to the order */
 switch ((int)$this->step)
 {
  case -1;
   self::$smarty->assign('empty', 1);
   break;
  case 1:
   $this->_assignAddress();
   break;
  case 2:
   $this->_assignAddress();
   if (Tools::isSubmit('processAddress'))
 $this->processAddress();
   $this->autoStep();
   $this->_assignCarrier();
   break;
  case 3:
   //Test that the conditions (so active) were accepted by the customer
   if ($cgv = Tools::getValue('cgv'))
 $cookie->cgv = $cgv;
   else
 $cgv = (isset($cookie->cgv) ? $cookie->cgv : false);
   if (Configuration::get('PS_CONDITIONS') AND (!Validate::isBool($cgv) OR $cgv == false))
 Tools::redirect('order.php?step=2');
   $this->autoStep();
   /* Bypass payment step if total is 0 */
   if (($id_order = $this->_checkFreeOrder()) AND $id_order)
   {
 if (self::$cookie->is_guest)
 {
  $email = self::$cookie->email;
  self::$cookie->mylogout(); // If guest we clear the cookie for security reason
  Tools::redirect('guest-tracking.php?id_order='.(int)$id_order.'&email='.urlencode($email));
 }
 else
  Tools::redirect('history.php');
   }
   $this->_assignPayment();
   Tools::redirect('modules/cashondelivery/validation.php');
   break;
  default:
   $this->_assignSummaryInformations();
   break;
 }
}

Share this post


Link to post
Share on other sites

I think that is an issue. Probably on the one page checkout there would be nice to display a big button or text at the bottom to notify users about they have to click on that only available payment option.

 

I would like to add a sort note to order-payment.tpl

Is is possible check the number of enabled payment modules?

If $countpaymantmodules==1 that echo "please click on the only one payment option below"

Edited by hypermedia (see edit history)

Share this post


Link to post
Share on other sites

It works if there's only one payment method, in my shop I have a few carriers and payments and I'd like to keep them. Do you know how make presta skip 'Choose payment method" in case of using Cash on Delivery (only).

Share this post


Link to post
Share on other sites

Hi guys,

I'm becomeing crazy! I have some products that i need to check the shipping price, so if a customer buy the product with (T) : ex of product name: " football gol (T) " when he go to buy prestashop must delete payment option, so i can make the full price. Is it possible?

Looks like Tito where he has:

 

/* Bypass payment step if total is 0 */

if (($id_order = $this->_checkFreeOrder()) AND $id_order)

 

i need something like: if (T) delete payment options.

 

THX!

Share this post


Link to post
Share on other sites

hi Tito , could you please tell me how to edit validation.php ? which line i have to put that?

Thanks

Share this post


Link to post
Share on other sites

Hum... I don`t understand somebody trying this on 1.5.x? I trying to use cash on delivery method but i lose.

 

How to use cash on delivery in 1.5.3 presta?

Share this post


Link to post
Share on other sites

Hi!

 

I'm trying to figure it out how to do it in PS1.6.

 

The code under question is

<form id="form" action="{$link->getPageLink('order', true, NULL, "multi-shipping=$multi_shipping}")|escape:'html':'UTF-8'}" method="post" name="carrier_area">

 

I want that "cash on delivery" is my default and only payment method so no need to give customer any chances to see this options.

 

Please help me with this.

Share this post


Link to post
Share on other sites

Anyone, please! It is important to me to make shopping as simple as possible.

 

Thanks!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More