Orders shows always zero Payment Fee 2.0.22a/b

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Orders shows always zero Payment Fee 2.0.22a/b

Postby io_pas@.....gr » Sun Aug 25, 2013 7:53 am

Hi,

In 2.0.22a and 2.0.22b with com_onepage2.0.191 the orders do not display the Payment Fee. Displays always 0 but the total includes the Payment Fee. For example

SubTotal: 21,90 €
Shipment Fee: 3,80 €
Payment Fee: 0,00 €
Total: 27,50 €

The Payment Fee is 1,80€. It is added to the total but it shows always 0,00€.

I have checked the _virtuemart_orders table and the order_payment has 0.00 instead of 1.80.
io_pas@.....gr
 
Posts: 22
Joined: Sun Aug 25, 2013 7:50 am

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby admin » Mon Aug 26, 2013 5:06 pm

Hello, thank you for the report, we will check this on the latest vm and let you know here. We still do not recommend to use "default caculation rules" for payment or shipping methods - pls check if this could cause it. (either set a specific tax rule or none)
Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby io_pas@.....gr » Mon Aug 26, 2013 5:13 pm

Sorry but what do you mean "default caculation rules" for payment or shipping methods? Do you mean "Tax & Calculation Rules"? No, I do not use them.

In which file you save the order to the db?
io_pas@.....gr
 
Posts: 22
Joined: Sun Aug 25, 2013 7:50 am

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby admin » Mon Aug 26, 2013 7:22 pm

Hello, the order's mysql is created in order model order table object with:

Code: Select all

$orderID = $orderModel->createOrderFromCart($cart);


this is ran in OPC in:
\components\com_onepage\overrides\cart_override.php

i am now checking if the issue is in VM's code or at OPC's $cart object.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby io_pas@.....gr » Tue Aug 27, 2013 3:09 pm

Did you find anything?
io_pas@.....gr
 
Posts: 22
Joined: Sun Aug 25, 2013 7:50 am

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby admin » Wed Aug 28, 2013 11:45 am

Hello, yes, i was able to replicate this on my demos, i am now searching if OPC can fix this or if it's a virtuemart bug. I will release an update within the todays release i believe.
Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby admin » Wed Aug 28, 2013 12:22 pm

Hello, i've just tested this with OPC disabled and it seems to be a VM bug. The reason for this bug is that VM does not fill:

$_orderData->order_payment = $_prices['paymentValue'];
$_orderData->order_payment_tax = $_prices['paymentTax'];

in:
\administrator\components\com_virtuemart\models\orders.php

but uses only $_prices['salesPricePayment'] which is not used in vm2.0.22 order store functions.

you can add a new function within OPC system plugin in /plugins/system/opc/opc.php (will be available in the next release)

Code: Select all
// triggered from: \administrator\components\com_virtuemart\models\orders.php
   public function plgVmOnUserOrder(&$_orderData)
   {
      // fix vm2.0.22 bug
      if (empty($_orderData->order_payment) && (empty($_orderData->order_payment_tax)))
      {
         
       if (!class_exists('VirtueMartCart'))
       require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php');

         
               $cart = VirtueMartCart::getCart();
               $prices = $cart->getCartPrices();
               if (!empty($prices['salesPricePayment']))
               {
                  $_orderData->order_payment = (float)$prices['salesPricePayment'];
               }
         
      }
   }


Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Orders shows always zero Payment Fee 2.0.22a/b

Postby io_pas@.....gr » Thu Aug 29, 2013 6:55 am

Thank you very much Stan.
io_pas@.....gr
 
Posts: 22
Joined: Sun Aug 25, 2013 7:50 am


Return to One Page Checkout for Virtuemart 2