Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Removing Images From Product Pages without removing them from Category Pages

Removing Images From Product Pages without removing them from Category Pages

Locked

Views: 6,208

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
24 Sep 2007, 7:19 PM
#1
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

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/index.php?main_page=product_info&cPath=12&products_id=158

This is the category page (also sans image for the product in question)
http://www.pipersfarm.com/zen-cart/index.php?main_page=index&cPath=12

Any help much appreciated,

Ed

24 Sep 2007, 7:44 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

Re: Removing Images From Product Pages without removing them from Category Pages

What did you do to remove the image in question?

24 Sep 2007, 9:38 PM
#3
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

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.

24 Sep 2007, 9:48 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

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;}

24 Sep 2007, 9:51 PM
#5
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

Re: Removing Images From Product Pages without removing them from Category Pages

Legendary... I love your parrot.

24 Sep 2007, 10:02 PM
#6
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

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.

24 Sep 2007, 10:20 PM
#7
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

Re: Removing Images From Product Pages without removing them from Category Pages

I could do it just for a single $cPath if that helps...

24 Sep 2007, 10:35 PM
#8
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

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:

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?

24 Sep 2007, 11:05 PM
#9
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

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. :)

25 Sep 2007, 8:46 PM
#10
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

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?

25 Sep 2007, 10:43 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Removing Images From Product Pages without removing them from Category Pages

#productGeneral #productMainImage {display: none;}

or

#productYourType #productMainImage {display: none;}

whichever is appropriate.

26 Sep 2007, 8:01 AM
#12
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

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.

2 Jan 2008, 9:27 PM
#13
derwin avatar

derwin

New Zenner

Join Date:
Dec 2007
Posts:
38
Plugin Contributions:
0

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

3 Jan 2008, 6:46 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

3 Jan 2008, 2:28 PM
#15
derwin avatar

derwin

New Zenner

Join Date:
Dec 2007
Posts:
38
Plugin Contributions:
0

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

3 Jan 2008, 2:57 PM
#16
madmumbler avatar

madmumbler

Zen Follower

Join Date:
Dec 2005
Location:
SWFL
Posts:
450
Plugin Contributions:
0

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,

3 Jan 2008, 3:11 PM
#17
derwin avatar

derwin

New Zenner

Join Date:
Dec 2007
Posts:
38
Plugin Contributions:
0

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 https://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

3 Jan 2008, 4:23 PM
#18
derwin avatar

derwin

New Zenner

Join Date:
Dec 2007
Posts:
38
Plugin Contributions:
0

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

3 Jan 2008, 5:09 PM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Removing Images From Product Pages without removing them from Category Pages

Would you mind sharing what worked? :)

3 Jan 2008, 5:17 PM
#20
derwin avatar

derwin

New Zenner

Join Date:
Dec 2007
Posts:
38
Plugin Contributions:
0

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 https://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