0 Пользователей и 1 Гость просматривают эту тему.
  • 5 Ответов
  • 935 Просмотров
*

misteri27

  • Захожу иногда
  • 490
  • 0 / 0
Всем привет.
Народ кто-то переделывал страницу сравнения товаров ?
Так как она в табличной верстке, то на мобильных устройствах она выходит не очень. Не подскажите есть в блочной верстке готовая купить? Или может кто делал поделитесь.
« Последнее редактирование: 19.04.2020, 12:12:21 от misteri27 »
*

kit2m2

  • Живу я здесь
  • 3264
  • 267 / 0
  • Беру сайты на полное сопровождение
Re: Страница сравнения товара
« Ответ #1 : 19.04.2020, 12:28:39 »
По умолчанию в  JoomShopping нет никаких страниц сравнения товаров. Все зависит от расширения, которое Вы используете.
Расширения для JoomShopping | Расширения на заказ | Сайты и магазины под ключ: Дизайн, Верстка, Программирование, СЕО-оптимизация, Сопровождение, Перенос на Joomla 4+ и JoomShopping 5+
*

misteri27

  • Захожу иногда
  • 490
  • 0 / 0
Re: Страница сравнения товара
« Ответ #2 : 19.04.2020, 19:43:50 »
Модуль сравнения http://brooksite.ru/moduli-joomshopping/joomshopping-modul-sravneniya-tovarov.html.
а сам шаблон страницы находить в папке моего шаблона этой страницы
Код
<?php defined('_JEXEC') or die();
session_start();
if ($_SESSION['comparep']) {
$products_arr = array_unique(array_values($_SESSION['comparep']));
}
$jshopConfig = JSFactory::getConfig();
$product = JTable::getInstance('product', 'jshop');
$manufacturer=JTable::getInstance('manufacturer', 'jshop');
JSFactory::loadJsFilesLightBox();
$lang = JSFactory::getLang();

function getProductExtraFieldForProductCompare($product){
$jshopConfig = JSFactory::getConfig();
$fields = JSFactory::getAllProductExtraField();
$fieldvalues = JSFactory::getAllProductExtraFieldValue();
$hide_fields = $jshopConfig->getProductHideExtraFields();
$rows = array();
foreach($fields as $fid){
if (in_array($fid->id, $hide_fields)) continue;
$field_id=$fid->id;
$field_name = "extra_field_".$field_id;
if ($fields[$field_id]->type==0){
if ($product->$field_name!=0){
$listid = explode(',', $product->$field_name);
$tmp = array();
foreach($listid as $extrafiledvalueid){
$tmp[] = $fieldvalues[$extrafiledvalueid];
}
$extra_field_value = implode(", ", $tmp);
$rows[$field_id] = array("name"=>$fields[$field_id]->name, "description"=>$fields[$field_id]->description, "value"=>$extra_field_value);
}
}else{
if ($product->$field_name!=""){
$rows[$field_id] = array("name"=>$fields[$field_id]->name, "description"=>$fields[$field_id]->description, "value"=>$product->$field_name);
}
}
}
return $rows;
}
?>

<h1><?php print JText::_('PLG_COMPARE')?></h1>
<?php if (count($products_arr)>0) : ?>
<table class="jshop compare_table table table-condensed table-hover">
<tr>
<th>
<?php print JText::_('PLG_DEL')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<a id="removeviewid_<?php print $product->product_id; ?>" class="remove_compare_view" href="#">
<?php print JText::_('PLG_DEL_COMPARE')?>
</a>
</td>
<?php } ?>
</tr>
<tr class="compare_name">
<th>
<?php print JText::_('PLG_NAME')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<a href="<?php $category = $product->getCategory(); print SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id='.$category.'&product_id='.$product->product_id,1)?>">
<?php $name = $lang->get("name"); print $product->$name;?>
</a>
</td>
<?php } ?>
</tr>
<tr class="compare_foto">
<th>
<?php print JText::_('PLG_IMAGE')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<a class="lightbox" href="<?php print $this->config->image_product_live_path ?>/<?php print "full_".$product->image?>">
<img src="<?php print $this->config->image_product_live_path ?>/<?php print "thumb_".$product->image?>" alt="">
<div class="text_zoom">
<img src="/components/com_jshopping/images/search.png" alt="zoom" /><?php print JText::_('PLG_ZOOM')?>
</div>
</a>
</td>
<?php } ?>
</tr>
<tr class="compare_rating <?php print $this->_tmp_var_compare_rat ?>">
<th></th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php print showMarkStar($product->average_rating); ?>
</td>
<?php } ?>
</tr>
<tr class="compare_code <?php print $this->_tmp_var_compare_code ?>">
<th>
<?php print JText::_('PLG_EAN')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php print $product->product_ean; ?>
</td>
<?php } ?>
</tr>
<tr class="compare_manufacturer <?php print $this->_tmp_var_compare_manufacturer ?>">
<th>
<?php print JText::_('PLG_MF')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>"><?php $manufacturer_info=$product->getManufacturerInfo(); $product->manufacturer=$manufacturer_info->name;  print htmlspecialchars($product->manufacturer);?>
<?php if ($manufacturer_info->manufacturer_logo){?>
<img src="<?php print $this->config->image_manufs_live_path."/".$manufacturer_info->manufacturer_logo;?>" />
<?php } ?>
</td>
<?php } ?>
</tr>
<tr class="compare_short_descr <?php print $this->_tmp_var_compare_shortdescr ?>">
<th>
<?php print JText::_('PLG_SD')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_short_descr compare_view_<?php print $product->product_id; ?>">
<?php $sd = $lang->get("short_description"); print $product->$sd; ?>
</td>
<?php } ?>
</tr>
<tr class="compare_price">
<th>
<?php print JText::_('PLG_PRICE')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<p><?php print formatprice(getPriceFromCurrency($product->product_price, $product->currency_id));?></p>
<?php
$prqty=$product->product_quantity;
if  ($prqty!=0 && !$jshopConfig->user_as_catalog) { ?>
<a class="button_buy" href="<?php $category = $product->getCategory(); print SEFLink('index.php?option=com_jshopping&controller=cart&task=add&category_id='.$category.'&product_id='.$product->product_id,1)?>" title="<?php print JText::_('PLG_BUY')?>">
<?php print JText::_('PLG_BUY')?>
</a>
<?php } elseif ($prqty==0 && !$jshopConfig->user_as_catalog && $jshopConfig->stock==0) { ?>
<a class="button_buy" href="<?php $category = $product->getCategory(); print SEFLink('index.php?option=com_jshopping&controller=cart&task=add&category_id='.$category.'&product_id='.$product->product_id,1)?>" title="<?php print JText::_('PLG_BUY')?>">
<?php print JText::_('PLG_BUY')?>
</a>
<?php } elseif ($prqty==0 && !$jshopConfig->user_as_catalog){
print "<span style='color:#ff0000'>".JText::_('PLG_EMPTY')."</span>";
} elseif ($jshopConfig->user_as_catalog){
print "";
} ?>
</td>   
<?php } ?>
</tr>
<tr class="compare_attrib <?php print $this->_tmp_var_compare_attr ?>">
<th>
<?php print JText::_('PLG_ATTR')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php   
$product_id=$product->product_id;
$product->load($product_id);
$attributesDatas = $product->getAttributesDatas($back_value['attr']);
$product->setAttributeActive($attributesDatas['attributeActive']);
$attributeValues = $attributesDatas['attributeValues'];

$attributes = $product->getBuildSelectAttributes($attributeValues, $attributesDatas['attributeSelected']);
if (count($attributes)) {
$_attributevalue = JTable::getInstance('AttributValue', 'jshop');
$all_attr_values = $_attributevalue->getAllAttributeValues();
} else {
$all_attr_values = array();
}
if (count($attributes)) { ?>
<div class="jshop_prod_attributes_compare">
<table class="jshop">
<?php foreach($attributes as $attribut){;?>
<tr>
<td class="attributes_title">
<span class="attributes_name"><?php print $attribut->attr_name?>:</span>
<span class="attributes_description"><?php print $attribut->attr_description;?></span>
</td>
<td>
<span id='block_attr_sel_<?php print $attribut->attr_id?>' class="sel_compare">
<?php print $attribut->selects; ?>
</span>
</td>
</tr>
<?php }?>
</table>
</div>
<?php }?>   
</td>
<?php } ?>
</tr>
<tr class="compare_weight <?php print $this->_tmp_var_compare_weight ?>">
<th>
<?php print JText::_('PLG_WEIGHT')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php print formatweight($product->product_weight); ?>
</td>
<?php } ?>
</tr>
<?php
$j = 0;
for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
$prex=getProductExtraFieldForProductCompare($product);
if (empty($prex)) continue;
foreach ($prex as $key=>$v) {
$exn[$j] = $v['name'];
$exv[$j] = $v['value'];
$j++;
}
}
if (count ($exn)) {
$extra_un = array_unique($exn);
$ex = array_values($extra_un);
}
for ($j = 0; $j < count ($ex); $j++) { ?>
<tr>
<th>
<?php print $ex[$j]; ?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="extra compare_view_<?php print $product->product_id; ?>">
<?php
$prex=getProductExtraFieldForProductCompare($product);
if (empty($prex)) {
print "-"; continue;
}
foreach ($prex as $key=>$v) {
if ($v['name'] == $ex[$j]) {  
print $v['value'];
}
}
?>
</td>
<?php } ?>
</tr>
<?php } ?>
</table>
<?php else: ?>
<p><?php print JText::_('PLG_NOSELECT')?></p>
<?php endif; ?>
*

AlexB

  • Завсегдатай
  • 1973
  • 54 / 2
Re: Страница сравнения товара
« Ответ #3 : 19.04.2020, 20:29:23 »
Модуль сравнения http://brooksite.ru/moduli-joomshopping/joomshopping-modul-sravneniya-tovarov.html.
а сам шаблон страницы находить в папке моего шаблона этой страницы
Код
<?php defined('_JEXEC') or die();
session_start();
if ($_SESSION['comparep']) {
$products_arr = array_unique(array_values($_SESSION['comparep']));
}
$jshopConfig = JSFactory::getConfig();
$product = JTable::getInstance('product', 'jshop');
$manufacturer=JTable::getInstance('manufacturer', 'jshop');
JSFactory::loadJsFilesLightBox();
$lang = JSFactory::getLang();

function getProductExtraFieldForProductCompare($product){
$jshopConfig = JSFactory::getConfig();
$fields = JSFactory::getAllProductExtraField();
$fieldvalues = JSFactory::getAllProductExtraFieldValue();
$hide_fields = $jshopConfig->getProductHideExtraFields();
$rows = array();
foreach($fields as $fid){
if (in_array($fid->id, $hide_fields)) continue;
$field_id=$fid->id;
$field_name = "extra_field_".$field_id;
if ($fields[$field_id]->type==0){
if ($product->$field_name!=0){
$listid = explode(',', $product->$field_name);
$tmp = array();
foreach($listid as $extrafiledvalueid){
$tmp[] = $fieldvalues[$extrafiledvalueid];
}
$extra_field_value = implode(", ", $tmp);
$rows[$field_id] = array("name"=>$fields[$field_id]->name, "description"=>$fields[$field_id]->description, "value"=>$extra_field_value);
}
}else{
if ($product->$field_name!=""){
$rows[$field_id] = array("name"=>$fields[$field_id]->name, "description"=>$fields[$field_id]->description, "value"=>$product->$field_name);
}
}
}
return $rows;
}
?>

<h1><?php print JText::_('PLG_COMPARE')?></h1>
<?php if (count($products_arr)>0) : ?>
<table class="jshop compare_table table table-condensed table-hover">
<tr>
<th>
<?php print JText::_('PLG_DEL')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<a id="removeviewid_<?php print $product->product_id; ?>" class="remove_compare_view" href="#">
<?php print JText::_('PLG_DEL_COMPARE')?>
</a>
</td>
<?php } ?>
</tr>
<tr class="compare_name">
<th>
<?php print JText::_('PLG_NAME')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<a href="<?php $category = $product->getCategory(); print SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id='.$category.'&product_id='.$product->product_id,1)?>">
<?php $name = $lang->get("name"); print $product->$name;?>
</a>
</td>
<?php } ?>
</tr>
<tr class="compare_foto">
<th>
<?php print JText::_('PLG_IMAGE')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<a class="lightbox" href="<?php print $this->config->image_product_live_path ?>/<?php print "full_".$product->image?>">
<img src="<?php print $this->config->image_product_live_path ?>/<?php print "thumb_".$product->image?>" alt="">
<div class="text_zoom">
<img src="/components/com_jshopping/images/search.png" alt="zoom" /><?php print JText::_('PLG_ZOOM')?>
</div>
</a>
</td>
<?php } ?>
</tr>
<tr class="compare_rating <?php print $this->_tmp_var_compare_rat ?>">
<th></th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php print showMarkStar($product->average_rating); ?>
</td>
<?php } ?>
</tr>
<tr class="compare_code <?php print $this->_tmp_var_compare_code ?>">
<th>
<?php print JText::_('PLG_EAN')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php print $product->product_ean; ?>
</td>
<?php } ?>
</tr>
<tr class="compare_manufacturer <?php print $this->_tmp_var_compare_manufacturer ?>">
<th>
<?php print JText::_('PLG_MF')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>"><?php $manufacturer_info=$product->getManufacturerInfo(); $product->manufacturer=$manufacturer_info->name;  print htmlspecialchars($product->manufacturer);?>
<?php if ($manufacturer_info->manufacturer_logo){?>
<img src="<?php print $this->config->image_manufs_live_path."/".$manufacturer_info->manufacturer_logo;?>" />
<?php } ?>
</td>
<?php } ?>
</tr>
<tr class="compare_short_descr <?php print $this->_tmp_var_compare_shortdescr ?>">
<th>
<?php print JText::_('PLG_SD')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_short_descr compare_view_<?php print $product->product_id; ?>">
<?php $sd = $lang->get("short_description"); print $product->$sd; ?>
</td>
<?php } ?>
</tr>
<tr class="compare_price">
<th>
<?php print JText::_('PLG_PRICE')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<p><?php print formatprice(getPriceFromCurrency($product->product_price, $product->currency_id));?></p>
<?php
$prqty=$product->product_quantity;
if  ($prqty!=0 && !$jshopConfig->user_as_catalog) { ?>
<a class="button_buy" href="<?php $category = $product->getCategory(); print SEFLink('index.php?option=com_jshopping&controller=cart&task=add&category_id='.$category.'&product_id='.$product->product_id,1)?>" title="<?php print JText::_('PLG_BUY')?>">
<?php print JText::_('PLG_BUY')?>
</a>
<?php } elseif ($prqty==0 && !$jshopConfig->user_as_catalog && $jshopConfig->stock==0) { ?>
<a class="button_buy" href="<?php $category = $product->getCategory(); print SEFLink('index.php?option=com_jshopping&controller=cart&task=add&category_id='.$category.'&product_id='.$product->product_id,1)?>" title="<?php print JText::_('PLG_BUY')?>">
<?php print JText::_('PLG_BUY')?>
</a>
<?php } elseif ($prqty==0 && !$jshopConfig->user_as_catalog){
print "<span style='color:#ff0000'>".JText::_('PLG_EMPTY')."</span>";
} elseif ($jshopConfig->user_as_catalog){
print "";
} ?>
</td>   
<?php } ?>
</tr>
<tr class="compare_attrib <?php print $this->_tmp_var_compare_attr ?>">
<th>
<?php print JText::_('PLG_ATTR')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php   
$product_id=$product->product_id;
$product->load($product_id);
$attributesDatas = $product->getAttributesDatas($back_value['attr']);
$product->setAttributeActive($attributesDatas['attributeActive']);
$attributeValues = $attributesDatas['attributeValues'];

$attributes = $product->getBuildSelectAttributes($attributeValues, $attributesDatas['attributeSelected']);
if (count($attributes)) {
$_attributevalue = JTable::getInstance('AttributValue', 'jshop');
$all_attr_values = $_attributevalue->getAllAttributeValues();
} else {
$all_attr_values = array();
}
if (count($attributes)) { ?>
<div class="jshop_prod_attributes_compare">
<table class="jshop">
<?php foreach($attributes as $attribut){;?>
<tr>
<td class="attributes_title">
<span class="attributes_name"><?php print $attribut->attr_name?>:</span>
<span class="attributes_description"><?php print $attribut->attr_description;?></span>
</td>
<td>
<span id='block_attr_sel_<?php print $attribut->attr_id?>' class="sel_compare">
<?php print $attribut->selects; ?>
</span>
</td>
</tr>
<?php }?>
</table>
</div>
<?php }?>   
</td>
<?php } ?>
</tr>
<tr class="compare_weight <?php print $this->_tmp_var_compare_weight ?>">
<th>
<?php print JText::_('PLG_WEIGHT')?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="compare_view_<?php print $product->product_id; ?>">
<?php print formatweight($product->product_weight); ?>
</td>
<?php } ?>
</tr>
<?php
$j = 0;
for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
$prex=getProductExtraFieldForProductCompare($product);
if (empty($prex)) continue;
foreach ($prex as $key=>$v) {
$exn[$j] = $v['name'];
$exv[$j] = $v['value'];
$j++;
}
}
if (count ($exn)) {
$extra_un = array_unique($exn);
$ex = array_values($extra_un);
}
for ($j = 0; $j < count ($ex); $j++) { ?>
<tr>
<th>
<?php print $ex[$j]; ?>
</th>
<?php for ($i = 0; $i < count ($products_arr); $i++) {
$product->load($products_arr[$i]);
?>
<td class="extra compare_view_<?php print $product->product_id; ?>">
<?php
$prex=getProductExtraFieldForProductCompare($product);
if (empty($prex)) {
print "-"; continue;
}
foreach ($prex as $key=>$v) {
if ($v['name'] == $ex[$j]) {  
print $v['value'];
}
}
?>
</td>
<?php } ?>
</tr>
<?php } ?>
</table>
<?php else: ?>
<p><?php print JText::_('PLG_NOSELECT')?></p>
<?php endif; ?>
Так если купили то задайте вопрос разработчику
*

misteri27

  • Захожу иногда
  • 490
  • 0 / 0
Re: Страница сравнения товара
« Ответ #4 : 19.04.2020, 20:50:33 »
Так если купили то задайте вопрос разработчику
Изначально я спросил в целом и не учел что по дефолту ее вообще нету. Думал что сама страница есть в шаблоне дефолтовом.
Я есть еще какие то решение по сравнению? Модули с адоном купить?
*

AlexB

  • Завсегдатай
  • 1973
  • 54 / 2
Re: Страница сравнения товара
« Ответ #5 : 19.04.2020, 20:56:30 »
Да есть сравнения товаров
Вопрос зачем?
Если на бруке купили то к ним и в поддержку
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Условие для кол-ва товара больше нуля

Автор kik84

Ответов: 3
Просмотров: 257
Последний ответ 16.02.2024, 13:33:24
от kit2m2
WT On fly image handler изображения товара JoomShopping в webp на лету

Автор sergeytolkachyov

Ответов: 9
Просмотров: 1455
Последний ответ 17.10.2023, 12:40:19
от sergeytolkachyov
Убрать модуль в карточке товара JoomShopping

Автор alexkraym

Ответов: 35
Просмотров: 4410
Последний ответ 21.08.2023, 07:17:53
от delchev
Проблема с фото в карточке товара

Автор astapon

Ответов: 18
Просмотров: 1615
Последний ответ 24.04.2023, 12:37:50
от kit2m2
Код товара - автоматическая генерация.

Автор AndreyUA

Ответов: 93
Просмотров: 12504
Последний ответ 17.03.2023, 11:28:47
от geral