VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: zainabubu on November 14, 2013, 19:32:24 PM

Title: How to Skip order_done before making payment
Post by: zainabubu on November 14, 2013, 19:32:24 PM
Hello,

Please how do I skip the "thank you for your order" page that shows before the payment page? I see that some websites that use vm don't have it, but I've been unable to find a solution for this problem. Help would be deeply appreciated.
Title: Re: How to Skip order_done before making payment
Post by: GJC Web Design on November 14, 2013, 21:26:38 PM
This is normally controlled by each individual payment plugin by the plgVmConfirmedOrder() function called by cart.php

For example the native paypal plug uses

$html = '<html><head><title>Redirection</title></head><body><div style="margin: auto; text-align: center;">';
$html .= '<form action="' . "https://" . $url . '" method="post" name="vm_paypal_form"  accept-charset="UTF-8">';
$html .= '<input type="submit"  value="' . JText::_('VMPAYMENT_PAYPAL_REDIRECT_MESSAGE') . '" />';
$html .= '<input type="hidden" name="charset" value="utf-8">';
foreach ($post_variables as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
}
$html .= '</form>';
$html .= ' <script type="text/javascript">';
$html .= ' document.vm_paypal_form.submit();';
$html .= ' </script></body></html>';


so it all depends what payment plugin your using
Title: Re: How to Skip order_done before making payment
Post by: zainabubu on November 14, 2013, 21:38:23 PM
Ok, many thanks. I had a payment plugin built for my site, will let developer know.
Title: Re: How to Skip order_done before making payment
Post by: zainabubu on November 15, 2013, 16:36:42 PM
Hello,

Another problem I'm facing is multiple creations of the same cart in a session. In my case, when a client gets returned from the payment gateway due to whatever payment failure and want to purchase using a payment method, they get returned to the cart with the items still in them (which is great). The problem is every time they try to pay again, a different invoice is created and so I have a lot of pending invoices on my back end.

Can't the same invoice # be called on to get this done instead of a new one getting created all the time?
Title: Re: How to Skip order_done before making payment
Post by: GJC Web Design on November 15, 2013, 17:07:19 PM
this I would think is down to your custom payment plugin - there are lots of functions within the plugin that need to be called correctly..

Test against something like the Paypal plugin to see the correct operation