Buna ziua. In o.c. 3.0.2.0 cum pot face ca atunci cand te plimbi cu mousele peste poza in prezentarea produselor (nu cand intrii pe un produs) sa arate cea de-a doua poza .Va multumesc.
Ai nevoie sa modifici conotrollerul de catalog si sa intoarca 2 sau mai multe poze la thumb. Dupa aceea din css sau js poti face ce iti doresti. Nu cred case poate out of the box.
am un vqmod pentru 2.0.2.0 poate il poti modifica cum ai tu nevoie pentru OC 3
am un vqmod pentru 2.0.2.0 poate il poti modifica cum ai tu nevoie pentru OC 3
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>product images</id>
<version>1.0</version>
<vqmver>2.X</vqmver>
<author>hypemedia</author>
<file name="catalog/model/catalog/product.php">
<operation info="Add function to select second image for a product">
<search position="before"><![CDATA[public function getProduct($product_id) {]]></search>
<add><![CDATA[
public function getProductSecondImage($product_id) {
$query = $this->db->query("SELECT image FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order limit 1");
if ($query->num_rows) {
return $query->row['image'];
} else {
return false;
}
}
]]></add>
</operation>
<operation info="Add second image">
<search position="after" index="1"><![CDATA['image' => $query->row['image'],]]></search>
<add><![CDATA[
'image2' => $this->getProductSecondImage($query->row['product_id']),
]]></add>
</operation>
</file>
<file name="catalog/controller/product/category.php,catalog/controller/product/search.php">
<operation info="get second image for product-search">
<search position="before"><![CDATA[
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
]]></search>
<add><![CDATA[
if (!empty($result['image2']) && $result['image2']) {
$image2 = $this->model_tool_image->resize($result['image2'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'), 1);
} else {
$image2 = $image;
}
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
if ($result['image']) {
]]></search>
<add><![CDATA[
if (!empty($result['image']) && $result['image']) {
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
'thumb' => $image,
]]></search>
<add><![CDATA[
'image2' => $image2,
]]></add>
</operation>
</file>
</modification>
Who is online
Users browsing this forum: No registered users and 84 guests