Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Modificatoin request] when clicking an image in product overview..


Webtytte

Recommended Posts

Hi,

 

I just installed the module "osCProductListingSelect for MS2 update1_1" and I want to make a small change to the listings...

 

Current listing is like this:

 

(Picture)

(Name)

(Price)

<buy now button>

 

Clicking (Picture) sends you to product info

Clicking (Name) sends you to product info as well..

 

What I would like changed:

1) I would like to get the pop-up view when clicking (Picture)

2) I would like a new button to the left of the buy now button with <Details> and when you click on <Details> you are send to product info.

 

Anyone able to help me with that? :)

 

Thanks in advance!

 

Kind regards

Thomas

Link to comment
Share on other sites

  • 1 month later...

Is there really noone who can help me get this fixed?

 

Maybe I can narrow this down..

 

1) Which code is needed to change/add to get the javascript-popup when clicking a picture in the product overview, instead of getting directed to produt details?

 

2) Which code is needed (and where) to add a button ("Details") next to the "buy now"-button in the product overview?

 

I really hope someone can help me out :)

 

Kind regards

Thomas

Link to comment
Share on other sites

Is there really noone who can help me get this fixed?

 

Maybe I can narrow this down..

 

1) Which code is needed to change/add to get the javascript-popup when clicking a picture in the product overview, instead of getting directed to produt details?

 

2) Which code is needed (and where) to add a button ("Details") next to the "buy now"-button in the product overview?

 

I really hope someone can help me out :)

 

Kind regards

Thomas

 

Actually I think I can fix no. 2 myself - but if someone could help me fix no. 1 I would be most gratefull

 

Kind regards

Thomas

Link to comment
Share on other sites

Actually I think I can fix no. 2 myself - but if someone could help me fix no. 1 I would be most gratefull

 

Kind regards

Thomas

 

 

<?php echo '<input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart ">';

?>

Link to comment
Share on other sites

Is there really noone who can help me get this fixed?

 

Maybe I can narrow this down..

 

1) Which code is needed to change/add to get the javascript-popup when clicking a picture in the product overview, instead of getting directed to produt details?

 

hey!! i got the first one!!! :D (since i think i don't need the 2? one, hehe :blush: )

 

1. open: index.php and paste this code between the <head> tags.

 

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>

 

2. open: catalog/includes/modules/product_listing.php and find this code:

 

		  case 'PRODUCT_LIST_IMAGE':
		$lc_align = 'center';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
		} else {
		  $lc_text = '?<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>?';
		}
		break;

 

3. replace that code with this one:

 

case 'PRODUCT_LIST_IMAGE':
			  $lc_align = 'center';
			  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
			 $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			 } else {
			 $lc_text = '
			<script language="javascript"><!--
			document.write(\'<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $listing['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], addslashes($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>Click to enlarge</a>\');
			//--></script>
			<noscript>
			<a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>
			</noscript>';
		}
		break;

 

and that must be all, save files and enjoy! :D it works for me!

Link to comment
Share on other sites

Thanks a lot for your feeback Topiz!

I got it to work, but not quite like you posted.

 

Instead of putting the javascript code in the index.php, I put it in product_listing.php header.

 

I also got the secondary objective done :)

 

Thanks again, and if you wanna check it out see the result here: http://www.msdesign-shop.dk

 

Kind regards

 

Thomas

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