Добавление информации о ширине и высоте товара в Virtuemart на fly-страницу

По умолчанию в Virtuemart 1.0.15 такой возможности нет, поэтому сабж.Для того, чтобы добавить информацию о товаре, которая не предусмотрена (почему-то) разработчиками, нужно поправить два файла.

Плюс ко всему я использовал floor() для отделения дробной части (мне она не нужна — товар измеряется в целых сантиметрах).

Файл shop.product_details.php (у меня со строки 362):

//объявляем длину и ширину товара
$product_width = floor($db_product->f('product_width'));
$product_height = floor($db_product->f('product_height'));

/** NOW LET'S BEGIN AND FILL THE TEMPLATE **/
$template = str_replace( "{navigation_pathway}", $navigation_pathway, $template );
$template = str_replace( "{navigation_childlist}", $navigation_childlist, $template );
$template = str_replace( "{product_name}", $product_name, $template );
...
$template = str_replace( "{product_width}", $product_width, $template ); // Ширина товара
$template = str_replace( "{product_height}", $product_height, $template ); // Высота товара

Файл flypage.php:

<tr style="font-style: italic;">
<td rowspan="1" colspan="2"><hr />{product_description}<br /><br />
Ширина: {product_width} см.<br />
Высота: {product_height} см.<br />
<span style="font-style: italic;">{file_list}</span></td>
</tr>

 

0

Добавить комментарий