Zen Cart Logo
Forums / General Questions / How can I automatically set default picture for categories and products?

How can I automatically set default picture for categories and products?

Views: 1,501

Results 1 to 11 of 11
19 Sep 2013, 1:11 PM
#1
gsmsalers avatar

gsmsalers

New Zenner

Join Date:
Feb 2009
Posts:
71
Plugin Contributions:
0

How can I automatically set default picture for categories and products?

Hi.
How can I automatically set default picture for categories and products if I didn't choose picture when I create categories/products?
Please let me know.

19 Sep 2013, 1:56 PM
#2
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: How can I automatically set default picture for categories and products?

gsmsalers:

Hi.
How can I automatically set default picture for categories and products if I didn't choose picture when I create categories/products?
Please let me know.

Just edit your product or category and load the image.

20 Sep 2013, 4:55 AM
#3
gsmsalers avatar

gsmsalers

New Zenner

Join Date:
Feb 2009
Posts:
71
Plugin Contributions:
0

Re: How can I automatically set default picture for categories and products?

I need better answer. I don't have time and available picture at the moment for hundreds of categories when I import from CVS file. But I need automatic default picture for hundreds of categories (with missing picture). It could be same picture for all of them.

20 Sep 2013, 8:55 AM
#4
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: How can I automatically set default picture for categories and products?

gsmsalers:

I need better answer. I don't have time and available picture at the moment for hundreds of categories when I import from CVS file. But I need automatic default picture for hundreds of categories (with missing picture). It could be same picture for all of them.

A quick cheat: replace the default ’no image' image with your own image?

20 Sep 2013, 2:46 PM
#5
gsmsalers avatar

gsmsalers

New Zenner

Join Date:
Feb 2009
Posts:
71
Plugin Contributions:
0

Re: How can I automatically set default picture for categories and products?

Thank you.
But it only changes product image, not category. Is there any other solution for category?

picandnix:

A quick cheat: replace the default ’no image' image with your own image?

20 Sep 2013, 5:00 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How can I automatically set default picture for categories and products?

But it only changes product image, not category. Is there any other solution for category?
In your admin - where you can view categories - at the right is an "edit" button to edit the category - you can add/change the image there

20 Sep 2013, 5:03 PM
#7
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How can I automatically set default picture for categories and products?

There's no way I know to add a 'missing image' default image to categories without custom coding.

20 Sep 2013, 5:09 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How can I automatically set default picture for categories and products?

stevesh:

no way I know to add a 'missing image' default image
Opps!! missed the "missing image" requirement...

3 Oct 2013, 8:13 AM
#9
gsmsalers avatar

gsmsalers

New Zenner

Join Date:
Feb 2009
Posts:
71
Plugin Contributions:
0

Re: How can I automatically set default picture for categories and products?

Do you know how to do that custom coding? I have seen zen masters are very helpful on this kind of issue.

stevesh:

There's no way I know to add a 'missing image' default image to categories without custom coding.

3 Oct 2013, 12:12 PM
#10
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How can I automatically set default picture for categories and products?

I don't, no. I've found that Zenners fluent in PHP who are here on the forums often offer code snippets to do the kind of thing you're asking for, but there's no way to predict what questions will catch their interest.

3 Oct 2013, 2:43 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How can I automatically set default picture for categories and products?

If the goal is to have a specific category image display when there isn't a categories_image defined, you could customize things such as:
/includes/modules/category_row.php

using your templates and overrides ... and change the image:

  while (!$categories->EOF) {
    if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = '[B]pixel_trans.gif[/B]';
    $cPath_new = zen_get_path($categories->fields['categories_id']);

and change it from the clear image to one of your own ...