Задача:
Добавить новое поле в свойстве товара, аналогичное полю product_description.
Нужно:
Для отображении информации во вкладкакх , аналогично
http://www.komus.ru/item.php?itemID=50076&catID=659#fragment-1 (там где "Описание, Характеристики и т.д. )
Имеем:
Joomla 1.5.7
Магазин VM 1.1.2
Работающие закладки. (теперь в них нужно занести новое поле)
Вопрос задавал на
http://forum.virtuemart.ru - ответа нет пока
Делал на основании темы
http://joomlaforum.ru/index.php/topic,36710.0.htmlПлан действий :
Открываем administrator\components\com_virtuemart\languages\common\russian.php
Находим
PHPSHOP_PRODUCT_DESC_TITLE (примерно 45 строка)
Вставляем ниже
'PHPSHOP_PRODUCT_HAR_DESC_TITLE' => 'Характеристики',
Находим
'PHPSHOP_PRODUCT_FORM_DESCRIPTION' => 'Описание товара',
Ниже вставляем
'PHPSHOP_PRODUCT_FORM_HAR_DESCRIPTION' => 'Характеристики товара',
заходим в таблицу jos_vm_product и добавляем поле
product_har_desc
В файле administrator/components/com_virtuemart/html/product.product_form.php
Находим
<table class="adminform">
<tr class="row1">
<td valign="top" width="15%"><div style="font-weight:bold;">
<?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_DESCRIPTION') ?>:</div>
</td>
<td width="85%">
<?php
editorArea( 'editor1', htmlspecialchars( $db->sf("product_desc"), ENT_QUOTES ), 'product_desc', '550', '300', '55', '25' )
?>
</td>
</tr>
</table>
Ниже вставляем
<table class="adminform">
<tr class="row1">
<td valign="top" width="15%"><div style="font-weight:bold;">
<?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_HAR_DESCRIPTION') ?>:</div>
</td>
<td width="85%">
<?php
editorArea( 'editor1', htmlspecialchars( $db->sf("product_har_desc"), ENT_QUOTES ), 'product_har_desc', '550', '300', '55', '25' )
?>
</td>
</tr>
</table>
[code]
Открываем файл administrator/components/com_virtuemart/classes/ ps_product.php
Ищем
[code]'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
Ниже вставляем
'product_har_desc' => vmRequest::getVar('product_har_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
В 2 местах
Открываем shop_browse_queries.php
Ищем
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";
Меняем на
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_har_desc` LIKE '%$searchstring%') ";
Ищем
case "desc":
$sq .= "\n (`#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";
Меняем на
case "desc":
$sq .= "\n (`#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_har_desc` LIKE '%$searchstring%') ";
break;
ищем
default:
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";
Меняем
default:
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_har_desc` LIKE '%$searchstring%') ";
Опять ищем
case "desc":
$sq .= "\n (`#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%')";
break;
меняем
case "desc":
$sq .= "\n (`#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%' OR";
$sq .= "\n
$sq .= "\n `#__{vm}_product`.`product_har_desc` LIKE '%$searchstring%')";
break;
ищем
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%')";
Меняем
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_har_desc` LIKE '%$searchstring%')";/[code]
Открываем shop.browse.php
$desc = $ps_product_category->get_description($category_id);
$desc = vmCommonHTML::ParseContentByPlugins( $desc );
/* Prepend Product Short Description Meta Tag "description" when applicable */
$mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
[color=red]Тут что нужно менять?[/color]
Открываем shop.product_details.php
[code]
$product_description = $db_product->f("product_desc");
if( (str_replace("<br />", "" , $product_description)=='') && ($product_parent_id!=0) ) {
$product_description = $dbp->f("product_desc"); // Use product_desc from Parent Product
}
$product_description = vmCommonHTML::ParseContentByPlugins( $product_description );
Добавляем ниже
$product_har_description = $db_product->f("product_har_desc");
if( (str_replace("<br />", "" , $product_har_description)=='') && ($product_parent_id!=0) ) {
$product_har_description = $dbp->f("product_har_desc"); // Use product_har_desc from Parent Product
}
$product_har_description = vmCommonHTML::ParseContentByPlugins( $product_har_description );
Находим
$tpl->set( "product_description", $product_description );
Добавляем
$tpl->set( "product_har_description", $product_har_description );
Результат.
В админке, когда выбираем товар, появилось новое поле "Характеристики товара"
Заходим на сайте в товар (нажимаем "подробнее" - результат - пустая страница.
что-то не так в файле shop.product_details.php, где-то происходит сбой, но не пойму где.
Нужна очень помощь, заранее спасибо.
[/code][/code][/code][/code]