Jump to content

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

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
  • 2 weeks later...

@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
  • 10 months later...
@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
  • 3 months later...
  • 9 months later...
  • 5 months later...
  • 1 month later...

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
  • 4 weeks later...

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
  • 2 weeks later...

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
  • 1 month later...

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
  • 4 weeks later...

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
  • 2 weeks later...

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
  • 2 weeks later...
  • 3 months later...
  • 1 year later...

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
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