Jump to content

Category images don't assign when adding


bedfordprint

Recommended Posts

If you add a category and add an image, complete all the fields and click save, picture uploads but is not automatically assigned to the category.

You need to go to edit and click the image you want and save.

The error from the log is:

 

File: [index.inc.php] Line: [6] "ALTER TABLE `retCubeCart_inventory` ADD `upload_images` TINYINT( 1 ) NOT NULL" - Duplicate column name 'upload_images'

Link to comment
Share on other sites

Something is not quite right.

 

In a stock CubeCart v5, there is no file named index.inc.php. The file name will be something like, categories.index.inc.php.

 

This might be a mod (perhaps, where the customer can upload a personal image to be affixed to the product?). Thus, the mod will be wanting to alter the database. The error is originating from the mySQL database.

 

Yes, the image is not automatically assigned to the newly added category (or newly added product when adding products). I suppose, however, that an assumption can be made. (I'll experiment with this.)

Link to comment
Share on other sites

Try this. In /admin/sources/categories.index.inc.php, near line 69 (for CC5213):

Was:
    } else {
        if (!empty($_POST['cat']['cat_name']) && $GLOBALS['db']->insert('CubeCart_category', $_POST['cat'])) {
 
Now:
    } else { $_POST['cat']['cat_image'] = (int)$file_id;
        if (!empty($_POST['cat']['cat_name']) && $GLOBALS['db']->insert('CubeCart_category', $_POST['cat'])) {

 

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...