Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image Enlarge Doesn't work with STS


jonahpauline

Recommended Posts

Here's a link to the catalog <<Blue Tiger Catalog >>. I've put in a fake product, (my girlfriend and I) to test that everything works. When the STS Module is turned off and the default OScommerce layout is in use the "Click to Enlarge" function works perfectly. I thought I installed the image contribution wrong, so I did a fresh install of OSC and all my add ons, but it's still doing it.

Versions Installed in this catalog (in order of installation):

- OScommerce-2.2rc1

- STS V. 4.53

- Dynamic MoPics V3.000

Link to comment
Share on other sites

  • 1 month later...

Same problem here. i see it's not resolved on your site. It looks like an issue in the function popupImage(). i also get an error with popupWindow(). If you figure it out, let me know- i'll do the same.

Edited by scollins
Link to comment
Share on other sites

So i found some bogus code in product_info.php around line 28.

 

function popupWindow(url) {<?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?>
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')
}

 

That's the code from a template i got from Monster Templates. i compared to the actual 2.2 release and found it's supposed to be:

 

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')
}

Link to comment
Share on other sites

For some reason I don't even have that code in my product_info.php file at all. Here's what my code looks like for that file:

I have the latest version of OSC and STS installed is that the difference or did my installation go wrong?

 

<?php
/*
 $Id: product_info.php,v 4.3SP1 2006/11/15 23:55:58 rigadin Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2006 osCommerce

 Released under the GNU General Public License
Based on: Simple Template System (STS) - Copyright © 2004 Brian Gallagher - [email protected]
STS v4.3SP1 by Rigadin ([email protected])
*/

$products_id=intval($_GET['products_id']);
// Create variables for product ID, added in v4.0.6	
   //$template_pinfo['productid'] = $products_id; // Deprecated in STS4.3SP1
   $template_pinfo['productsid'] = $products_id; // Just for consistende with osC names

// Start the "Add to Cart" form
   $template_pinfo['startform'] = tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));
// Add the hidden form variable for the Product_ID
   $template_pinfo['startform'] .= tep_draw_hidden_field('products_id', $products_id);
   $template_pinfo['endform'] = "</form>";

// Get product information from products_id parameter
   $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 = '" . $products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   $template_pinfo['regularprice'] = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $template_pinfo['regularpricestrike'] = "<s>" . $template_pinfo['regularprice'] . "</s>";
     $template_pinfo['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
   } else {
     $template_pinfo['specialprice'] = '';
  $template_pinfo['regularpricestrike'] = $template_pinfo['regularprice'];
   }

   $template_pinfo['productname'] = $product_info['products_name'];
   $template_pinfo['productmodel'] =  $product_info['products_model'];

if (tep_not_null($product_info['products_image'])) {
 $template_pinfo['imagesmall'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template_pinfo['imagelarge'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');
 $template_pinfo['product_popup']= '<script language="javascript"><!--'."\n".
                                  'document.write(\'<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . (int)$products_id) . '\\\')">' . $template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>\');'."\n".
							   '//--></script>'."\n".
							   '<noscript>'."\n".
							   '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">'.$template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE .'</a>'."\n".
							   '</noscript>'."\n";
} else {
 $template_pinfo['imagesmall'] ='';
 $template_pinfo['imagelarge'] ='';
 $template_pinfo['product_popup']='';	
}

$template_pinfo['productdesc'] = stripslashes($product_info['products_description']); 

// Get the number of product attributes (the select list options)
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
// If there are attributes (options), then...
if ($products_attributes['total'] > 0) {
 // Print the options header
 $template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;

 // Select the list of attribute (option) names
 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
   $products_options_array = array();
   $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

   // For each option name, get the individual attribute (option) choices
   while ($products_options = tep_db_fetch_array($products_options_query)) {
     $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

     // If the attribute (option) has a price modifier, include it
     if ($products_options['options_values_price'] != '0') {
       $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
     }

   }

   // If we should select a default attribute (option), do it here
   if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
     $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
   } else {
     $selected_attribute = false;
   }

   $template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>'; 
   $template_pinfo['optionchoices'] .=  tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>"; 
 }
} else {
 // No options, blank out the template variables for them
 $template_pinfo['optionheader'] = '';
 $template_pinfo['optionnames'] = '';
 $template_pinfo['optionchoices'] = '';
}

// See if there are any reviews
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$_GET['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
 $template_pinfo['reviews'] = TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; 
} else {
 $template_pinfo['reviews'] = '';
}

// See if there is a product URL
if (tep_not_null($product_info['products_url'])) {
 $template_pinfo['moreinfolabel'] = TEXT_MORE_INFORMATION;
 $template_pinfo['moreinfourl'] = tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false); 
} else {
 $template_pinfo['moreinfolabel'] = '';
 $template_pinfo['moreinfourl'] = '';
}

$template_pinfo['moreinfolabel'] = str_replace('%s', $template_pinfo['moreinfourl'], $template_pinfo['moreinfolabel']);

// See if product is not yet available
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
 $template_pinfo['productdatelabel'] = sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']))  ; // Modified in v4.5
 $template_pinfo['productdate'] = tep_date_long($product_info['products_date_available']);
} else {
 $template_pinfo['productdatelabel'] = sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added']) ); // Modified in v4.5
 $template_pinfo['productdate'] = tep_date_long($product_info['products_date_added']); 
}

// Strip out %s values
//$template_pinfo['productdatelabel'] = str_replace('%s.', '', $template['productdatelabel']); // Removed in v4.5

// See if any product reviews
$template_pinfo['reviewsurl'] = tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params());
$template_pinfo['reviewsbutton'] = tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS);
$template_pinfo['addtocartbutton'] = tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);

// See if any "Also Purchased" items. Feature added in v4.0.6
$sts->start_capture();
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
$sts->stop_capture ('alsopurchased'); // Get the result to the main array
$template_pinfo['alsopurchased']= $sts->template['alsopurchased']; // Put it in the product info

?>

Link to comment
Share on other sites

  • 3 weeks later...
Thanks though.. haven't had any effort from anyone else to help out.

 

I remember when I was setting up my store, I had to change the following setting in Configuration / My Store to make pop-ups work. I'm not sure if it will fix your problem, but it's worth a try:

Use Search-Engine Safe URLs (still in development) false

Good Luck!

Kris in St Louis

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Almost two years ago... i know

But thanks for the solution! it works smile.gif

 

Gr, Jeroen

 

thumbsup.gif The phrase "Still in development" should be a HUGE clue to leave it set to FALSE.

 

Please post all STS related questions in the STSv4 Support Forum (link is in my signature below as well as listed in the STS User Manual).

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

  • 2 months later...

I had the same issue and discovered a missing link to a stylesheet file when STS was turned on:

 

<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />

 

added to the main template file (i'm still using test/sts_blank_template.html) and it worked.

 

HTH

Link to comment
Share on other sites

  • 4 weeks later...

I had the same issue and discovered a missing link to a stylesheet file when STS was turned on:

 

<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />

 

added to the main template file (i'm still using test/sts_blank_template.html) and it worked.

 

HTH

 

 

The test/blank template should NEVER be used on a live shop. Its ONLY purpose is to display required tags needed to make STS function correctly. You DON'T need a stylesheet per say so that is why it is not listed in the blank template.

 

 

PLEASE POST ALL OTHER COMMENTS TO THIS TOPIC IN THE PROPER STSV4 SUPPORT THREAD (link in my signature below).

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

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