-
Removing Images From Product Pages without removing them from Category Pages
I'd like to remove the main image from the product page, as the page is for a pack containing a varity of different products but having done this the image then disappears from the category listings. Is there anyone I can get rid of one without losing the other?
This is the product page (sans image)
http://www.pipersfarm.com/zen-cart/i...roducts_id=158
This is the category page (also sans image for the product in question)
http://www.pipersfarm.com/zen-cart/i...index&cPath=12
Any help much appreciated,
Ed
-
Re: Removing Images From Product Pages without removing them from Category Pages
What did you do to remove the image in question?
-
Re: Removing Images From Product Pages without removing them from Category Pages
I typed none.gif as the image name as suggested in the zen cart tutorial.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Okay, using none.gif removes the main product image everywhere. To show them on the listings pages and other palaces but not on the product detail page then you should be able to "remove" it with some CSS.
find #productMainImage in your style sheet. Remove any other css properties and replace with:
#productMainImage {display: none;}
-
Re: Removing Images From Product Pages without removing them from Category Pages
Legendary... I love your parrot.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Though that may be a little premature. How do I avoid removing all the images? That stylesheet covers all the product pages doesn't it? Am I being really stupid? Why did I even ask that? Of course I am.
-
Re: Removing Images From Product Pages without removing them from Category Pages
I could do it just for a single $cPath if that helps...
-
Re: Removing Images From Product Pages without removing them from Category Pages
Perhaps something along the lines of the script that disables sideboxes on certain pages? How would one go about incorporating this:
Code:
if (in_array($current_page_base,explode(",",'index')) ) {
$flag_disable_left = true;
}
if (in_array($cPath,explode(",",'1,2,3.....etc etc')) ) {
$flag_disable_right = true;
$flag_disable_left = false;
}
into the tpl_product_info_display.php page?
-
Re: Removing Images From Product Pages without removing them from Category Pages
Oh ... I didn't understand you only wanted to remove the main image from certain products ... Hhhmmm
I would use a different product type for the ones you don't want the main image for and use the CSS fix instead of messing in the code. :)
-
Re: Removing Images From Product Pages without removing them from Category Pages
OK, so I have a new product type but the CSS still governs it and the Product - General type. Apologies again for the stupidity but how do I seperate the CSS?
-
Re: Removing Images From Product Pages without removing them from Category Pages
#productGeneral #productMainImage {display: none;}
or
#productYourType #productMainImage {display: none;}
whichever is appropriate.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Thanks, though in the end I went for using a c_??.css stylesheet (where ?? is the cat. no.) which edited the images from the single category. A p_??.css also does that for individual products. No need to create any new product types! Though it was good SQL practice, terrifying as it is to mess with the database.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Hello! I want to REMOVE images from particular products. How do I do this? You stated to use some kind of code p_??.css But where do I put this? How do I apply this? I understand that the ?? is replaced by the product number, but how and where do I put this code?
Any help will be greatly appreciated. Thanks.
Derwin
-
Re: Removing Images From Product Pages without removing them from Category Pages
This would be an additional stylesheet which you would add to your /your_template/css/ folder. That stylesheet would look something like
/* special styling for product id ?? */
#productMainImage {display: none;}
See the css_read_me file in /template_default/css/ for more information.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Hello! I added a new stylesheet. I named it stylesheet2. I put this code in it:
/* special styling for product id 47 */
#productMainImage {display: none;}
I placed it in the exact location recomended, but nothing worked.
I also just placed the above code in the existing file called "stylesheet.css", but also nothing changed.
What am I doing wrong?
Is there a specific place to put this, or what exactly needs to be done? I am really confused about this.
I am soooooooooo greatful for any help in this.
Derwin
-
Re: Removing Images From Product Pages without removing them from Category Pages
I believe you have to name it p_??.css (where the ?? is replaced by the product's number).
There is a file includes/templates/template_default/css/CSS_read_me.txt
you should read through.
HTH,
-
Re: Removing Images From Product Pages without removing them from Category Pages
HTH....Wow! Thank you. This worked perfectly.
But this removed the image from the actual product page, but not from the other location.
Here is what I have....
Catagory....All Cigar Brands
Subcatagory.....Macanudo
sub/subcatagory.....Cafe
then the individual products.
The code given to me eliminated the image from the actual product page, but how do I also eliminate the PRODUCT IMAGES from the sub/subcatagory page?
The website is www.joescigarshop.com and you can see that under "Cafe" is listed all of the Cafe Products. How do I eliminate all of the product images from THIS location?
You are the BEST. I really appreciate this help.
Derwin
-
Re: Removing Images From Product Pages without removing them from Category Pages
Hey.....I FIGURED IT OUT! Thanks for all your help. This forum is simply FANTASTIC. Thanks again.
:clap:
Derwin
-
Re: Removing Images From Product Pages without removing them from Category Pages
Would you mind sharing what worked? :)
-
Re: Removing Images From Product Pages without removing them from Category Pages
Well, I just went to each specific product and clicked on "edit". Then I simply put "none" in the image line and pressed preview and update. This removed the image from all the places.
But there is still a "line" that is where the image should be. This is showing on the subcategory page where it shows all of the products under that category.
IS THERE A WAY TO TAKE AWAY THAT LINE?
My site is www.joescigarshop.com and you can click on the All Cigar Brands link. Then click on Macanudo. Then click on Cafe. You can see all the products under Cafe, and see the line to the left of each product. HOW DO I REMOVE THIS LINE?
Derwin
-
Re: Removing Images From Product Pages without removing them from Category Pages
You would follow the css_read_me directions and make another stylesheet named:
c_14_21_22.css
with contents of:
.dc.prod_c1 {display: none;}
This will control listing images for that subcategory only. You will need the same file renamed for each subcat you want to treat this way.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Glen, YOU ARE THE BEST! This worked perfectly.
But can you tell me what each element stands for? This way I can do this with all of the rest of the products. I tried figuring it out myself, but with no success. So, what did you do to work this magic? What does the NAME of the css file stand for, and what does the content of the file stand for?
You help with this is simply fantastic.
Derwin
-
Re: Removing Images From Product Pages without removing them from Category Pages
The filename can be gotten from the cPath (category path) shown in the address bar when on the listing page. It includes the id of the top category and each subcat in the path.
c_14_21_22.css
The CSS code
.dc.prod_c1 {display: none;}
means that elements with class tags of class="dc prod_c1" will not be displayed.
Ordinarily you would want to add some higher-level tags (like #productListing) to be sure the effects are limited to this case, but since this stylesheet is only applied to this page, that is not necessary.
Standard Zen Cart class/id tags are generally named meaningfully so you can get at least a basic understanding of their purpose, but Template Monster hacks out many of those names and adds many, many cryptic tags which require close inspection of the code to understand. In some cases they remove all identifiers so an element cannot be addressed individually in their template. That's one reason for TM's reputation in this forum.
-
Re: Removing Images From Product Pages without removing them from Category Pages
Glenn,
Wow! This is just great. You have relieved many headaches for me. Thank you for taking the time to help.
Derwin