Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Mar 2004
    Location
    Calgary, Alberta
    Posts
    290
    Plugin Contributions
    1

    help question Product - Master Category problem

    Along the way I believe thhe "Master Category" was added to the system. I am not sure how my problem occured, but I have a lot of products with a Master Category of 0. Some are linked cats, others are not.

    If its a linked cat I can select the proper cat from the list, but for the ones that arent I don't have an easy way to fix this. Is there a script for updating the master categories. I'm using ZC 1.3.6

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Product - Master Category problem

    1. do a full database backup of your mysql data
    2. Admin->Tools->Store Manager ---->Reset ALL Products Master Categories ID
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Product - Master Category problem

    Note: if you reset the Master Categories ID ... you then want to run the Update Products Price Sorter as well ...

    WARNING: if you are using Linked Products ... be careful!! Updating the Master Categories ID will select the first categories_id found in the products_to_categories table as the master_categories_id

    If you are missing master_categories_id from the products table it sounds like you are importing products ...

    If you are not importing and missing this setting on the products then you have something messed up in the code on your Admin ...

    This is all managed as files are added, edited, moved, etc. for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Mar 2004
    Location
    Calgary, Alberta
    Posts
    290
    Plugin Contributions
    1

    Default Re: Product - Master Category problem

    Well I haven't been importing products, I was leary of doing that and messing things up in a nasty way.

    The new products added are working, these are ones added with 1.26 or earlier I believe. Also I run PHP 5 / MYSQL 5 which could be part of thhe problem as I did have troubles with copying products as well.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Product - Master Category problem

    All of those things could contribute to the problem ...

    Did the updates on master_categories_id and products_price_sorter fix these issues?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Product - Master Category problem

    Recent versions of the quick_updates mod have the option to view and update your master cats quickly.

    latest version can currently be found here:
    http://www.zen-cart.com/forum/showpo...&postcount=153

  7. #7
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: Product - Master Category problem

    Hi,
    I also just noticed a problem with "invalid master category id" in a store that was upgraded from v1.35 to 1.36 (files uploaded, upgrade was db upgrade).

    However in addition to the products giving the invalid master id error, they also have this error message at the top of the product edit screen:

    Warning: reset() [function.reset]: Passed variable is not an array or object in /my/path/edited/for/security/admin/includes/classes/object_info.php on line 29

    Warning: Variable passed to each() is not an array or object in /my/path/edited/for/security/admin/includes/classes/object_info.php on line 30

    the object_info.php file has not been modified. Also when looking at the product in the product edit screen the description is gone.

    Any suggestions as to where to begin searching for a fix to this error?

    betty

  8. #8
    Join Date
    Nov 2004
    Location
    Glasgow, Scotland
    Posts
    251
    Plugin Contributions
    0

    Default Re: Product - Master Category problem

    I have exactly the same error messages as reported by Betty. I have looked at the Products table within the database and the Master Category ID seems to be set correctly. There is nothing obvious missing.

    I am running v 1.3.5

    I have this problem with just a few products - not all.

    The products display correctly in the Catalogue and customers appear to be able to order OK. It's just when I try to edit the product details in Admin that the error appears. The products have probably been copied and moved over time so the cause may be related to this - but others that have been copied and/or moved do not exhibit the problem.

    Resetting the Master Categoies ID does not solve the problem.

    Any ideas anyone?

    Thanks,

    Alan

  9. #9
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,133
    Plugin Contributions
    11

    Default Re: Product - Master Category problem

    Don't know if it will help but we created the problem for ourselves by changing the product_type in the database. When we changed it back, the error in Admin went away.

  10. #10
    Join Date
    Nov 2004
    Location
    Glasgow, Scotland
    Posts
    251
    Plugin Contributions
    0

    Default Re: Product - Master Category problem

    I can now replicate this problem so I now think I know the cause.

    If a product has been copied (linked) from one category to another and it is decided to delete the product from the master category but not from the secondary category then in Admin

    Catalog>Categories/Products>Master Category>Product

    if you click on the delete button (red x) you are then given a choice of which copy of the product you wish to delete. If you choose to delete the copy in the Master Category (tick the box) but not the copy in the secondary category (un-tick the box) and then click 'Delete' the copy of your product in the Master Category will be deleted but the copy in the secondary category will still be there. If you now go to the secondary category and try to edit it you will get the following error:

    Code:
    Warning: reset(): Passed variable is not an array or object in /home/1256/tester/rcm.testingit.net/public_html/admin/includes/classes/object_info.php on line 29
    
    Warning: Variable passed to each() is not an array or object in /home/1256/tester/rcm.testingit.net/public_html/admin/includes/classes/object_info.php on line 30
    and none of your product details will appear in the edit product screen.

    Fortunately the product will still appear in the catalog and customers will still be able to purchase it.

    In the database you will find that in the 'products' table the 'master_categories_id' is set to the categories_id of the category the product has just been deleted from whereas in the products_to_categories table you will find that the products_id is only linked to the secondary categories_id, the entry linking the product to the master categories_id having been deleted by the above action.

    Changing the master_categories_id in the products table to match the categories_id linked to the product_id in the products_to_categories table does not solve the problem. Neither does resetting all Products Master Categories and Products Price Sorter in the Store Manager which in essence does the same thing.

    I know that the above action should not be carried out - and there are plenty of warnings in big red letters - but that hasn't stopped my client!

    Anyone any idea how to put this right?

    Regards,

    Alan

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Product Master Category: ID# 0
    By Sunabac in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 8 Aug 2017, 03:18 PM
  2. v138a lost product due to master category
    By tjmuse in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 Dec 2012, 01:57 AM
  3. How can I link a product to a master category?
    By PudzPud in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 2 Jul 2010, 03:44 PM
  4. Replies: 10
    Last Post: 30 Apr 2010, 04:46 PM
  5. Code to Get Master Category ID of a Product
    By gems14k in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Dec 2006, 04:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR