Итакс краткий мануал
Нам потребуються такие файлы
shop.browse.php,
shop.product_details.php,
shop_browse_queries.phpОбычно лежат тут administrator/components/com_virtuemart/html
И конечно ваши шаблоны категории товара,и описания товара обычно лежат тут /administrator/components/com_virtuemart/html/templates/browse/browse_X.php и тут administrator/components/com_virtuemart/html/templates/product_details/flypage_X.php
(где X- ваш номер или название)
Открываем
shop.browse.php примерно строка 357 вобщем вставлялось
после этого участка кода $product_name = $db_browse->f("product_name");
if( $db_browse->f("product_publish") == "N" ) {
$product_name .= " (".vmHtmlEntityDecode(_CMN_UNPUBLISHED).")";
}
Вот этот код :// Check for new product wher $db_product query is "SELECT * FROM #__{vm}_product WHERE
// product_id='$product_id' "
if ((time() - $db_browse->f("cdate")) < (14 * 86400)) { // 14 Days * (number of seconds in 24 hours)
//$new_tag = "New Item"; // code required for new tag - text only version
$new_tag = '<img src="'. $mosConfig_live_site .'/images/stories/product resources/new_item.png" width="76" height="18" border="0" alt="New Item" title="New Item" align="right">'; // code required for new tag
} else {
$new_tag = "";
}
Затем в этом же файле немного ниже ,приблизительно строка 428 ,я вставлял ниже этой секции
$product_cell = str_replace( "{quantaty}", $quantaty, $product_cell );
$product_cell = str_replace( "{product_name}", shopMakeHtmlSafe( $product_name ), $product_cell );
$product_cell = str_replace( "{product_s_desc}", $product_s_desc, $product_cell );
$product_cell = str_replace( "{product_details...}", $product_details, $product_cell );
$product_cell = str_replace( "{product_rating}", $product_rating, $product_cell );
$product_cell = str_replace( "{product_price}", $product_price, $product_cell );
$product_cell = str_replace( "{form_addtocart}", $form_addtocart, $product_cell );
$product_cell = str_replace( "{product_sku}", $db_browse->f("product_sku"), $product_cell );
Вот это
$product_cell = str_replace( "{product_new}", $new_tag, $product_cell );Сохраняем фал больше его трогать ненадо
Открываем /administrator/components/com_virtuemart/html/
shop_browse_queries.phpсрока 26 там должно быть;
$fieldnames = "`product_name`,`products_per_row`,`category_browsepage`,`category_flypage`,`#__{vm}_product`.`product_id`,`#__{vm}_category`.`category_id`,`product_full_image`,`product_thumb_image`,`product_s_desc`,`product_parent_id`,`product_publish`,`product_in_stock`,`product_sku`";
Меняем на
$fieldnames = "`product_name`,`products_per_row`,`category_browsepage`,`category_flypage`,`#__{vm}_product`.`product_id`,`#__{vm}_category`.`category_id`,`product_full_image`,`product_thumb_image`,`product_s_desc`,`product_parent_id`,`product_publish`,`product_in_stock`,`product_sku`,`#__{vm}_product`.`cdate`";
Сохраням и этот ..
Теперь правим наши шаблоны
/administrator/components/com_virtuemart/html/templates/browse/browse_X.php (где X ваше название шаблона)
Кстати если вы не знаете какой шаблон используеться зайдите в виртумарт посмотрите в компоненты/VirtueMart/Дерево категорий/категория товара-поле "Category Browse Page"
или в глобальных настройках.
Вобщем надо вставить заглушку {product_new} в любое место в вашем browse_X.php
Идем дальше в /administrator/components/com_virtuemart/html/shop.product_details.php
Открываем ,строка примерно 253 где то преред таким кодом;
/* MORE IMAGES ??? */
$more_images = "";
if( !empty($images->images) ) {
Вставляем это:
// Check for new product wher $db_product query is "SELECT * FROM #__{vm}_product WHERE
// product_id='$product_id' "
if ((time() - $db_product->f("cdate")) < (14 * 86400)) { // 14 Days * (number of seconds in 24 hours)
//$new_tag = "New Item"; // code required for new tag
$new_tag = '<img src="'. $mosConfig_live_site .'/images/stories/product resources/new_item.png" width="82" height="24" border="0" alt="New Item" title="New Item" align="right">'; // code required for new tag
} else {
$new_tag = "";
}
Затем ищем такой участок кода
$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_image}", $product_image, $template );
$template = str_replace( "{full_image}", $full_image, $template ); // to display the full image on flypage
$template = str_replace( "{more_images}", $more_images, $template );
$template = str_replace( "{file_list}", $file_list, $template );
$template = str_replace( "{edit_link}", $edit_link, $template );
$template = str_replace( "{manufacturer_link}", $manufacturer_link, $template );
$template = str_replace( "{product_price}", $product_price, $template );
$template = str_replace( "{product_s_desc}", $db_product->f("product_s_desc"), $template );
$template = str_replace( "{product_description}", $product_description, $template );
$template = str_replace( "{product_weight}", $db_product->f("product_weight"), $template );
$template = str_replace( "{product_sku}", $db_product->f("product_sku"), $template );
$template = str_replace( "{addtocart}", $addtocart, $template );
$template = str_replace( "{product_reviews}", $product_reviews, $template );
$template = str_replace( "{product_reviewform}", $product_reviewform, $template );
$template = str_replace( "{product_availability}", $product_availability, $template );
$template = str_replace( "{vendor_link}", $vendor_link, $template );
$template = str_replace( "{mosConfig_live_site}", $mosConfig_live_site, $template );
$template = str_replace( "{related_products}", $related_product_html, $template );
$template = str_replace( "{product_type}", $product_type, $template ); // Changed Product Type
$template = str_replace( "{product_packaging}", $product_packaging, $template ); // Changed Packaging
И первым вверху ,перед
$template = str_replace( "{navigation_pathway}", $navigation_pathway, $template ); вставляем
$template = str_replace( "{product_new}", $new_tag, $template );
И последнее открываем /administrator/components/com_virtuemart/html/templates/product_details/flypage_X.php
И вставляем заглушку {product_new}
Товарисч с форума виртумарта навел весь код флаера, так ленивым можно скопировать в блокнот и сохранить как
flypage.php
{navigation_pathway}
<br/>
<table border="0" cellpadding="3" cellspacing="0" width="595" align="center">
<tr>
<td rowspan="4" width="160" valign="top" style="text-align:center;">
{product_image}<br/><br/>
{product_availability}
<!-- {product_rating} -->
</td>
<td rowspan="1" height="20" width="275">
<h3>{product_new}{product_name} <!-- {edit_link} --></h3>
</td>
<td rowspan="4" width="160" valign="top" align="center">
{more_images}<br>
</td>
</tr>
<tr>
<td width="275" height="10" valign="top" align="left">{manufacturer_link}<br /></td>
<!-- <td valign="top">{product_packaging}<br /></td> -->
</tr>
<tr>
<td width="275" height="10" valign="top" align="left"><h4>{product_price}</h4></td>
</tr>
<tr>
<td width="275" valign="bottom" align="center">{addtocart}</td>
</tr>
<tr>
<td colspan="3"><hr />{product_description}<br/>{file_list}</td>
</tr>
<tr>
<td colspan="3">{product_type}</td>
</tr>
<tr>
<td colspan="3"><hr />{product_reviews}</td>
</tr>
<tr>
<td colspan="3">{product_reviewform}<br /></td>
</tr>
<tr>
<td colspan="3" align="center">{related_products}<br /></td>
</tr>
<tr>
<td colspan="3" align="center">{vendor_link}<br /><br /></td>
</tr>
</table>
{navigation_childlist}<br style="clear:both"/>
Не претендую на авторство
Возможны очепятки, хотя старался
Пользуйтесь источником (ссылка выше) а мое это так разьяснение..
Спасибо за внимание