VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: arnask on November 09, 2011, 14:26:20 pm

Title: [Solved] No price in emails
Post by: arnask on November 09, 2011, 14:26:20 pm
If someone buys smth, puts it in cart and checks out. The mail is sent to admin and client. But in this mail there is no price, everywhere is zeros.
In backend everything looks fine.

P.S. 2.0.0-RC-2M
Title: Re: No price in emails
Post by: alatak on November 09, 2011, 15:42:18 pm
Hi,

Please, which payment method?

txs.
Title: Re: No price in emails
Post by: arnask on November 09, 2011, 15:50:22 pm
Hi,

Please, which payment method?

txs.
standard
Title: Re: No price in emails
Post by: zzsser on November 10, 2011, 00:31:21 am
Same issue and I use the standard payment too!

Since I updated version RC2K to version VM 2.0.0 RC2M, the total amount to pay in e-mail (order confirmation) is incorrect (no products and so prices empty). Only the shipping costs are displayed. All ordered products have disapeared. This is only in this e-mail. On the confirmation page, everything is correct.
Title: Re: No price in emails
Post by: alatak on November 10, 2011, 08:47:07 am
Hi,

txs for reporting. i will have a look.
Title: Re: No price in emails
Post by: zzsser on November 12, 2011, 22:45:03 pm
Merci d'avance  ;)
Title: Re: No price in emails
Post by: kpg on November 12, 2011, 23:53:49 pm
Same issue and I use the standard payment too!

Since I updated version RC2K to version VM 2.0.0 RC2M, the total amount to pay in e-mail (order confirmation) is incorrect (no products and so prices empty). Only the shipping costs are displayed. All ordered products have disapeared. This is only in this e-mail. On the confirmation page, everything is correct.


Hi,


If got the same Problem with the 1.9.8M Version. I use the html Mail and looked at the hints i get on that treat. http://forum.virtuemart.net/index.php?topic=82614.msg272453#msg272453
But i couldn't find a bug there. It should be the Plugin.

@alatak Thx for the work.

Tobi
Title: Re: No price in emails
Post by: alatak on November 13, 2011, 10:04:59 am
Hi,

Yes i saw the problem :(
It has been corrected.
Quote
@alatak Thx for the work.
txs :)
Title: Re: No price in emails
Post by: kpg on November 14, 2011, 10:54:06 am
Cool! That is great news.

Could you tell me what the solution was? And can i integrate the fix allready in my version? Raw code will do.  That would be awsome :-)

Or will it be in the N-Version?

Thx

Tobi
Title: Re: No price in emails
Post by: LotusRouge on November 15, 2011, 11:33:30 am
Hi,

As kpg I've got the same issue, and would desperately like to know what is the fix for this pb, if possible before the N-version ?

Thx

Fab
Title: Re: No price in emails
Post by: 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
Title: Re: No price in emails
Post by: Gyuri on November 17, 2011, 07:10:02 am
Slow fix:

write this function, and convert order array into a cart, order data are here, but the mail content generation uses cart :(

   function prepareMailData(){

      if(empty($this->vendor)) $this->prepareVendor();
      //TODO add orders, for the orderId
      //TODO add registering userdata
      // In general we need for every mail the shopperdata (with group), the vendor data, shopperemail, shopperusername, and so on
   }

Gyuri
Title: Re: No price in emails
Post by: Robsone on November 17, 2011, 21:35:44 pm
Fast fix works for me :). THX a lot Gyuri !
Title: Re: No price in emails
Post by: Patrick on November 18, 2011, 18:51:14 pm
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

Thanks!!!!!

I only removed the first mentioned  "$this->emptyCart();"  the other one was allready in place where it should be.
I did a clean install J1.7 and VM2.0RC so RC ! @development remove the first one in the final release, that should fix it for multiple users.

Thanks Patrick




Title: Re: No price in emails
Post by: alatak on November 20, 2011, 18:28:47 pm
Hi,

Quote
I did a clean install J1.7 and VM2.0RC so RC ! @development remove the first one in the final release, that should fix it for multiple users.
Ths fix has been added already:)
Title: Re: [Solved] No price in emails
Post by: mansonul on November 24, 2011, 09:05:46 am
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!!!
Title: Re: [Solved] No price in emails
Post by: Patrick on November 24, 2011, 09:13:54 am
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

Title: Re: [Solved] No price in emails
Post by: mansonul on November 24, 2011, 09:19:53 am
Proof enough....  ;D
Title: Re: [Solved] No price in emails
Post by: kpg on November 24, 2011, 18:56:26 pm
@Patrick,

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

Regards
Title: Re: No price in emails
Post by: magicf on December 09, 2011, 23:42:00 pm
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!!