// 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
+4 -8
View File
@@ -780,12 +780,8 @@ class AdminOrders extends AdminTab
SELECT id_image
FROM '._DB_PREFIX_.'image
WHERE id_product = '.(int)($product['product_id']).' AND cover = 1');
$stock = Db::getInstance()->getRow('
SELECT '.($product['product_attribute_id'] ? 'pa' : 'p').'.quantity
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']) : ''));
// @FIXME
$stock = StockManagerFactory::getManager()->getProductRealQuantities($product['product_id'], $product['product_attribute_id'], null, true);
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';
@@ -794,7 +790,7 @@ class AdminOrders extends AdminTab
}
// Customization display
$this->displayCustomizedDatas($customizedDatas, $product, $currency, $image, $tokenCatalog, $k);
if (!isset($product['customizationQuantityTotal']))
$product['customizationQuantityTotal'] = 0;
// Normal display
@@ -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>
'.($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>' : '').'
<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" class="cancelCheck">
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="'.(int)($product['product_quantity_return']).'" />
+5 -2
View File
@@ -196,7 +196,7 @@ class ProductCore extends ObjectModel
protected $langMultiShop = true;
public $cache_is_pack;
public $cache_has_attachments;
public $cache_has_attachments;
public $is_virtual;
public $cache_default_attribute;
@@ -336,7 +336,10 @@ class ProductCore extends ObjectModel
$this->tags = Tag::getProductTags((int)$this->id);
}
$this->quantity = $this->getStock();
/**
* @FIXME
*/
$this->quantity = 0;
if ($this->id_category_default)
$this->category = Category::getLinkRewrite((int)$this->id_category_default, (int)$id_lang);