// Stock : removed references to the actual stock management in AdminOrders/Product in order to merge with the new stock management system

This commit is contained in:
bMancone
2011-10-13 15:32:06 +00:00
parent 59d123a311
commit d387633648
2 changed files with 9 additions and 10 deletions
+3 -7
View File
@@ -780,12 +780,8 @@ class AdminOrders extends AdminTab
SELECT id_image SELECT id_image
FROM '._DB_PREFIX_.'image FROM '._DB_PREFIX_.'image
WHERE id_product = '.(int)($product['product_id']).' AND cover = 1'); WHERE id_product = '.(int)($product['product_id']).' AND cover = 1');
$stock = Db::getInstance()->getRow(' // @FIXME
SELECT '.($product['product_attribute_id'] ? 'pa' : 'p').'.quantity $stock = StockManagerFactory::getManager()->getProductRealQuantities($product['product_id'], $product['product_attribute_id'], null, true);
FROM '._DB_PREFIX_.'product p
'.($product['product_attribute_id'] ? 'LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON p.id_product = pa.id_product' : '').'
WHERE p.id_product = '.(int)($product['product_id']).'
'.($product['product_attribute_id'] ? 'AND pa.id_product_attribute = '.(int)($product['product_attribute_id']) : ''));
if (isset($image['id_image'])) if (isset($image['id_image']))
{ {
$target = _PS_TMP_IMG_DIR_.'product_mini_'.(int)($product['product_id']).(isset($product['product_attribute_id']) ? '_'.(int)($product['product_attribute_id']) : '').'.jpg'; $target = _PS_TMP_IMG_DIR_.'product_mini_'.(int)($product['product_id']).(isset($product['product_attribute_id']) ? '_'.(int)($product['product_attribute_id']) : '').'.jpg';
@@ -816,7 +812,7 @@ class AdminOrders extends AdminTab
<td align="center" class="productQuantity" '.($product['product_quantity'] > 1 ? 'style="font-weight:700;font-size:1.1em;color:red"' : '').'>'.(int)$product['product_quantity'].'</td> <td align="center" class="productQuantity" '.($product['product_quantity'] > 1 ? 'style="font-weight:700;font-size:1.1em;color:red"' : '').'>'.(int)$product['product_quantity'].'</td>
'.($order->hasBeenPaid() ? '<td align="center" class="productQuantity">'.(int)($product['product_quantity_refunded']).'</td>' : '').' '.($order->hasBeenPaid() ? '<td align="center" class="productQuantity">'.(int)($product['product_quantity_refunded']).'</td>' : '').'
'.($order->hasBeenDelivered() ? '<td align="center" class="productQuantity">'.(int)($product['product_quantity_return']).'</td>' : '').' '.($order->hasBeenDelivered() ? '<td align="center" class="productQuantity">'.(int)($product['product_quantity_return']).'</td>' : '').'
<td align="center" class="productQuantity">'.$productObj->getStock($product['product_attribute_id']).'</td> <td align="center" class="productQuantity">'.StockManagerFactory::getManager()->getProductRealQuantities($product['product_id'], $product['product_attribute_id'], null, true).'</td>
<td align="center">'.Tools::displayPrice(Tools::ps_round($product_price, 2) * ((int)($product['product_quantity']) - $product['customizationQuantityTotal']), $currency, false).'</td> <td align="center">'.Tools::displayPrice(Tools::ps_round($product_price, 2) * ((int)($product['product_quantity']) - $product['customizationQuantityTotal']), $currency, false).'</td>
<td align="center" class="cancelCheck"> <td align="center" class="cancelCheck">
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="'.(int)($product['product_quantity_return']).'" /> <input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="'.(int)($product['product_quantity_return']).'" />
+4 -1
View File
@@ -336,7 +336,10 @@ class ProductCore extends ObjectModel
$this->tags = Tag::getProductTags((int)$this->id); $this->tags = Tag::getProductTags((int)$this->id);
} }
$this->quantity = $this->getStock(); /**
* @FIXME
*/
$this->quantity = 0;
if ($this->id_category_default) if ($this->id_category_default)
$this->category = Category::getLinkRewrite((int)$this->id_category_default, (int)$id_lang); $this->category = Category::getLinkRewrite((int)$this->id_category_default, (int)$id_lang);