Jump to content

Problem with quantity ordered quantity and quantity on invoice


Recommended Posts

Hi!

I have one big problem. In my shop, when I order som quantity of product (i.e. 10 and in stock there ist 500 pieces of this product), everything is all right until I want to see details of order, there is not quantity of bought product, but quantity in stock, how can i fix it ?? ... My version is PS 1.3.1. See image in attachement and pdf.


Thanks for any help !!!


/sorry for my english, i am slovak :)

33367_ths6xioxZ0tCKkVpqBLt_t

000011.pdf

Link to comment
Share on other sites

This is an old bug that was fixed a long time ago. I'm not sure why it is affecting you. Is the quantity correct on the shopping cart summary? If so, then it must be the payment module. Check it's TPL code and make sure that cart_quantity is being used and not stock_quantity or just quantity.

Link to comment
Share on other sites

Ok, you were right, problem is somewhere in .php file, not tpl, i think problem is in this piece of code:

/* Query */

               /* end foreach ($products) */
               $query = rtrim($query, ',');
               $result = $db->Execute($query);

               /* Insert discounts from cart into order_discount table */
               $discounts = $cart->getDiscounts();
               $discountsList = '';
               foreach ($discounts AS $discount)
               {
                   $objDiscount = new Discount(intval($discount['id_discount']));
                   $value = $objDiscount->getValue(sizeof($discounts), $cart->getOrderTotal(true, 1), $order->total_shipping, $cart->id);
                   $order->addDiscount($objDiscount->id, $objDiscount->name, $value);
                   if ($id_order_state != _PS_OS_ERROR_ AND $id_order_state != _PS_OS_CANCELED_)
                       $objDiscount->quantity = $objDiscount->quantity - 1;
                   $objDiscount->update();

                   $discountsList .=
                   '
'.$this->l('Voucher code:').' '.$objDiscount->name.'
-'.Tools::displayPrice($value, $currency, false, false).'
';
               }

               /* Specify order id for message */
               $oldMessage = Message::getMessageByCartId(intval($cart->id));
               if ($oldMessage)
               {
                   $message = new Message(intval($oldMessage['id_message']));
                   $message->id_order = intval($order->id);
                   $message->update();
               }

               /* Hook new order */
               $orderStatus = new OrderState(intval($id_order_state));
               if (Validate::isLoadedObject($orderStatus))
               {
                   Hook::newOrder($cart, $order, $customer, $currency, $orderStatus);
                   foreach ($cart->getProducts() as $product)
                       if ($orderStatus->logable)
                           ProductSale::addProductSale($product['id_product'], $product['quantity']);
               }



But I cant find any error. I re

cashondeliverywithfee.php

Link to comment
Share on other sites

×
×
  • Create New...