For demonstration purposes;
In catalog/controller/extension/module/featured.php file,
find:
add below:
Then, find:
add below:
In catalog/view/theme/<your_theme>/template/extension/module/featured.twig file,
add:
Between these codes and where and when you want the reward to be shown:
In catalog/controller/product/category.php file,
find:
add below:
Then, find:
add below:
In catalog/view/theme/<your_theme>/template/product/category.twig file,
find:
add above:
In catalog/controller/extension/module/featured.php file,
find:
Code: Select all
if ((float)$product_info['special']) {
$special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$special = false;
}
Code: Select all
if ((int)$product_info['reward']) {
$reward = (int)$product_info['reward'];
} else {
$reward = false;
}
Code: Select all
'special' => $special,
Code: Select all
'reward' => $reward,
add:
Code: Select all
{% if reward %}
<p>{{ reward }}</p>
{% endif %}
Code: Select all
{% if product.price %}
<p class="price">
{% if not product.special %}
{{ product.price }}
{% else %}
<span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span>
{% endif %}
{% if product.tax %}
<span class="price-tax">{{ text_tax }} {{ product.tax }}</span>
{% endif %}
</p>
{% endif %}
find:
Code: Select all
if ((float)$result['special']) {
$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$special = false;
}
Code: Select all
if ((int)$result['reward']) {
$reward = (int)$result['reward'];
} else {
$reward = false;
}
Code: Select all
'special' => $special,
Code: Select all
'reward' => $reward,
find:
Code: Select all
{% if product.rating %}
Code: Select all
{% if reward %}
<p>{{ reward }}</p>
{% endif %}
Last edited by straightlight on Sun Oct 15, 2017 9:56 pm, edited 1 time in total.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thanks for spending the time providing this, i've been through all the steps but it doesn’t seem to be working - I have tried clearing the theme cache.
The only thing I noticed is this bit:
In catalog/controller/extension/product/category.php file,
I didn’t have that but added the code to:
catalog/controller/product/category.php
Its the default theme and I haven’t done any other customisation except to hide the price in the product detail view.
Thanks in advance
The only thing I noticed is this bit:
In catalog/controller/extension/product/category.php file,
I didn’t have that but added the code to:
catalog/controller/product/category.php
Its the default theme and I haven’t done any other customisation except to hide the price in the product detail view.
Thanks in advance
You are correct for the category path. it has now been updated. However, ensure to clear all caches, not just one cache.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
In addition, the reward must also reflect from the Opencart admin product where the product to category is being linked to. A reward must be added for that particular product so for the catalog-end to notice the differences.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Sorry still no luck, I have clearing the cache using the tools in the dashboard and also cleared browser cache and cookies.
I have also tried installing a new OC 3 in my local environment and carrying out your instructions again but I still don’t see reward points in the featured and category product views despite clearing cache in dashboard, browser and from the storage folder.
I’m not sure what I could be doing wrong, any ideas?
I have also tried installing a new OC 3 in my local environment and carrying out your instructions again but I still don’t see reward points in the featured and category product views despite clearing cache in dashboard, browser and from the storage folder.
I’m not sure what I could be doing wrong, any ideas?
Have you followed the instructions on the above regarding the product reward points from the admin products page?I’m not sure what I could be doing wrong, any ideas?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Im not 100% sure what you mean there but I can confirm that all products have a reward points value assigned to them and I can see this in the product detail view where I have successfully hidden the price and just show the reward points.