Post by ri2k » Mon Aug 24, 2020 7:41 pm

I found many tutorials for older versions but not fur 3.0.3.6.

I was able to change the colour of 'in stock' text, but how do I change the colour of 'out of stock'?
Last edited by ri2k on Sun Sep 06, 2020 3:45 am, edited 1 time in total.

New member

Posts

Joined
Mon Aug 24, 2020 7:31 pm

Post by by mona » Mon Aug 24, 2020 8:12 pm

principle is the same
what specifically is not working for the principle applied found and your version?

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.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ri2k » Tue Aug 25, 2020 3:28 am

Hi, thanks for your reply, what's not working is that I don't know where to edit to change the 'out of stock' status text. I don't know where to look or which file I should edit.

Can you please help? Thank you.

New member

Posts

Joined
Mon Aug 24, 2020 7:31 pm

Post by ri2k » Tue Aug 25, 2020 3:35 am

And my version is 3.0.3.6 as mentioned in the title.

New member

Posts

Joined
Mon Aug 24, 2020 7:31 pm

Post by by mona » Tue Aug 25, 2020 4:32 am

Ok. How about trying something like this then ..
catalog/view/theme/default/template/product/product.twig

Code: Select all

<li>{{ text_stock }} {% if stock == "In Stock" %}<span style="color:blue">{% else %}<span style="color:red">{% endif %}{{ stock }}</span></li>

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.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ri2k » Tue Aug 25, 2020 5:21 am

Thank you! It worked! Thank you very much!

New member

Posts

Joined
Mon Aug 24, 2020 7:31 pm

Post by by mona » Tue Aug 25, 2020 5:41 am

you are most welcome

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.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by tantadruj » Mon Dec 21, 2020 2:02 am

opencart 3.0.3.2
Default theme

Hi,
i have used this solution and it works fine but it is "In Stock" and works only for english. my site is multilingual. I can change "In Stock" in other language and then it is works for this language only. Does anyone have a universal solution? For out of stock which is not defined by the word it works obviously in all languages.
thanks

New member

Posts

Joined
Fri Jun 23, 2017 12:40 pm

Post by by mona » Mon Dec 21, 2020 2:59 am

No there is no universal solution without a modification which is paid.

Code: Select all

<li>{{ text_stock }} {% (if stock == "In Stock" or if stock == "whatever")  %}<span style="color:blue">{% else %}<span style="color:red">{% endif %}{{ stock }}</span></li>

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.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: Google [Bot] and 7 guests