News:

Looking for documentation? Take a look on our wiki

Main Menu

[Solved] No price in emails

Started by arnask, November 09, 2011, 14:26:20 PM

Previous topic - Next topic

mansonul

#15
PLEASE, make it idiot proof...

I don`t understand wich code (from where to where) to move...

L.E.: I did commented out "$this->emptyCart();" and worked like charm!!!

Patrick

In the file search for -->  $this->emptyCart();

It should be after the lines

foreach ($returnValues as $returnValue) {
            if ($returnValue !== null  ) {
               if ($returnValue == 1 )   {
remove this  ------>           $this->emptyCart();

Second one should be after ---->
$this->sentOrderConfirmedEmail($order->getOrder($orderID));
                  //We delete the old stuff

If it isn't copy it after, what to copy ---> $this->emptyCart();


If this isn't idiot proof enough?

Patrick


mansonul


kpg

@Patrick,

Thanks for your help. I almost forgot to thank you.

Regards

magicf

Quote from: Gyuri on November 17, 2011, 07:06:26 AM
Hi, fast fix, working for me, is to move the emptycart function after the mail generation like this:

in \helpers\cart.php
in private function confirmedOrder() {

foreach ($returnValues as $returnValue) {
            if ($returnValue !== null  ) {
               if ($returnValue == 1 )   {
// FROM HERE -->
                  JRequest::setVar('html' , $html);
                   // send the email only if payment has been accepted
                  // update status?
                  if ($new_status) {
                      if (!class_exists('VirtueMartModelOrders'))
                     require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
                      $modelOrder = new VirtueMartModelOrders();
                      $orders[$orderID]['order_status'] = $new_status;
                      $orders[$orderID]['virtuemart_order_id'] = $orderID;
                      $orders[$orderID]['customer_notified'] = 0;
                      $orders[$orderID]['comments'] = '';
                      $modelOrder->updateOrderStatus($orders, $orderID); //   
                  }                  
/*mail sending */                   $this->sentOrderConfirmedEmail($order->getOrder($orderID));
                  //We delete the old stuff
/* MOVED HERE -->*/      $this->emptyCart();

Gyuri

I use 1.9.8RC2M and this fix works for me. THANK YOU!!