Jump to content

Default Manufacturer ?


Nik Grey

Recommended Posts

I have searched and cant find the answer, one of my 'Lighter' questions :)

 

Having just set up my test site (for testing) I realised that I have filled my 'Live' CC with product but haven't set the 'Manufacturer' - the products look a bit better with the manufacturer field populated.

 

So, before I go through each product (will fill my Saturday Night) is there a way of setting the manufacturer as 'Default' ?

Link to comment
Share on other sites

Unfortunately, no. The manufacturers table uses a 'id' key which makes the association between this table and the manufacturer column of the inventory table.

 

The manufacturer column in the inventory table has null as a default. This can be changed (maybe using phpMyAdmin) to make the default value for this column a 1 (for example). You would be ALTERing the inventory table.

 

The key to the manufacturer table cannot be zero (or null). So, you will need to pick a manufacturer as the default, learn the value in the 'id' column for that record, then use that number as the default value when you ALTER the inventory table.

 

The above will get you your "default" manufacturer for all newly added items.

 

You will need to run a query against the inventory table to UPDATE all existing records that have a null value to set the manufacturer column to have the default manufacturer 'id' value.

 

I'm not able to give you step-by-step instructions on how to use phpMyAdmin to do the above, but if you need to know the query that will update the inventory table, let me know.

Link to comment
Share on other sites

UPDATE CubeCart_inventory SET manufacturer = 1 WHERE manufacturer IS NULL;

 

If there is a table prefix, be sure to prepend it to CubeCart. The value 1 is actually the value of the manufacturer you determined by looking in the CubeCart_manufacturer table.

Link to comment
Share on other sites

I must be doing something wrong:

 

Select the Inventory table,

SQL Tab,

enter: UPDATE CubeCart_inventory SET `manufacturer` = 1 WHERE `manufacturer` IS NULL;

 

Go

 

(0 Rows affected)

 

Tried selecting the 'Inventory' from the Fields on the right and still the same.

 

It would be faster for me to set everything in the manufacturer column to 1 than do these One by One from the store front if this isnt going to work.

Link to comment
Share on other sites

Editing the table row by row is certainly faster than CubeCart editing product by product.

 

You can try the command without the backticks on manufacturer. (I made that update to my post very shortly after posting, so you must have read my post from some source other than these forums, or almost immediately after I posted it.)

 

From looking at the inventory table, can you determine if there are any rows that, in fact, have null in the manufacturer column?

Link to comment
Share on other sites

I usually come straight back here once I see an email of an update, so I probably didnt see your update without the backticks as I wouldn't notice such small detail :)

 

I just tried it without the backticks and still no joy - here's an image with what's in the Manufacturer column:

 

inventory.png

 

I changed the first two manually.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...