Code: Select all
<file path="catalog/controller/product/product.php">
<operation info="Count the reviews value">
<search>
<![CDATA[$data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']); ]]>
</search>
<add position="after">
<![CDATA[ //custom var for counting reviews
$data['count_reviews'] = $product_info['reviews'];
]]>
</add>
</operation>
<operation info="Price And Currency Value">
<search><![CDATA[ if ((float)$product_info['special']) {]]> </search>
<add position="before">
<![CDATA[ //custom filter price value
$data['price_val'] = preg_replace('/[^0-9.]/', '', $data['price']);
$data['currency_code'] = $this->session->data['currency'];
]]>
</add>
</operation>
<operation info="Special price value">
<search><![CDATA[ $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);]]>
</search>
<add position="before">
<![CDATA[ //custom filter special price value
$data['price_special_val'] = preg_replace('/[^0-9.]/', '', $data['special']);]]>
</add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/product.twig">
<operation>
<search>
<![CDATA[ <ul class="breadcrumb">]]>
</search>
<add position="replace" offset="4">
<![CDATA[ <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
{% set i = 0 %}
{% for breadcrumb in breadcrumbs %}
<li {% if loop.first == false %} itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" {% endif %} >
<a itemprop="item" href="{{ breadcrumb.href }}">
<span {% if loop.first == false %} itemprop="name" {% endif %}>{{ breadcrumb.text }}</span> </a>
{% if loop.first == false %} <meta itemprop="position" content="{{ i }}" /> {% endif %}
</li>
{% set i=i+1 %}
{% endfor %}
</ul>]]>
</add>
</operation>
<operation>
<search>
<![CDATA[<div id="content" class="{{ class }}">{{ content_top }}]]>
</search>
<add position="before">
<![CDATA[<div itemscope itemtype="https://schema.org/Product">]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ <img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />]]>
</search>
<add position="replace">
<![CDATA[<img src="{{ thumb }}" itemprop="image" title="{{ heading_title }}" alt="{{ heading_title }}" />]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ <div class="tab-pane active" id="tab-description">{{ description }}</div>]]>
</search>
<add position="replace">
<![CDATA[<div class="tab-pane active" id="tab-description" itemprop="description" > {{description }}</div>]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ <h1>{{ heading_title }}</h1>]]>
</search>
<add position="replace">
<![CDATA[
<span itemprop="sku" style="display:none;">{{ model }}</span>
<h1 itemprop="name" >{{ heading_title }}</h1>
<span itemprop="brand" style="display:none;"> {{ manufacturer }} </span>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="url" style="display:none;">{{ share }} </span>
<span itemprop="priceValidUntil" style="display:none;">{{ "now"|date_modify("6 month")|date('Y-m-d' ) }}</span>
]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ <li>{{ text_stock }} {{ stock }}</li>]]>
</search>
<add position="before">
<![CDATA[ {% if stock == 'In Stock' %}
<link itemprop="availability" href="http://schema.org/InStock" >
{% else %}
<link itemprop="availability" href="http://schema.org/OutOfStock" >
{% endif %}]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ {% if price %}]]>
</search>
<add position="replace" offset="10">
<![CDATA[ {% if price %}
<span itemprop="priceCurrency" style="display:none;">{{ currency_code }}</span>
<ul class="list-unstyled">
{% if not special %}
<li>
<span itemprop="price" style="display:none;"> {{ price_val }}</span>
<h2>{{ price }} </h2>
</li>
{% else %}
<li><span style="text-decoration: line-through;">{{ price }}</span></li>
<li>
<span style="display:none;" itemprop="price">{{ price_special_val }}</span>
<h2 >{{ special }}</h2>
</li>]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ {% for discount in discounts %}]]>
</search>
<add position="after" offset="4">
<![CDATA[</div>]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ <p>{% for i in 1..5 %}]]>
</search>
<add position="before">
<![CDATA[
{% if rating > 0 and count_reviews > 0 %}
<div class="rating" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<span style="display:none;" itemprop="ratingValue">{{ rating }}</span>
<span style="display:none;" itemprop="bestRating">5</span>
<span style="display:none;" itemprop="worstRating">1</span>
<span style="display:none;" itemprop="reviewCount">{{ count_reviews }}</span>
</div>
{% endif %}]]>
</add>
</operation>
<operation>
<search>
<![CDATA[ {{ column_right }}</div>]]>
</search>
<add position="before">
<![CDATA[</div>]]>
</add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/review.twig">
<operation>
<search>
<![CDATA[<table class="table table-striped table-bordered">]]>
</search>
<add position="replace" offset="6">
<![CDATA[
<table class="table table-striped table-bordered" itemprop="review" itemscope itemtype="http://schema.org/Review">
<tr>
<td style="width: 50%;" itemprop="author"><strong>{{ review.author }}</strong></td>
<td class="text-right" itemprop="datePublished" content="{{ review.date_added }}">{{ review.date_added }}</td>
</tr>
<tr>
<td colspan="2"><p itemprop="reviewBody">{{ review.text }}</p>
]]>
</add>
</operation>
</file>
</modification>