News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Standard and Credit Card payment methods with VM Standard Payment Method

Started by Zekule, February 21, 2012, 14:36:35 PM

Previous topic - Next topic

Zekule

Hello,

I need to create 2 payment methods on my VM Store. 1st is the COD and I managed to configure that. The second one is Credit Card payment with my own processor (Cpay processor in my country which I need to integrate in thank you page). So the problem is when I create 2 VM Standard payment methods the payment processor is showing on thank you pages at both methods. I need to exclude from the COD payment method. That's why I think I need 2 thank you pages. I can configure order_done.php to show my payment processor but I dont know how to forward my COD payment method to order_done2.php page which I created as default order_done.php page where there is no payment processor.

EDIT:

I just need php code for if, else command to insert into components/com_virtuemart/views/cart/view.html.php for virtuemart_paymentmethod_id from database...

so it will be something like:

if {virtuemart_paymentmethod_id=5                  (5 is the payment method id from database)

echo $this->order_done;

} else if ($layoutName == 'order_done2') {virtuemart_paymentmethod_id=4                       (where 4 is standard payment method and I will use it for COD or pro-forma payment)...


$pathway->addItem(JText::_('COM_VIRTUEMART_CART_OVERVIEW'), JRoute::_('index.php?option=com_virtuemart&view=cart'));
         $pathway->addItem(JText::_('COM_VIRTUEMART_CART_SELECTPAYMENT'));
         $document->setTitle(JText::_('COM_VIRTUEMART_CART_SELECTPAYMENT'));
      } else if ($layoutName == 'order_done') {

         $this->lOrderDone();

         $pathway->addItem(JText::_('COM_VIRTUEMART_CART_THANKYOU'));
         $document->setTitle(JText::_('COM_VIRTUEMART_CART_THANKYOU'));
      } else if ($layoutName == 'default') {


I think here I need to insert that function to check database

if it is virtuemart_paymentmethod_id=5 to echo (order_done2)
else echo (order_done)

also need to change components/com_virtuemart/controllers/cart.php

$cart = VirtueMartCart::getCart(false);
   if ($cart) {
       $cart->confirmDone();
       $view = $this->getView('cart', 'html');
       $view->setLayout('order_done');
       /* Display it all */
       $view->display();


I need to change both of them in order_done2 so it will display order_done2.php file created by me. So now I just need to check the database for virtuemart_payment_method_id to show different view with $view->setLayout.... command...

Come on please somebody with php knowledge...

HELP HELP HELP PLEASE...

Thanks in advance.


alatak


Zekule

Thank you for your reply.

The thing is I dont need OCC payment. I need to integrate my Cpay processor in thank you page. And when I do that I got the payment processor on all payments thank you page. I managed to copy/paste standard payment code into paypal payment and it is working in the same way like standard. So I just need now to forward the paypal payment method on order_done2.php (as I dont need paypal, I will use it for my own processor). I dont know where can I do this (I know where to find order_done code, but I dont know where to find the code before that redirecting in payment plugin code so it can go for example on cart2.php and view.html2.php and default2.php) so I wont have my payment processor on every thank you page and I can create different thank you pages on every payment method.

Thank you very much indeed in advance if you help me.

Best,

Zarko