Forums / Customization from the Admin / Adding an option for a separate close-up image

Adding an option for a separate close-up image

Locked

Views: 661

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
3 Jun 2010, 11:09 PM
#1
terranrich avatar

terranrich

New Zenner

Join Date:
Jun 2010
Posts:
28
Plugin Contributions:
0

Adding an option for a separate close-up image

Hi all,

So I want to have the ability for products in my store to have one image for the thumbnail/product image, and a second image for a close-up. I'm having trouble getting the admin "New Product" form to upload the second image.

I added a "products_image_large" field after the existing "products_image" field in the "products" table in the database with the same exact parameters (data type, etc.). I even added a second field for uploading the second image file.

But when the item is added to the database, "products_image_large" remains empty.

Can somebody tell me what I am supposed to edit in the update_product.php file? I've made the following changes:

  • Below:
$sql_data_array['products_image'] = zen_db_prepare_input($_POST['products_image']);

...I added:

$sql_data_array['products_image_large'] = zen_db_prepare_input($_POST['products_image_large']);
  • Below:
    if ($_POST['image_delete'] == 1) {
      $sql_data_array['products_image'] = '';
      $new_image = 'false';
    }

...I added:

    if ($_POST['image_large_delete'] == 1) {
      $sql_data_array['products_image_large'] = '';
      $new_image_large = 'false';
    }

I'm not sure what else I need to edit.

3 Jun 2010, 11:21 PM
#2
terranrich avatar

terranrich

New Zenner

Join Date:
Jun 2010
Posts:
28
Plugin Contributions:
0

Re: Adding an option for a separate close-up image

Never mind, I figured it out. I didn't change anything in the "preview_info.php" file, which I guess is where the image is uploaded, not "update_product.php".

Of course, if the documentation for Zen Cart were better, instead of forcing us to stumble into hurdles as we blindly go along, I'd have known this already.