Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sm,Med,and Lg Images Contribution


Custom

Recommended Posts

I have installed this contribution...

 

the problem... on my product edit page I don't see anywhere to add images...

 

I have set the configuration size of the images to med-300 and lg-500.

 

I have used ExamDiff to try to find something missing and I can't.

 

This is what I have done...

The majority of this readme file is the same that was included in the previous releases of this contribution. I have left it in here for historical reasons so if you would like to go to a previous version, you can.

 

This modification has been tested and done from the 2.2ms2 release and should work for later versions.

 

BEFORE YOU START!! BACKUP YOUR DATABASE, AND ALL FILES BEFORE MAKING ANY OF THE CHANGES BELOW. NOT ALL FILES ARE COMPATIBLE ACROSS DIFFERENT SNAPSHOTS SO THERE IS A GOOD CHANCE YOU WILL BREAK YOUR STORE :)

 

**<<DATABASE CHANGES>>**

We will be adding 4 new rows into the configuration table. This will allow us to set a width and height for your medium images thru the admin, like you currently are able to do with the small images. We will also be adding 2 new columns into the "products" table to allow for medium and large images

 

If you are using phpMyAdmin, you can use the "changes.sql" file provided to make the necessary changes to the database. You can also use the change_optional.sql file to place the small image files into the mediumimage and largeimage files..(note: please read additional data changes to know why you would like to execute the change_optional.sql)

 

Again, BACKUP YOUR DATABASE FIRST.

 

**<<FILE CHANGES>>**

note: All files needing changed are included. All mods are commented with Big Image so you can cut and paste the changes in to the files you have now.

I have taken out the admin popup from the earlier versions. I left the code in the categories file where it should go but have commented it out. I did not change nor include the admin popup_image file from previous releases it is nothing like current popup_image file and I didn't have time to change it.

 

admin/categories.php - Make changes on lines mentioned below or replace

admin/includes/languages/english/categories.php - Make changes as mentioned below or replace

admin/includes/languages/espanol/categories.php - Make changes as mentioned below or replace note I don't know espanol

admin/includes/languages/german/categories.php - Make changes as mentioned below or replace note I don't know german

catalog/popup_image.php -  Make changes on lines mentioned below or replace

catalog/product_info.php -  Make changes on lines mentioned below or replace

 

 

*** admin/categories.php file *** if you do not have any other mods you can just replace.

places in the file that need changing .. changes are in the included file and are marked with BIG IMAGE

on about line 224

on about line 311

on about line 353

on about line 391

on about line 422

on about line 438

on about like 628

on about line 691

on about line 698

on about line 808

on about line 907

on about line 911

 

*** catalog/product_info.php  file ***

*** on about line 72

*** replace line

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

*** with

 

// Big Image Amended Line

//    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_mediumimage, p.products_largeimage, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

********************************************

 

*** on about line 104 you will need to replace from

    if (tep_not_null($product_info['products_image'])) {

*** til you get to

          <p><?php echo stripslashes($product_info['products_description']); ?></p>

 

*** with

 

// Big Image Replace start

    if (tep_not_null($product_info['products_image'])) {

?>

          <table border="0" cellspacing="0" cellpadding="2" align="right">

            <tr>

              <td align="center" class="smallText">

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_mediumimage'], addslashes($product_info['products_name']), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_mediumimage']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_mediumimage'], $product_info['products_name'], MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

              </td>

            </tr>

          </table>

<?php

    }

// Big Image Replace end

 

********************************************

 

 

*** catalog/popup_image.php file ***

on about line 16

replace

$products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " .

with

// BIG IMAGE Amended

//  $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");

  $products_query = tep_db_query("select pd.products_name, p.products_largeimage from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");

 

 

********************************************

 

on line 38

replace

<?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>

 

with

<?php

// BIG Image Amended

// echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']);

echo tep_image(DIR_WS_IMAGES . $products['products_largeimage'], $products['products_name']);

?>

 

 

********************************************

 

I notice on the older version it had you edit the admin popup image file as well... could that have something to do with it?

 

TIA

Link to comment
Share on other sites

It sounds like you missed a couple of edits in admin/categories.php. These should be near the end of the file. Check the list given in the instructions for the line numbers.

 

Regards

Jim

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

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...