Jump to content
Latest News: (loading..)
mdtaylorlrim

Can someone double check my theory about categories?

Recommended Posts

Please?

 

 

I want to change my site so that my categories match the categories provided by my one and only vendor. (Aids in the process of inventory data feed.)(No additional categories should be created or necessary.)

 

Changes necessary:

 

Table: categories : Change categories_id

Table: categories : Change auto_increment to a number beyond greatest new categories_id value

Table: categories_description  : Change category_id

Table: products_to_categories  : Change categories_id   (although this is on a new install with zero products)

 

 

Any other changes anyone can think of?

 

 

Thanks

Mark


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

I don't understand what you need to change here. If this is a new site with no products, just delete all of the sample categories and set up your own categories to suit.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I don't understand what you need to change here. If this is a new site with no products, just delete all of the sample categories and set up your own categories to suit.

 

Regards

Jim

 

it's fairly simple. OSC creates categories starting with category ID 1. As you add a category it automatically advances to 2. Then 3, etc. My vendor categories are 25, 33, 64, 77, 96, etc.

 

 

I get a data feed from a vendor of my store products.. This vendor has products in categories. I get the feed as an XML file and have to put the products into my store using a script that reads the XML file, then writes the various tables. I enter no products by hand. As it is, I read the product id and product category, and to put the product in the store I have to cross reference the categories created by OSC to a list of categories by the vendor in order to get the products in the correct category.

 

By matching the store categories with the vendor categories I have one less call to the database to make for each of the 35k+ products that I import.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

@@mdtaylorlrim

 

Mark, how often do you (or your vendor) add new categories?

 

If not often, can't you just enter all of the categories (no products yet), let osC pick the category ID, manually edit them in the database to what you want them to be, and be done with it?

 

Malcolm


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Frozen" release here

Share this post


Link to post
Share on other sites

Changing the automatically-generated table index fields is generally a bad idea. This can have unintended consequences, such as slowing the table indexing in the database.

 

If you really need a numeric index to match your vendor's category numbers, create a new field in the appropriate table(s) and use that.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

You need to set up the category numbers in the categories and categories_description tables. Obviously they have to match. The products_to_categories table is automatically updated when you add a product, so nothing to change there. Of course your update script will have to handle that.

 

If you want to learn more about the database structure, there's a database schema in the docs directory in your osCommerce distribution package.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×