The OC3 website im working on is here https://www.logo-golfballs.co.uk/titlei ... f-umbrella, as you can see via view source, no body tag classes.
I cannot find any other ways to style product or category pages easily, and i cannot find any other code/tags which serves the same purpose (maybe a customised wrapping div). I have seen this kind of post before, where it is something so obvious, but if there is a really obvious solution, i am being dumb, and need help!
I need to be able display the red text on this page https://www.logo-golfballs.co.uk/titlei ... f-umbrella 'Please make sure the colour...' for certain products only and in the exact location it is in.
If custom styling is no longer possible, if anyone can suggest another solution, it would be much appreciated.
Thanks
Matt
From OC 2.3:
catalog\controller\common\header.php
Code: Select all
// For page specific css
if (isset($this->request->get['route'])) {
if (isset($this->request->get['product_id'])) {
$class = '-' . $this->request->get['product_id'];
} elseif (isset($this->request->get['path'])) {
$class = '-' . $this->request->get['path'];
} elseif (isset($this->request->get['manufacturer_id'])) {
$class = '-' . $this->request->get['manufacturer_id'];
} elseif (isset($this->request->get['information_id'])) {
$class = '-' . $this->request->get['information_id'];
} else {
$class = '';
}
$data['class'] = str_replace('/', '-', $this->request->get['route']) . $class;
} else {
$data['class'] = 'common-home';
}
Code: Select all
<body class="<?php echo $class; ?>">
catalog\view\theme\default\template\common\header.twig
Code: Select all
<body class="{{ class }}">
EAN
UPC
JAN
MPN
ISBN
etc.
put that text with markup in one of those fields in admin for those products, remove the field label in the product.twig or put another label in your language file, and it will display there.
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.
Thanks for posting the code suggestions.
I had seen this header code before for OC 2, and i did try it, but it did not work with
Code: Select all
<body class="<?php echo $body_class; ?>">
So, when i saw your code suggestions for OC3 body tag
Code: Select all
<body class="{{ class }}">
Code: Select all
<body class="">
I have cleared cache via dashboard and also refreshed mods several times and Ctrl F5 a few times.
If you have any idea why it isn't working, i'm all ears!
Matt
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.
You may need to refresh the modifications in admin panel / extensions / modifications
https://www.opencart.com/index.php?rout ... n_id=26852
Basically this will enable you to choose any product / category / layout - or exclude any product / category / layout
You can just create an 'empty' module called “styling” add an empty row (to enable the module) add custom css styling for that specific page and add it to layouts, it will add the styling to that specify page or pages as you wish ..
Oh and you can add mods, create galleries, add links, advertising banners, colour page changes, headers etc etc etc with it also .. I like flexibility!
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
And no admin demo...by mona wrote: ↑Tue Jul 23, 2019 3:01 amThis extension will do that
https://www.opencart.com/index.php?rout ... n_id=26852
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
No demo, I tried that once - once bitten twice shy .. would you like I create a temporary one just for youxxvirusxx wrote: ↑Tue Jul 23, 2019 3:14 amAnd no admin demo...by mona wrote: ↑Tue Jul 23, 2019 3:01 amThis extension will do that
https://www.opencart.com/index.php?rout ... n_id=26852
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
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Thanks for posting, but i would like a simpler, specific and targeted solution, which i still haven't found yet, and am still thinking it will something straight forward.
If anyone has any ideas how i can style individual products/category pages etc, let me know.
Maybe you can spot an error with code solutions suggested already, as they don't work, or any suggestion really.
Basically, i need to hide the red text here https://www.logo-golfballs.co.uk/callaw ... hrome-soft under product options (code has been added to theme file) for certain products.
Thanks
Matt
first you wanted to be able to display
for certain productsThis product includes a one-time fee of £30.00
now you want to be able to hide
for certain products which is in itself confusing for customers specifically, why don't you do the check yourself?Please make sure the colour quantities here don't exceed the Quantity selected in the drop down menu above. For example, if you require 18 doz golf balls, choose 12 - 24 doz. If this is not correct your order may be delayed. Please refer to the pricing table.
and what has all this to do with styling the body tag?
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.
Please re read my post.
I never ever mentioned this text on this post - 'This product includes a one-time fee of £30.00'.
Right from the start of the post I have made it VERY clear that this is the text I would like to hide for some products:
'Please make sure the colour...'
I'm not sure what the rest of you post is getting at.
I would just like to be able to add classes to the body tag as i believe this is the best way to style product pages, categories, etc.
It's actually a no brainer.
But thanks for your input.
Matt
true, no brain involved there.It's actually a no brainer.
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.
While the suggestion that I posted earlier should work, you can also use {{ product_id }} in product.twig:
Code: Select all
<p class="quantitymessage quantitymessage-{{ product_id }}">your text</p>
Users browsing this forum: OSWorX and 321 guests