// More BO product page cleanup
This commit is contained in:
@@ -36,6 +36,9 @@ class PackCore extends Product
|
||||
if (!Pack::isFeatureActive())
|
||||
return false;
|
||||
|
||||
if (!$id_product)
|
||||
return false;
|
||||
|
||||
if (!array_key_exists($id_product, self::$cacheIsPack))
|
||||
{
|
||||
$result = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'pack WHERE id_product_pack = '.(int)$id_product);
|
||||
|
||||
@@ -4907,4 +4907,21 @@ class ProductCore extends ObjectModel
|
||||
return $this->deleteAttributeCombination($id_lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the product type (simple, virtual, pack)
|
||||
* @since in 1.5.0
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
if (!$this->id)
|
||||
return Product::PTYPE_SIMPLE;
|
||||
if (Pack::isPack($this->id))
|
||||
return Product::PTYPE_PACK;
|
||||
if ($this->is_virtual)
|
||||
return Product::PTYPE_VIRTUAL;
|
||||
|
||||
return Product::PTYPE_SIMPLE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user