Jump to content

Как сделать зачеркнутую цену?


Recommended Posts

Как сделать зачеркнутую цену, когда у товара скидка? Т.е. чтобы цена в каталоге выглядела так: цена цена со скидкой

 

преста 1.4.4

Link to comment
Share on other sites

эм.. в общем вывел я цену... теперь мне ее нужно зачеркнуть как?

Вывел так:

Ищем такой код в продукт_лист:

{if !$priceDisplay}
{convertPrice price=$product.price}
{else}
{convertPrice price=$product.price_tax_exc}

Заменяем на:

{if !$priceDisplay}{if {convertPrice price=$product.price} != {convertPrice price=$product.price_without_reduction[spam-filter]{convertPrice price=$product.price_without_reduction} {/if}
{convertPrice price=$product.price}
{else}
{convertPrice price=$product.price_tax_exc}

Edited by Art4D (see edit history)
Link to comment
Share on other sites

<s></s> или через CSS text-decoration:line-through

 

это понятно, но я не понимаю как задать, чтобы он зачеркивал именно старую цену?

прописывал что-то вроде: <span class="price" style="text-decoration:line-through">

зачеркивается либо вся цена, либо новая цена(в зависимости куда вставить).

Предполагая что нужно прописать что-то здесь <span class="price" но я хз все перепробовал.

Edited by Art4D (see edit history)
Link to comment
Share on other sites

Отвечу сам себе. Вдруг кому интересно.

 

Заменяем это в product_list.tpl:

{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='On sale!'}</span>

{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span>{/if}

 

На это:

{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span id="old_price" style="text-decoration:line-through; font-size: 120%">{convertPrice price=$product.price_without_reduction}</span>

{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="old_price" style="text-decoration:line-through; font-size: 120%">{convertPrice price=$product.price_without_reduction}</span> {/if}

Link to comment
Share on other sites

×
×
  • Create New...