- Posts: 312
- Thank you received: 19
Can you add a custom class to a product detail page?
- Patrick Toulze
-
Topic Author
- Offline
- Elite Member
-
Less
More
3 years 3 months ago - 3 years 3 months ago #148781
by Patrick Toulze
Can you add a custom class to a product detail page? was created by Patrick Toulze
I search how to add a custom css class to some product details page to be able to make some distinction between some products.
I was thinking at something that add a custom css class to the <div class="class="product-info"">
SUGGESTION:
That will be a great addition to add customizing power to Product details.
In fact, what I want to do is to add an info to product price when the price shown is a “Starting price” depending of options
I already did an HTML override:
I use this code in the layout to be able to translate
Now I need to be able to hide or show this depending on the product.
Having the ability to add a custom class on a specific product will make that easy (e.g class: price-from-show or price-from-hide)
I was thinking at something that add a custom css class to the <div class="class="product-info"">
SUGGESTION:
That will be a great addition to add customizing power to Product details.
In fact, what I want to do is to add an info to product price when the price shown is a “Starting price” depending of options
I already did an HTML override:
I use this code in the layout to be able to translate
Code:
<div class="from-price"><?php echo JText::_('ESHOP_STARTING_PRICE'); ?></div>
Now I need to be able to hide or show this depending on the product.
Having the ability to add a custom class on a specific product will make that easy (e.g class: price-from-show or price-from-hide)
Last edit: 3 years 3 months ago by Patrick Toulze.
Please Log in or Create an account to join the conversation.
- Patrick Toulze
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 312
- Thank you received: 19
3 years 3 months ago - 3 years 3 months ago #148784
by Patrick Toulze
Replied by Patrick Toulze on topic Can you add a custom class to a product detail page?
Last edit: 3 years 3 months ago by Patrick Toulze.
Please Log in or Create an account to join the conversation.
- Patrick Toulze
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 312
- Thank you received: 19
3 years 3 months ago - 3 years 3 months ago #148785
by Patrick Toulze
Replied by Patrick Toulze on topic Can you add a custom class to a product detail page?
I was able to get the product SKU as an added product specific class to the <div class="product-info">
adding this code in the Product detail override like this...
Sadly the result have an illegal class character “:” in “SKU:“
Can I output only the SKU number ?
Having the ability to add a custom class to products will be so much better...
The string seem to validate on W3C:
The uploaded document was successfully checked as HTML 4.01 Strict. This means that the resource in question identified itself as "HTML 4.01 Strict" and that we successfully performed a formal validation of it. The parser implementations we used for this check are based on OpenSP (SGML/XML).
adding this code in the Product detail override like this...
Code:
<div class="product-info <?php echo $this->item->product_sku; ?>">
Sadly the result have an illegal class character “:” in “SKU:“
Code:
<div class="class="product-info SKU: TAK-BOARD_TK-CK-35">
Can I output only the SKU number ?
Having the ability to add a custom class to products will be so much better...
The string seem to validate on W3C:
The uploaded document was successfully checked as HTML 4.01 Strict. This means that the resource in question identified itself as "HTML 4.01 Strict" and that we successfully performed a formal validation of it. The parser implementations we used for this check are based on OpenSP (SGML/XML).
Last edit: 3 years 3 months ago by Patrick Toulze.
Please Log in or Create an account to join the conversation.
- Patrick Toulze
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 312
- Thank you received: 19
3 years 3 months ago - 3 years 3 months ago #149028
by Patrick Toulze
Replied by Patrick Toulze on topic Can you add a custom class to a product detail page?
Forget this one, I transform it in a suggestion
SOLVED
SOLVED
Last edit: 3 years 3 months ago by Patrick Toulze.
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
-
- Offline
- Administrator
-
3 years 2 months ago #149089
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Can you add a custom class to a product detail page?
OK no problem Patrick!
Please Log in or Create an account to join the conversation.
Moderators: Giang Dinh Truong
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.