Post by ri2k » Fri Aug 28, 2020 12:42 pm

I am trying to change the font of 'price' on related products, can someone please tell me which files I should edit for this?

New member

Posts

Joined
Mon Aug 24, 2020 7:31 pm

Post by by mona » Fri Aug 28, 2020 12:47 pm

OC version always required
Themes and extensions also required

product.twig

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by webocreation.com » Fri Aug 28, 2020 12:50 pm

Open catalog/view/theme/YOURTHEME/template/product/product.twig then find

Code: Select all

<h3>{{ text_related }}</h3>
and find near by the above code the following code and change as per your requirement:

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 %} 

Blog free tips and tricks
Free extensions
OpenCart Tutorials
OpenCart Tutorials Youtube Video for developers


User avatar
New member

Posts

Joined
Fri Feb 02, 2018 11:51 pm

Post by ri2k » Fri Aug 28, 2020 1:04 pm

webocreation.com wrote:
Fri Aug 28, 2020 12:50 pm
Open catalog/view/theme/YOURTHEME/template/product/product.twig then find

Code: Select all

<h3>{{ text_related }}</h3>
and find near by the above code the following code and change as per your requirement:

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 %} 
Thank you, it worked! Much appreciated!

New member

Posts

Joined
Mon Aug 24, 2020 7:31 pm

Post by khnaz35 » Fri Aug 28, 2020 1:37 pm

ri2k wrote:
Fri Aug 28, 2020 1:04 pm
Thank you, it worked! Much appreciated!
Great!
kindly add the word [SOLVED] in the beginning of your post title.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by paulfeakins » Fri Aug 28, 2020 7:32 pm

webocreation.com wrote:
Fri Aug 28, 2020 12:50 pm
Open catalog/view/theme/YOURTHEME/template/product/product.twig then find

Code: Select all

<h3>{{ text_related }}</h3>
and find near by the above code the following code and change as per your requirement:

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 %} 
No, this is an awful way to do it, haven't you heard of CSS?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by letxobnav » Fri Aug 28, 2020 7:38 pm

he is only indicating where the related product prices are displayed, what awful way are you talking about?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: Baidu [Spider] and 500 guests