Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2


surfalot

Recommended Posts

The autoinstaller doesn't handle modified stores very well. In this case, I would start by removing the distinct from that SQL string. This may just reveal more problems, but it's a start.

 

Regards

Jim

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

Link to comment
Share on other sites

  • Replies 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

The autoinstaller doesn't handle modified stores very well. In this case, I would start by removing the distinct from that SQL string. This may just reveal more problems, but it's a start.

 

Regards

Jim

 

 

Thanks for the speedy reply!

 

I'm in way over my head here but the distinct part is for; http://addons.oscommerce.com/info/3152 a product notification addon. It worked before i installed this addon.

Link to comment
Share on other sites

The "_subomage" queries are used to retrieve the new images that More Pics Classic adds to your store. If the autoinstaller added these to queries that don't retrieve image data, you can safely remove those. If you remove them from queries that are supposed to retrieve the images, parts of this Addon will stop working. You should compare your modified files to the ones in the Addon download to make certain you've done this right/ A good file comparison program will help a lot here.

 

Regards

Jim

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

Link to comment
Share on other sites

The "_subomage" queries are used to retrieve the new images that More Pics Classic adds to your store. If the autoinstaller added these to queries that don't retrieve image data, you can safely remove those. If you remove them from queries that are supposed to retrieve the images, parts of this Addon will stop working. You should compare your modified files to the ones in the Addon download to make certain you've done this right/ A good file comparison program will help a lot here.

 

Regards

Jim

 

Yep it added it to queries for other addons as well (in categoires.php).

 

 

other than that pektsektye's autoinstallers have workerd great for me. Thank you for taking the time to do them.

Edited by kurios
Link to comment
Share on other sites

  • 2 weeks later...

I'm having a little problem with this contribution, combined with a contribution called Optional Related Products...

Can anybody spot anything wrong here?

 

The code starts off like this:

 $orderBy = 'ORDER BY ';
 $orderBy .= (RELATED_PRODUCTS_RANDOMIZE)?'rand()':'pop_order_id, pop_id';
 $orderBy .= (RELATED_PRODUCTS_MAX_DISP)?' limit ' . RELATED_PRODUCTS_MAX_DISP:'';
 $attributes = "
	 SELECT
	 pop_products_id_slave,
	 products_name,
	 products_model,
	 products_price,
	 products_quantity,
	 products_tax_class_id,
	 products_image
	 FROM " .
	 TABLE_PRODUCTS_RELATED_PRODUCTS . ", " .
	 TABLE_PRODUCTS_DESCRIPTION . " pa, ".
	 TABLE_PRODUCTS . " pb

 

 

and further down the page, where images are processed, it looks like this:

 // show thumb image if Enabled
  if (RELATED_PRODUCTS_SHOW_THUMBS == 'True') {
	echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . "\n"
		 . tep_image(DIR_WS_IMAGES . $reviews['image_filename'],

$attributes_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"').'</a><br>' . "\n";
  }
  $caption = '';
  if (RELATED_PRODUCTS_SHOW_NAME == 'True') {
	$caption .= '<p>' . $products_name_slave;
	if (RELATED_PRODUCTS_SHOW_MODEL == 'True') {

 

Does anybody have any hint on to what i could change, to make this work?

Maybe you will need to know that the page this code in on, is placed in includes/modules

 

Thank you in advance

Link to comment
Share on other sites

You've got the image name right in the second part, but you're not retrieving that image in the SQL in the first part. You need to change the image name there as well, then add in the Images table to get the data from. Look at one of the pages like reviews.php. Compare the modified page to a stock osCommerce copy and you'll see what the changes look like.

 

Regards

Jim

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

Link to comment
Share on other sites

You've got the image name right in the second part, but you're not retrieving that image in the SQL in the first part. You need to change the image name there as well, then add in the Images table to get the data from. Look at one of the pages like reviews.php. Compare the modified page to a stock osCommerce copy and you'll see what the changes look like.

 

Regards

Jim

 

Hello jim,

Thanks for your reply, but my coding seems to limit me here...

I've had a look at the reviews coding, and tried to replace some bits to the one used there, but it didn't seem to work (definitely my fault.. )

I guess that what i can't figure out is how to add the image table to get the data from it..

any hints?

Link to comment
Share on other sites

The code that you posted is incomplete, so this is a bit of a guess. That first block of code should look something like this:

 

$orderBy = 'ORDER BY ';
 $orderBy .= (RELATED_PRODUCTS_RANDOMIZE)?'rand()':'pop_order_id, pop_id';
 $orderBy .= (RELATED_PRODUCTS_MAX_DISP)?' limit ' . RELATED_PRODUCTS_MAX_DISP:'';
 $attributes = "
	 SELECT
	 pop_products_id_slave,
	 products_name,
	 products_model,
	 products_price,
	 products_quantity,
	 products_tax_class_id,
	 pi.image_filename
	 FROM " .
	 TABLE_PRODUCTS_RELATED_PRODUCTS . ", " .
	 TABLE_PRODUCTS_DESCRIPTION . " pa, ".
	 TABLE_PRODUCTS . " pb 
	  left join " . TABLE_PRODUCTS_IMAGES . " pi 
		on pb.products_id = pi.products_id 
		  and pi.product_page = '1'

Regards

Jim

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

Link to comment
Share on other sites

I notice now that i don't have the option to delete the extra pics, only the main image. This can't be right?

 

How do i get the option to delete the extra pics, i must have done something stupid, is there a line to add somewhere?

 

Thanks for your patience

Link to comment
Share on other sites

You should be able to remove the image on the Product page where you originally added it. If not, you may have missed an edit in catalog/admin/categories.php. Unfortunately there are several places this could be. Check your edits using a comparison program.

 

Regards

Jim

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

Link to comment
Share on other sites

You should be able to remove the image on the Product page where you originally added it. If not, you may have missed an edit in catalog/admin/categories.php. Unfortunately there are several places this could be. Check your edits using a comparison program.

 

Regards

Jim

 

Yep i found it, thanks for your speedy reply!

Link to comment
Share on other sites

Hello guys,

 

I'm having problem with getting the image to show when using the xsell module.

I guess it has something to do with the SQL strings in the xsell_products.php file but i dont know how to fix it.

Would be great if someone with knowledge about this error could help me.

 

Here is the query from the xsell_products.php file wich i guess needs to be modified:

 

$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, specials_new_products_price from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_XSELL);

Link to comment
Share on other sites

Hello guys,

 

I'm having problem with getting the image to show when using the xsell module.

I guess it has something to do with the SQL strings in the xsell_products.php file but i dont know how to fix it.

Would be great if someone with knowledge about this error could help me.

<snipped>

Read this.

 

Regards

Jim

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

Link to comment
Share on other sites

Firstly, thank you for an awesome contribution. The site I am working on is my fist oscommerce site so please bare with me :)

 

I installed a contribution that allowed me to have multiple columns in my products grid. I then installed More Pics and my column grid has gone back to one, even though in my configuration console i have stated 3 columns. Do you have any idea what code changed in (i am assuming) my index.php file to over write the product listing columns?

 

Below is my Config for my product listing.

 

prod_listing.jpg

 

Also in product info:

2 of my 6 products have the correct "large" images sizes, and the other 4 have the smaller images sizes. I have double checked the images and they all are correct, but on the product_info site, it is a hit and miss whether they appear correctly or not. I would like them to retain their "true" width and height - and i have set the settign to true, so I am at a bit of a loss here

 

again thank you in advance for the help.

Edited by Shadane
Link to comment
Share on other sites

I'm not familiar with your other addon, especially since you don't name it. Use your comparison program to compare the two files. It should be pretty obvious where they differ. You'll need to merge the changes by hand, not just overwrite files.

 

Image sizes are controlled in your Admin Configuration settings. There is a set of configs under Images, and another under More Pics for the image substitution box if you use that option. The settings in Images should all be blank. For the More Pics box, see the Admin Configuration section of the how_to_use.txt in the distribution.

 

Regards

Jim

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

Link to comment
Share on other sites

I'm not familiar with your other addon, especially since you don't name it. Use your comparison program to compare the two files. It should be pretty obvious where they differ. You'll need to merge the changes by hand, not just overwrite files.

 

Image sizes are controlled in your Admin Configuration settings. There is a set of configs under Images, and another under More Pics for the image substitution box if you use that option. The settings in Images should all be blank. For the More Pics box, see the Admin Configuration section of the how_to_use.txt in the distribution.

 

Regards

Jim

 

Thank you Jim - much appreciated. I can't name it because for the life of me I can't figure out which one i used (as i said complete newbie here) - but I am going to follow your instructions :) and thank you for helping so quickly :)

Link to comment
Share on other sites

Now that you know it's important, keep records. I add a line to the header of each file I modify, with the name of the Contribution and the version. Some people use a separate file that lists all of their mods. Use whatever works for you.

 

Regards

Jim

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

Link to comment
Share on other sites

Now that you know it's important, keep records. I add a line to the header of each file I modify, with the name of the Contribution and the version. Some people use a separate file that lists all of their mods. Use whatever works for you.

 

Regards

Jim

 

thanks for the suggestion. I did a full re-install and it started working again :) i must have messed up a line of code some where. (and i put in headers and i have a .txt with the names of the contributions and their urls) :)

 

thanks again for everything

Edited by Shadane
Link to comment
Share on other sites

Hi guys,

 

I'm still having some problems to get the picture to show up in Xsell and Featured Products. I guess after reading through the thread that I need to change products_image to image_filename and add the More Pics Table to the sql string. The main problem in struggling with is that I cant figure out how to edit the sql string in xsell and featured products to make it work. Would be very pleased if someone could edit my original code below and post a working one.

 

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

includes/modules/xsell_products.php

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

 

	$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, specials_new_products_price
from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id
left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id 
where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "'
and p.products_status = '1'
order by sort_order asc limit " . MAX_DISPLAY_XSELL);

 

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

includes/modules/featured.php

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

 

$query = 'SELECT distinct p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name
FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_PRODUCTS_TO_CATEGORIES . ' p2c using(products_id)
LEFT JOIN ' . TABLE_CATEGORIES . ' c USING (categories_id)
LEFT JOIN ' . TABLE_FEATURED . ' f ON p.products_id = f.products_id
LEFT JOIN ' . TABLE_SPECIALS . ' s ON p.products_id = s.products_id
LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '" . $languages_id . "' 
where c.categories_id IN(" . $catIdSql . ") AND p.products_status = '1' AND f.status = '1' ";

 

Best Regards

Johan

Link to comment
Share on other sites

Hello,

The script allows to use a css style box or grid view. I want css style as well as grid view. I mean, the small images will be placed below the main image in a grid format (rows x cols), can any body guide me with the tweaking of the code.

 

I want to have it this way:- http://www.sparkfun.com/commerce/product_i...roducts_id=9407

 

Thanks in advance to all those who have contributed for the excellent, pro. script

Link to comment
Share on other sites

Hi guys,

 

I'm still having some problems to get the picture to show up in Xsell and Featured Products. I guess after reading through the thread that I need to change products_image to image_filename and add the More Pics Table to the sql string. The main problem in struggling with is that I cant figure out how to edit the sql string in xsell and featured products to make it work. Would be very pleased if someone could edit my original code below and post a working one.

 

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

includes/modules/xsell_products.php

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

 

	$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, specials_new_products_price
from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id
left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id 
where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "'
and p.products_status = '1'
order by sort_order asc limit " . MAX_DISPLAY_XSELL);

 

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

includes/modules/featured.php

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

 

$query = 'SELECT distinct p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name
FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_PRODUCTS_TO_CATEGORIES . ' p2c using(products_id)
LEFT JOIN ' . TABLE_CATEGORIES . ' c USING (categories_id)
LEFT JOIN ' . TABLE_FEATURED . ' f ON p.products_id = f.products_id
LEFT JOIN ' . TABLE_SPECIALS . ' s ON p.products_id = s.products_id
LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '" . $languages_id . "' 
where c.categories_id IN(" . $catIdSql . ") AND p.products_status = '1' AND f.status = '1' ";

 

Best Regards

Johan

 

 

Is'nt there anyone out there that can help me with this problem?

 

/Johan

Link to comment
Share on other sites

Hello Jim,

 

I installed more_pics_advanced_2.0.6 in a new shop.

 

In the admin / categories.php for the products_image input is the feld removed.

Thus, in the products table the column products_image is always empty.

You have the pictures now in the table prodacts_images in the column image_filename.

 

 

With the install.php be accepted while the already existing images.

But when I enter new articles products_image is logically empty.

Is this accurate?

 

 

Now to my problem.

Now when I export the product data for display, for example Preisroboter.de I get there no more pictures.

 

 

How can I get into the old table field again the picture?

All scripts adapt the query is too costly and difficult.

 

 

Regarts

 

Jo

Link to comment
Share on other sites

That is correct. All product images have been moved to the new table. If you are not seeing the images on the Catalog side, check your edits to that file. All of the stock osCommerce files have been modified to pull the images from the new table.

 

Regards

Jim

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

Link to comment
Share on other sites

That is correct. All product images have been moved to the new table. If you are not seeing the images on the Catalog side, check your edits to that file. All of the stock osCommerce files have been modified to pull the images from the new table.

 

Regards

Jim

 

Sorry if I have not made myself clear.

The images in the catalog are visible to all.

The problem is the download of product data to external.

Their scripts all rely on prodacts_image.

Thus they get no more pictures to the new articles.

This is bad.

Have tried to adapt the scripts.

But come there no further.

Would not it be possible to save an new image in both of this table fields?

 

Regards

 

Jo

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