// Fix #PSCFV-4136
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17400 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -628,16 +628,18 @@ class OrderCore extends ObjectModel
|
||||
{
|
||||
if (isset($product['product_attribute_id']) && $product['product_attribute_id'])
|
||||
$id_image = Db::getInstance()->getValue('
|
||||
SELECT id_image
|
||||
FROM '._DB_PREFIX_.'product_attribute_image
|
||||
SELECT image_shop.id_image
|
||||
FROM '._DB_PREFIX_.'product_attribute_image pai'.
|
||||
Shop::addSqlAssociation('image', 'pai', true).'
|
||||
WHERE id_product_attribute = '.(int)$product['product_attribute_id']);
|
||||
|
||||
if (!isset($id_image) || !$id_image)
|
||||
$id_image = Db::getInstance()->getValue('
|
||||
SELECT id_image
|
||||
FROM '._DB_PREFIX_.'image
|
||||
WHERE id_product = '.(int)($product['product_id']).' AND cover = 1
|
||||
');
|
||||
SELECT image_shop.id_image
|
||||
FROM '._DB_PREFIX_.'image i'.
|
||||
Shop::addSqlAssociation('image', 'i', true, 'image_shop.cover=1').'
|
||||
WHERE id_product = '.(int)($product['product_id'])
|
||||
);
|
||||
|
||||
$product['image'] = null;
|
||||
$product['image_size'] = null;
|
||||
|
||||
@@ -208,14 +208,15 @@ class OrderInvoiceCore extends ObjectModel
|
||||
{
|
||||
if (isset($product['product_attribute_id']) && $product['product_attribute_id'])
|
||||
$id_image = Db::getInstance()->getValue('
|
||||
SELECT id_image
|
||||
FROM '._DB_PREFIX_.'product_attribute_image
|
||||
SELECT image_shop.id_image
|
||||
FROM '._DB_PREFIX_.'product_attribute_image pai'.
|
||||
Shop::addSqlAssociation('image', 'pai', true).'
|
||||
WHERE id_product_attribute = '.(int)$product['product_attribute_id']);
|
||||
|
||||
if (!isset($image['id_image']) || !$image['id_image'])
|
||||
if (!isset($id_image) || !$id_image)
|
||||
$id_image = Db::getInstance()->getValue('
|
||||
SELECT id_image
|
||||
FROM '._DB_PREFIX_.'image'.
|
||||
SELECT image_shop.id_image
|
||||
FROM '._DB_PREFIX_.'image i'.
|
||||
Shop::addSqlAssociation('image', 'i', true, 'image_shop.cover=1').'
|
||||
WHERE id_product = '.(int)($product['product_id']));
|
||||
|
||||
@@ -666,4 +667,4 @@ class OrderInvoiceCore extends ObjectModel
|
||||
|
||||
return $is_correct;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user