Post by Joe1234 » Thu Jan 20, 2022 12:35 am

I edited the file "admin/view/template/catalog/product_list.twig" in order to change the color of the quantity in the product list in the admin, but I'm not seeing any change.
Line 174

Code: Select all

<td class="text-right">{% if product.quantity <= 0 %} <span class="label label-warning">{{ product.quantity }}</span> {% elseif product.quantity <= 5 %} <span class="label label-danger">{{ product.quantity }}</span> {% else %} <span class="label label-success">{{ product.quantity }}</span> {% endif %}</td>
Am I in the wrong file or wrong line? I refreshed the cache and browser.

Thanks.

v3.0.3.8
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by Gergely » Thu Jan 20, 2022 12:50 am

Hi Joe1234,

At a glance, that looks like the original code to me. What did you change it to?
Directly editing core files is strictly not recommended, and not at all necessary in this case. You should include the necessary rules in a custom css stylesheet instead.

As to why the changes are not showing up, one can only guess:
Do you have any modifications installed? If so, make sure to refresh modifications via Admin > Extensions > Modifications > Refresh button in the top right corner.

Hope this is useful, let me know if you need further help with this!
Gergely

Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm

Post by thekrotek » Thu Jan 20, 2022 12:56 am

The code looks fine to me, but you could make is much smaller. Something like this:

Code: Select all

<td class="text-right"> <span class="label label-{{ product.quantity <= 0 ? "warning" : (product.quantity <= 5 ? "danger" : "success") }}"></span></td>

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by DigitCart » Thu Jan 20, 2022 1:25 am

Hi
Also, If the theme cache is enabled, You need to refresh it from the admin dashboard / gear icon (developer settings)

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by Joe1234 » Thu Jan 20, 2022 3:27 am

@Gergely, That was the original code, I posted that so people would know exactly what I was trying to edit. You were right about the modification refresh, that fixed it thanks. Yes I know editing the files directly isn't the best, but I just can't be bothered to search for the right stylesheet, then the right class, and figure out the right coding, ahhhh. It is easier for me to just grab the file that's clearly named and find the spot that I need to edit. My edits are simple and not that many, it's easier to do that and document it for when I upgrade.

v3.0.3.8
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by paulfeakins » Fri Jan 21, 2022 7:43 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 6 guests