[-] CORE : fixed bug #PSCFV-4754 Image sizes are the same for all shops and themes

This commit is contained in:
vAugagneur committed 2012-12-18 14:59:34 +01:00
1 parent 270ae41d15
commit ef0eb49ba9
19 files changed
+80 -57

No files matched your search

+31 -12
View File
@@ -78,6 +78,8 @@ class ImageTypeCore extends ObjectModel
* @var array Image types cache * @var array Image types cache
*/ */
protected static $images_types_cache = array(); protected static $images_types_cache = array();
protected static $images_types_name_cache = array();
protected $webserviceParameters = array(); protected $webserviceParameters = array();
@@ -87,20 +89,17 @@ class ImageTypeCore extends ObjectModel
* @param string|null Image type * @param string|null Image type
* @return array Image type definitions * @return array Image type definitions
*/ */
public static function getImagesTypes($type = null, $id_theme = false) public static function getImagesTypes($type = null)
{ {
if (!isset(self::$images_types_cache[$type.($id_theme ? '-'.$id_theme : '')])) if (!isset(self::$images_types_cache[$type]))
{ {
$where = 'WHERE 1'; $where = 'WHERE 1';
if ($id_theme)
$where .= ' AND id_theme='.(int)$id_theme;
if (!empty($type)) if (!empty($type))
$where .= ' AND '.pSQL($type).' = 1 '; $where .= ' AND '.pSQL($type).' = 1 ';
$query = 'SELECT * FROM `'._DB_PREFIX_.'image_type`'.$where.' ORDER BY `name` ASC'; $query = 'SELECT * FROM `'._DB_PREFIX_.'image_type`'.$where.' ORDER BY `name` ASC';
self::$images_types_cache[$type] = Db::getInstance()->executeS($query); self::$images_types_cache[$type] = Db::getInstance()->executeS($query);
} }
return self::$images_types_cache[$type]; return self::$images_types_cache[$type];
} }
@@ -116,9 +115,9 @@ class ImageTypeCore extends ObjectModel
die(Tools::displayError()); die(Tools::displayError());
Db::getInstance()->executeS(' Db::getInstance()->executeS('
SELECT `id_image_type` SELECT `id_image_type`
FROM `'._DB_PREFIX_.'image_type` FROM `'._DB_PREFIX_.'image_type`
WHERE `name` = \''.pSQL($typeName).'\''); WHERE `name` = \''.pSQL($typeName).'\'');
return Db::getInstance()->NumRows(); return Db::getInstance()->NumRows();
} }
@@ -128,9 +127,29 @@ class ImageTypeCore extends ObjectModel
* @param string $name * @param string $name
* @param string $type * @param string $type
*/ */
public static function getByNameNType($name, $type) public static function getByNameNType($name, $type = null)
{ {
return Db::getInstance()->getRow('SELECT `id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes` FROM `'._DB_PREFIX_.'image_type` WHERE `name` = \''.pSQL($name).'\' AND `'.pSQL($type).'` = 1'); if (!isset(self::$images_types_name_cache[$name.'_'.$type]))
{
self::$images_types_name_cache[$name.'_'.$type] = Db::getInstance()->getRow('
SELECT `id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes`
FROM `'._DB_PREFIX_.'image_type`
WHERE `name` = \''.pSQL($name).'\' '.(!is_null($type) ? 'AND `'.pSQL($type).'` = 1' : ''));
}
return self::$images_types_name_cache[$name.'_'.$type];
} }
} public static function getFormatedName($name)
{
$theme_name = Context::getContext()->shop->theme_name;
$name_without_theme_name = str_replace(array('_'.$theme_name, $theme_name.'_'), '', $name);
//check if the theme name is already in $name if yes only return $name
if (strstr($name, $theme_name) && self::getByNameNType($name))
return $name;
else if (self::getByNameNType($name_without_theme_name.'_'.$theme_name))
return $name_without_theme_name.'_'.$theme_name;
else
return $theme_name.'_'.$name_without_theme_name;
}
}
+11 -11
View File
@@ -516,11 +516,11 @@ class LanguageCore extends ObjectModel
// delete images // delete images
$files_copy = array( $files_copy = array(
'/en.jpg', '/en.jpg',
'/en-default-thickbox_default.jpg', '/en-default-'.ImageType::getFormatedName('thickbox').'.jpg',
'/en-default-home_default.jpg', '/en-default-'.ImageType::getFormatedName('home').'.jpg',
'/en-default-large_default.jpg', '/en-default-'.ImageType::getFormatedName('large').'.jpg',
'/en-default-medium_default.jpg', '/en-default-'.ImageType::getFormatedName('medium').'.jpg',
'/en-default-small_default.jpg' '/en-default-'.ImageType::getFormatedName('small').'.jpg'
); );
$tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_); $tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_);
foreach ($tos as $to) foreach ($tos as $to)
@@ -726,12 +726,12 @@ class LanguageCore extends ObjectModel
$files_copy = array( $files_copy = array(
'/en.jpg', '/en.jpg',
'/en-default-thickbox_default.jpg', '/en-default-'.ImageType::getFormatedName('thickbox').'.jpg',
'/en-default-home_default.jpg', '/en-default-'.ImageType::getFormatedName('home').'.jpg',
'/en-default-large_default.jpg', '/en-default-'.ImageType::getFormatedName('large').'.jpg',
'/en-default-medium_default.jpg', '/en-default-'.ImageType::getFormatedName('medium').'.jpg',
'/en-default-small_default.jpg', '/en-default-'.ImageType::getFormatedName('small').'.jpg',
'/en-default-scene_default.jpg' '/en-default-'.ImageType::getFormatedName('scene').'.jpg'
); );
foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to) foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to)
foreach ($files_copy as $file) foreach ($files_copy as $file)
+1 -1
View File
@@ -40,7 +40,7 @@ class BestSalesControllerCore extends FrontController
'products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay), 'products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'nbProducts' => $nbProducts, 'nbProducts' => $nbProducts,
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')
)); ));
+6 -6
View File
@@ -120,10 +120,10 @@ class CategoryControllerCore extends FrontController
'return_category_name' => Tools::safeOutput($this->category->name), 'return_category_name' => Tools::safeOutput($this->category->name),
'path' => Tools::getPath($this->category->id), 'path' => Tools::getPath($this->category->id),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'categorySize' => Image::getSize('category_default'), 'categorySize' => Image::getSize(ImageType::getFormatedName('category')),
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'thumbSceneSize' => Image::getSize('m_scene_default'), 'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')),
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'),
'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'),
'suppliers' => Supplier::getSuppliers() 'suppliers' => Supplier::getSuppliers()
@@ -144,9 +144,9 @@ class CategoryControllerCore extends FrontController
{ {
foreach ($sceneImageTypes as $sceneImageType) foreach ($sceneImageTypes as $sceneImageType)
{ {
if ($sceneImageType['name'] == 'm_scene_default') if ($sceneImageType['name'] == ImageType::getFormatedName('m_scene'))
$thumbSceneImageType = $sceneImageType; $thumbSceneImageType = $sceneImageType;
elseif ($sceneImageType['name'] == 'scene_default') elseif ($sceneImageType['name'] == ImageType::getFormatedName('scene'))
$largeSceneImageType = $sceneImageType; $largeSceneImageType = $sceneImageType;
} }
+1 -1
View File
@@ -132,7 +132,7 @@ class CompareControllerCore extends FrontController
'product_features' => $listFeatures, 'product_features' => $listFeatures,
'products' => $listProducts, 'products' => $listProducts,
'width' => $width, 'width' => $width,
'homeSize' => Image::getSize('home_default') 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
)); ));
$this->context->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Hook::exec('displayProductComparison', array('list_ids_product' => $ids))); $this->context->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Hook::exec('displayProductComparison', array('list_ids_product' => $ids)));
} }
+2 -2
View File
@@ -115,12 +115,12 @@ class ManufacturerControllerCore extends FrontController
$this->pagination($nbProducts); $this->pagination($nbProducts);
foreach ($data as &$item) foreach ($data as &$item)
$item['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$item['id_manufacturer'].'-medium_default.jpg')) ? $this->context->language->iso_code.'-default' : $item['id_manufacturer']; $item['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$item['id_manufacturer'].'-'.ImageType::getFormatedName('medium').'.jpg')) ? $this->context->language->iso_code.'-default' : $item['id_manufacturer'];
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'pages_nb' => ceil($nbProducts / (int)($this->n)), 'pages_nb' => ceil($nbProducts / (int)($this->n)),
'nbManufacturers' => $nbProducts, 'nbManufacturers' => $nbProducts,
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'manufacturers' => $data, 'manufacturers' => $data,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
)); ));
+1 -1
View File
@@ -60,7 +60,7 @@ class NewProductsControllerCore extends FrontController
'products' => Product::getNewProducts($this->context->language->id, (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay), 'products' => Product::getNewProducts($this->context->language->id, (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'nbProducts' => (int)($nbProducts), 'nbProducts' => (int)($nbProducts),
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')
)); ));
+1 -1
View File
@@ -53,7 +53,7 @@ class PricesDropControllerCore extends FrontController
'products' => Product::getPricesDrop($this->context->language->id, (int)$this->p - 1, (int)$this->n, false, $this->orderBy, $this->orderWay), 'products' => Product::getPricesDrop($this->context->language->id, (int)$this->p - 1, (int)$this->n, false, $this->orderBy, $this->orderWay),
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'nbProducts' => $nbProducts, 'nbProducts' => $nbProducts,
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')
)); ));
+9 -5
View File
@@ -345,15 +345,19 @@ class ProductControllerCore extends FrontController
$product_images[(int)$image['id_image']] = $image; $product_images[(int)$image['id_image']] = $image;
} }
if (!isset($cover)) if (!isset($cover))
$cover = array('id_image' => $this->context->language->iso_code.'-default', 'legend' => 'No picture', 'title' => 'No picture'); $cover = array(
$size = Image::getSize('large_default'); 'id_image' => $this->context->language->iso_code.'-default',
'legend' => 'No picture',
'title' => 'No picture'
);
$size = Image::getSize(ImageType::getFormatedName('large'));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'have_image' => Product::getCover((int)Tools::getValue('id_product')), 'have_image' => Product::getCover((int)Tools::getValue('id_product')),
'cover' => $cover, 'cover' => $cover,
'imgWidth' => (int)$size['width'], 'imgWidth' => (int)$size['width'],
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'largeSize' => Image::getSize('large_default'), 'largeSize' => Image::getSize(ImageType::getFormatedName('large')),
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'col_img_dir' => _PS_COL_IMG_DIR_)); 'col_img_dir' => _PS_COL_IMG_DIR_));
if (count($product_images)) if (count($product_images))
$this->context->smarty->assign('images', $product_images); $this->context->smarty->assign('images', $product_images);
+3 -3
View File
@@ -81,7 +81,7 @@ class SearchControllerCore extends FrontController
'nbProducts' => $search['total'], 'nbProducts' => $search['total'],
'search_query' => $query, 'search_query' => $query,
'instant_search' => $this->instant_search, 'instant_search' => $this->instant_search,
'homeSize' => Image::getSize('home_default'))); 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
} }
else if (($query = Tools::getValue('search_query', Tools::getValue('ref'))) && !is_array($query)) else if (($query = Tools::getValue('search_query', Tools::getValue('ref'))) && !is_array($query))
{ {
@@ -97,7 +97,7 @@ class SearchControllerCore extends FrontController
'search_products' => $search['result'], 'search_products' => $search['result'],
'nbProducts' => $search['total'], 'nbProducts' => $search['total'],
'search_query' => $query, 'search_query' => $query,
'homeSize' => Image::getSize('home_default'))); 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
} }
else if (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag)) else if (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag))
{ {
@@ -110,7 +110,7 @@ class SearchControllerCore extends FrontController
'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module 'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
'search_products' => $result, 'search_products' => $result,
'nbProducts' => $nbProducts, 'nbProducts' => $nbProducts,
'homeSize' => Image::getSize('home_default'))); 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
} }
else else
{ {
+1 -1
View File
@@ -262,7 +262,7 @@ class StoresControllerCore extends FrontController
$this->assignStores(); $this->assignStores();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'), 'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'), 'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'),
'searchUrl' => $this->context->link->getPageLink('stores'), 'searchUrl' => $this->context->link->getPageLink('stores'),
+2 -2
View File
@@ -118,12 +118,12 @@ class SupplierControllerCore extends FrontController
$suppliers = Supplier::getSuppliers(true, $this->context->language->id, true, $this->p, $this->n); $suppliers = Supplier::getSuppliers(true, $this->context->language->id, true, $this->p, $this->n);
foreach ($suppliers as &$row) foreach ($suppliers as &$row)
$row['image'] = (!file_exists(_PS_SUPP_IMG_DIR_.'/'.$row['id_supplier'].'-medium_default.jpg')) ? $this->context->language->iso_code.'-default' : $row['id_supplier']; $row['image'] = (!file_exists(_PS_SUPP_IMG_DIR_.'/'.$row['id_supplier'].'-'.ImageType::getFormatedName('medium').'.jpg')) ? $this->context->language->iso_code.'-default' : $row['id_supplier'];
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'pages_nb' => ceil($nbProducts / (int)$this->n), 'pages_nb' => ceil($nbProducts / (int)$this->n),
'nbSuppliers' => $nbProducts, 'nbSuppliers' => $nbProducts,
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'suppliers_list' => $suppliers, 'suppliers_list' => $suppliers,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
)); ));
@@ -120,8 +120,8 @@ class BlockBestSellers extends Module
$this->smarty->assign(array( $this->smarty->assign(array(
'best_sellers' => $best_sellers, 'best_sellers' => $best_sellers,
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'smallSize' => Image::getSize('small_default') 'smallSize' => Image::getSize(ImageType::getFormatedName('small'))
)); ));
return $this->display(__FILE__, 'blockbestsellers.tpl'); return $this->display(__FILE__, 'blockbestsellers.tpl');
} }
@@ -158,7 +158,7 @@ class BlockBestSellers extends Module
$this->smarty->assign(array( $this->smarty->assign(array(
'best_sellers' => $best_sellers, 'best_sellers' => $best_sellers,
'homeSize' => Image::getSize('home_default'))); 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
return $this->display(__FILE__, 'blockbestsellers-home.tpl'); return $this->display(__FILE__, 'blockbestsellers-home.tpl');
} }
} }
+1 -1
View File
@@ -3868,7 +3868,7 @@ class BlockLayered extends Module
$smarty->assign( $smarty->assign(
array( array(
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
'nb_products' => $nb_products, 'nb_products' => $nb_products,
'category' => (object)array('id' => Tools::getValue('id_category_layered', 1)), 'category' => (object)array('id' => Tools::getValue('id_category_layered', 1)),
'pages_nb' => (int)($pages_nb), 'pages_nb' => (int)($pages_nb),
@@ -101,7 +101,7 @@ class BlockNewProducts extends Module
$this->smarty->assign(array( $this->smarty->assign(array(
'new_products' => $newProducts, 'new_products' => $newProducts,
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
)); ));
return $this->display(__FILE__, 'blocknewproducts.tpl'); return $this->display(__FILE__, 'blocknewproducts.tpl');
+1 -1
View File
@@ -92,7 +92,7 @@ class BlockSpecials extends Module
$this->smarty->assign(array( $this->smarty->assign(array(
'special' => $special, 'special' => $special,
'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2),
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
)); ));
return $this->display(__FILE__, 'blockspecials.tpl'); return $this->display(__FILE__, 'blockspecials.tpl');
+2 -2
View File
@@ -158,7 +158,7 @@ class CrossSelling extends Module
$taxCalc = Product::getTaxCalculationMethod(); $taxCalc = Product::getTaxCalculationMethod();
foreach ($orderProducts AS &$orderProduct) foreach ($orderProducts AS &$orderProduct)
{ {
$orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], 'medium_default'); $orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], ImageType::getFormatedName('medium'));
$orderProduct['link'] = $this->context->link->getProductLink((int)$orderProduct['product_id'], $orderProduct['link_rewrite'], $orderProduct['category'], $orderProduct['ean13']); $orderProduct['link'] = $this->context->link->getProductLink((int)$orderProduct['product_id'], $orderProduct['link_rewrite'], $orderProduct['category'], $orderProduct['ean13']);
if (Configuration::get('CROSSSELLING_DISPLAY_PRICE') AND ($taxCalc == 0 OR $taxCalc == 2)) if (Configuration::get('CROSSSELLING_DISPLAY_PRICE') AND ($taxCalc == 0 OR $taxCalc == 2))
$orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], true, NULL); $orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], true, NULL);
@@ -212,7 +212,7 @@ class CrossSelling extends Module
$taxCalc = Product::getTaxCalculationMethod(); $taxCalc = Product::getTaxCalculationMethod();
foreach ($orderProducts AS &$orderProduct) foreach ($orderProducts AS &$orderProduct)
{ {
$orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], 'medium_default'); $orderProduct['image'] = $this->context->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], ImageType::getFormatedName('medium'));
$orderProduct['link'] = $this->context->link->getProductLink((int)$orderProduct['product_id'], $orderProduct['link_rewrite'], $orderProduct['category'], $orderProduct['ean13']); $orderProduct['link'] = $this->context->link->getProductLink((int)$orderProduct['product_id'], $orderProduct['link_rewrite'], $orderProduct['category'], $orderProduct['ean13']);
if (Configuration::get('CROSSSELLING_DISPLAY_PRICE') AND ($taxCalc == 0 OR $taxCalc == 2)) if (Configuration::get('CROSSSELLING_DISPLAY_PRICE') AND ($taxCalc == 0 OR $taxCalc == 2))
$orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], true, NULL); $orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], true, NULL);
+1 -1
View File
@@ -108,7 +108,7 @@ class HomeFeatured extends Module
$this->smarty->assign(array( $this->smarty->assign(array(
'products' => $products, 'products' => $products,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'homeSize' => Image::getSize('home_default'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
)); ));
return $this->display(__FILE__, 'homefeatured.tpl'); return $this->display(__FILE__, 'homefeatured.tpl');
+2 -2
View File
@@ -710,7 +710,7 @@ class ProductComments extends Module
'logged' => (int)$this->context->customer->isLogged(true), 'logged' => (int)$this->context->customer->isLogged(true),
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), 'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
'productcomment_cover' => (int)Tools::getValue('id_product').'-'.(int)$image['id_image'], 'productcomment_cover' => (int)Tools::getValue('id_product').'-'.(int)$image['id_image'],
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'criterions' => ProductCommentCriterion::getByProduct((int)Tools::getValue('id_product'), $this->context->language->id), 'criterions' => ProductCommentCriterion::getByProduct((int)Tools::getValue('id_product'), $this->context->language->id),
'action_url' => '', 'action_url' => '',
'averageTotal' => (int)$average['grade'], 'averageTotal' => (int)$average['grade'],
@@ -752,7 +752,7 @@ class ProductComments extends Module
'id_product_comment_form' => (int)Tools::getValue('id_product'), 'id_product_comment_form' => (int)Tools::getValue('id_product'),
'secure_key' => $this->secure_key, 'secure_key' => $this->secure_key,
'productcomment_cover' => (int)Tools::getValue('id_product').'-'.(int)$image['id_image'], 'productcomment_cover' => (int)Tools::getValue('id_product').'-'.(int)$image['id_image'],
'mediumSize' => Image::getSize('medium_default'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'nbComments' => (int)ProductComment::getCommentNumber((int)Tools::getValue('id_product')), 'nbComments' => (int)ProductComment::getCommentNumber((int)Tools::getValue('id_product')),
'productcomments_controller_url' => $this->context->link->getModuleLink('productcomments'), 'productcomments_controller_url' => $this->context->link->getModuleLink('productcomments'),
'productcomments_url_rewriting_activated' => Configuration::get('PS_REWRITING_SETTINGS', 0) 'productcomments_url_rewriting_activated' => Configuration::get('PS_REWRITING_SETTINGS', 0)