Hello, I would like to know how to change color example h1 only on the product page, the shopping cart page, I know how to do it for the home page but not for the other pages.PHP Code:<?php
// -----
// Set a different color for the h1 tag only on the home page.
//
if ($this_is_home_page) {
?>
<style>
h1 {color: red;}
</style>
<?php
}
// -----
// Load an additional stylesheet.
//
?>
Giovanni,
Zen Cart V2.1
The product page and shopping cart page have their own css files you can set up.
includes/templates/bootstrap/css/shopping_cart.css
includes/templates/bootstrap/css/product_info.css
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
By the way what I want to know is how to replace if ($this_is_home_page) with the name of the page example if ($this_is_product_info_page) does not work as well as ($this_is_shopping_cart_page) does not work. it's not to complicate my life but, it will allow me to do a lot of things if I know the exact name of the page to put on if ($this_is_home_page).
Giovanni,
Zen Cart V2.1
$this_is_home_page is a special case; it's not done for other pages.
If you want to check the name of the current page you can do so using the variable $current_page_base.
if ($current_page_base == 'shopping_cart') {
...
}
if ($current_page_base == 'product_info') {
...
}
but if all you're doing is adding page-specific CSS, you'd be better off doing it the way I suggested; that way you can upgrade your template at any time and not lose these customizations.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Exact it is so as not to touch the basic model. Thank you, it worked for me, if now I want to put 2 or more pages for exampleHTML Code:if ($current_page_base == 'product_info') { +HTML Code:if ($current_page_base == 'product_info PLUS another page, ') {
Giovanni,
Zen Cart V2.1
The PHP syntax for this would be
if ($current_page_base == 'product_info' || $current_page_base == 'some-other-page' ) {
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.