Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Add atrributes to ALL Products, Globally

Add atrributes to ALL Products, Globally

Locked

Views: 1,336

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
21 Nov 2008, 7:43 AM
#1
drhiii avatar

drhiii

New Zenner

Join Date:
Jul 2006
Posts:
83
Plugin Contributions:
0

Add atrributes to ALL Products, Globally

Go ahead and shoot me as I know this has probably been beat on many times, but...

I am trying to apply attributes to ALL products sitewide. I have 54,000 photos broken down into about 150 "categories". This will take awhile to apply attributes by these individual categories. The problem is these 150 categories are the first location that show up when Copying Attributes to Category. These Categories are two level deep, meaning the Top level Category is labeled

/Photos

and the second level is

Photos/Store Galleries

Is there a global way to assign attributes sitewide?

For a more specific picture, the layout looks like the following. :

/Photos/Store Galleries/Gallery1
Gallery2
Gallery3
Gallery4

and so on. I can only apply the attributes to the Gallery1, Gallery2, Gallery3. Life would be a LOT easier if I could apply them to /Photos, but it is not being offered up.

Sooooooooooooooooo, is there some way to assign attributes to all products, sitewide, that I may be missing?

It is also a looming problem because when adding photos to the sub, sub category, the attributes are NOT carried down into the newly added content. Kind of a drag.

Any help or insight would be much appreciated. The has to be a way methinks... am just not seeing it.

21 Nov 2008, 7:59 PM
#2
drhiii avatar

drhiii

New Zenner

Join Date:
Jul 2006
Posts:
83
Plugin Contributions:
0

Re: Add atrributes to ALL Products, Globally

Not possible?

24 Nov 2008, 1:21 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Add atrributes to ALL Products, Globally

We have a number of Copy methods on the Attributes from the Option Names Manager and Option Values Manager and the Attributes Controller but not the copy to everything ...

This could, however, always be written by adapting one of these methods ...

Have you got your coder hat on? :smartalec:

24 Nov 2008, 1:35 AM
#4
drhiii avatar

drhiii

New Zenner

Join Date:
Jul 2006
Posts:
83
Plugin Contributions:
0

Re: Add atrributes to ALL Products, Globally

Heh, my coder hat? I am one of those "enough to be dangerous types".

But you are right. If you want something done, may end up needing to do it yourself.

I am using ZenCart because there is a 'bridge' between G2 or Gallery2 and ZC. It works reasonably well. The maintainer of this is continuing to touch it, thank heavens. But because of this bridge, I have been able to import over 50,000 images and have them acquire attributes. What I cannot do is manage them completely thru the ZenCart administration, completely. Only partially.

The elements that remain broken are the image attributes displaying properly in I.E., being able to manage attributes completely through the ZC Admin panels (like global apply of attributes), and what I have not seen any mention of is the bolting in of CoolIris technology. This latter is really becoming a cool factor, and have seen other commerce packages adopting this display standard. Only reason I mention it here is that I would suggest the Zen community take heed, because there is a reason that display feature being adopted by other packages. You can have features up the yin-yang, but CoolIris is a coming technology and I would really encourage a consideration of this addon.

Anyhoo... I am going to have to learn some stuff to get my code hat on. I agree with you. Have to take some of this on myself. But remember the mentioning of the above issues. Especially I.E. displaying image attributes consistently (a big problem), and Cool Iris. These are interface and appearance things and that is what people see first. Other packages may be deficient in features, but appearance is everything.

Now, where is that hat....

PS... I did figure out a way to apply the attributes through the Gallery2 admin interface, and then go tweak them in ZenCart. Cumbersome, but works. I had to remove 54,000 images so I could work. Otherwise, it was click and wait for upwards of 4-5 minutes for the click to work thru all 54,000 item attributes because I could click again. Awkward. But now, will reimport the 50K images and believe it will now work.

24 Nov 2008, 1:53 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Add atrributes to ALL Products, Globally

If you were to look at the attributes_controller.php and how the copy all attributes from one product to a category of products works and adapt it to grab all the products_id values from the products table you should be able to accomplish a lot of what you are trying to do ...

I am not sure how you want the images handled on this so that may still need to be worked out but look at this piece of code:

// attributes copy to category
    case 'update_attributes_copy_to_category':
      $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
      $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
      $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
      if ($_POST['categories_update_id'] == '') {
        $messageStack->add_session(WARNING_PRODUCT_COPY_TO_CATEGORY_NONE . ' ID#' . $_POST['products_filter'], 'warning');
      } else {
        $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $_POST['categories_update_id'] . "'");
        while (!$copy_to_category->EOF) {
          zen_copy_products_attributes($_POST['products_filter'], $copy_to_category->fields['products_id']);
          $copy_to_category->MoveNext();
        }
      }
      $_GET['action']= '';
      $products_filter = $_POST['products_filter'];
      zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
      break;
24 Nov 2008, 2:14 AM
#6
drhiii avatar

drhiii

New Zenner

Join Date:
Jul 2006
Posts:
83
Plugin Contributions:
0

Re: Add atrributes to ALL Products, Globally

Thank you. Yes, I see this. The logic of how Zen is laid out, thanks to folks like you, is becoming clearer.

I ended up deleting the 50K of images, constructing the Name and Option Values thru the G2 admin interface, and am now reimporting. A totally unnecessary kludge, but... I see exactly what you are expressing here. One the import process is done, chug-a-lug... takes many hours... I will take this on.

I appreciate your exposure of this slice of code. I understand what I am looking at which makes me a little more, dangerous. :flex:

24 Nov 2008, 2:45 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Add atrributes to ALL Products, Globally

Glad that this could help ...

Perhaps you could post your solution for this when you have it working for others who might need a similar feature ...

Remember us when you are rich and famous!! :cool:

24 Nov 2008, 3:09 AM
#8
drhiii avatar

drhiii

New Zenner

Join Date:
Jul 2006
Posts:
83
Plugin Contributions:
0

Re: Add atrributes to ALL Products, Globally

Of course! Always post the solutions. Always. Open source is the way.

And funny you should mention that too. Am working with another engineer on something related to the frontend image aspect of another image repository application, that will be released into the public. Is why ZenCart has become a favored thing on the backend side... but... CoolIris CoolIris CoolIris. Maybe if I say it enough times, someone with the proper skills (I am not there yet) will hear, mebbe??? :smartalec:

CoolIris.

Had to sneak that in.