fix conflict

This commit is contained in:
Marion Muszynski 2016-09-05 10:26:06 +02:00
commit 3389d9d3ad

View File

@ -8,24 +8,24 @@ class ProductController extends ProductControllerCore {
$sale = Sale::getSaleFromCategory($id_category);
/* Find out the good Category for thumb*/
$found_category = false;
if (isset($_SERVER['HTTP_REFERER']) AND preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) AND !strstr($_SERVER['HTTP_REFERER'], '.html'))
{
if (isset($regs[2]) AND is_numeric($regs[2]))
{
if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[2])))))
$found_category = (int)$regs[2];
}
elseif (isset($regs[5]) AND is_numeric($regs[5]))
{
if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[5])))))
$found_category = (int)$regs[5];
}
}
$found_category = false;
if (isset($_SERVER['HTTP_REFERER']) AND preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) AND !strstr($_SERVER['HTTP_REFERER'], '.html'))
{
if (isset($regs[2]) AND is_numeric($regs[2]))
{
if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[2])))))
$found_category = (int)$regs[2];
}
elseif (isset($regs[5]) AND is_numeric($regs[5]))
{
if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[5])))))
$found_category = (int)$regs[5];
}
}
if ($found_category && file_exists(_PS_ROOT_DIR_.'/img/c/'.(int)$found_category.'_thumb_vp.jpg') && $found_category != $sale->id_category) {
$id_category_thumb = $found_category;
} elseif (file_exists(_PS_ROOT_DIR_.'/img/c/'.(int)$id_category.'_thumb_vp.jpg') && $id_category != $sale->id_category) {
if ($found_category && file_exists(_PS_ROOT_DIR_.'/img/c/'.(int)$found_category.'_thumb_vp.jpg') && $found_category != $sale->id_category) {
$id_category_thumb = $found_category;
} elseif (file_exists(_PS_ROOT_DIR_.'/img/c/'.(int)$id_category.'_thumb_vp.jpg') && $id_category != $sale->id_category) {
$id_category_thumb = $id_category;
} else {
$id_category_thumb = $sale->id_category;