Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problems with Extra Image


burntool

Recommended Posts

Hi,

 

total newb, 2 questions.

 

1. Wherever I place:

	 	
if (DISPLAY_EXTRA_IMAGES == 'true'){
 if ($product_check['total'] >= 1) {
   include (DIR_WS_INCLUDES . 'products_extra_images.php');
 }
}

in product_info.php I get following error

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /homepages/20/d171575071/htdocs/osc/includes/functions/database.php:13) in /homepages/20/d171575071/htdocs/osc/includes/functions/database.php on line 13

 

Is that because of the place I put the code or is the problem in the database.php???

I just can't figure it out. I am using a template where I don't have the code as described in the install.txt.

Any way to solve this?

 

2. Can I somehow change the pulldown menu that is displayed in the admin interface so that it would consist of the product names instead of models?

Link to comment
Share on other sites

I have the identical problem, but hadn't realised it was the Extra Images Contribution that was causing this. I might try removing it and see if that solves it.

It only seems to happen when I browse to Admin/index.php

If I go to any other address in admin it's fine, but it's still annoying!

 

It would be great if someone new how to fix this.

 

These are the files I edited or changed when installing Extra Images:

 

/admin/includes/filenames.php

/admin/includes/database_tables.php

/admin/includes/boxes/catalog.php

/admin/includes/languages/english.php

/catalog/includes/filenames.php

/catalog/includes/database_tables.php

/catalog/includes/languages/english.php

/catalog/product_info.php

 

Kenny

--------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

  • 2 weeks later...
I've had the same problem...I hope someone can figure this out... :(

 

 

Same issue here, I didn't realise why I had a whole list of blank items (all of which worked as they were supposed to just with a name)

 

Now that you say it's a list of models that makes a more sense and that does work nicely now.

 

I would MUCH prefer if that field referred to product names instead.

 

Does anyone know how to change this??

Link to comment
Share on other sites

OK, it seems to work for me now... Here is a paste of lines 186 - 211 so you get a little before and after to see where I have put things:

	 	
<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
  </tr>
<?php
} else {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
  </tr>
<?php
} 
   if (DISPLAY_EXTRA_IMAGES == 'true'){
 if ($product_check['total'] >= 1) {
   include (DIR_WS_INCLUDES . 'products_extra_images.php');
 }
} 
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>

 

This seems to get the extra images working as it should (at least for me).

 

I'm still very much interested in getting products in that list rather than models since we don't use models and it's just more info we have to go back and add. Incidently, if we do have to go down this path, is there anyway to extend the model field past it's 12 characters?

Link to comment
Share on other sites

I looked at my code and the difference was what's in the ****** stars **** below...

	 	
<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
  </tr>
<?php
} else {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
  </tr>
<?php
} ********else {*******
   if (DISPLAY_EXTRA_IMAGES == 'true'){
 if ($product_check['total'] >= 1) {
   include (DIR_WS_INCLUDES . 'products_extra_images.php');
 }
} 
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>

I took the else { out and it works fine. Thanks a million, The_Hawk

Link to comment
Share on other sites

Gotta love friends. One of my mates fix it so it shows the product name in the drop down box... this then led to another problem, the table then needs to be fixed so it also shows product name :)

 

Anyway, there is only two changes that need to be made to get this working (although the table heading still says model, it actually reports product name)

 

Enjoy :)

 

in file: catalog/admin/products_extra_images.php

 

goto line 27:

$products_query = tep_db_query("select products_id, products_model from " . TABLE_PRODUCTS . " order by products_model");

and replace with:

$products_query = tep_db_query("select p.products_id as products_id, pd.products_name as products_model from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = " . $languages_id . " order by pd.products_name");

 

Then head down to line 130:

$products_extra_images_query_raw = "select pei.products_extra_image, pei.products_extra_images_id, pei.products_id, p.products_model from " . TABLE_PRODUCTS_EXTRA_IMAGES . " pei left join " . TABLE_PRODUCTS . " p ON pei.products_id = p.products_id order by p.products_model";

 

and replace with:

  $products_extra_images_query_raw = "select pei.products_extra_image, pei.products_extra_images_id, pei.products_id, pd.products_name as products_model from " . TABLE_PRODUCTS_EXTRA_IMAGES . " pei left join " . TABLE_PRODUCTS . " p on pei.products_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id order by p.products_model";

 

And thats it :)

 

Maybe not the prettiest implementation, but it seems to work nicely!

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