Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Question about Chante Default Image Contribution and Lightbox for STS


gwynwyffar

Recommended Posts

I've successfully installed STS 4.5.8 as well as the Change Default Image Directories Contribution http://www.oscommerce.com/community/contributions,5125

 

I have also installed osc_lightbox for STS, but it isn't working. I suspect that I need to change the references to image directories found in the sts_inc/product_info.php file but I'm not sure exactly what I should change it to.

 

The directory definitions in my admin/includes/configure.php file are

  define('DIR_FS_MANUFACTURERS_IMAGES', 'manufacterers/');
 define('DIR_FS_CATEGORIES_IMAGES', 'categories/');
 define('DIR_FS_PRODUCTS_IMAGES', 'products/');

 

The code I'm supposed to change in the sts_inc/product_info.php file for lightbox to work is

$template_pinfo['product_popup']= '<a rel="lightbox" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" title="'. $product_info['products_name'] .' - '. $manufacturer['manufacturers_name'] .'">'.$template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE .'</a>'."\n";

} else {
 $template_pinfo['imagesmall'] ='';
 $template_pinfo['imagelarge'] ='';
 $template_pinfo['product_popup']='';	
}

 

Can someone assist me with making the proper changes?

Link to comment
Share on other sites

I've successfully installed STS 4.5.8 as well as the Change Default Image Directories Contribution http://www.oscommerce.com/community/contributions,5125

 

I have also installed osc_lightbox for STS, but it isn't working. I suspect that I need to change the references to image directories found in the sts_inc/product_info.php file but I'm not sure exactly what I should change it to.

 

The directory definitions in my admin/includes/configure.php file are

  define('DIR_FS_MANUFACTURERS_IMAGES', 'manufacterers/');
 define('DIR_FS_CATEGORIES_IMAGES', 'categories/');
 define('DIR_FS_PRODUCTS_IMAGES', 'products/');

 

The code I'm supposed to change in the sts_inc/product_info.php file for lightbox to work is

$template_pinfo['product_popup']= '<a rel="lightbox" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" title="'. $product_info['products_name'] .' - '. $manufacturer['manufacturers_name'] .'">'.$template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE .'</a>'."\n";

} else {
 $template_pinfo['imagesmall'] ='';
 $template_pinfo['imagelarge'] ='';
 $template_pinfo['product_popup']='';	
}

 

Can someone assist me with making the proper changes?

 

Jennifer,

First off, test to see if lightbox is working properly. Turn off STS and test.

 

If all is OK, then test STS and Lightbox together. Do this by turning STS back on and then enable the default module only (leave the other modules disabled for now). During this testing phase, STS should pick up the lightbox modifications from the stock product_info.php file. If it doesn't pass this phase, then lightbox is not installed correctly.

 

The code you displayed above (sts_inc/product_info.php) only applys if you are using content templates. If you are using content templates then you will need to make lightbox edits in that file. (see below)

 

Add the following to your template page in the header (between the <head> </head>)

 

Add:

 

 

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

<script type="text/javascript" src="includes/js/prototype.js"></script>

<script type="text/javascript" src="includes/js/scriptaculous.js?load=effects"></script>

<script type="text/javascript" src="includes/js/lightbox.js"></script>

 

The STS tag $product_popup needs to be modified.

Edit: includes/modules/sts_inc/product_info.php

 

About in line 80 find:

 

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

 

 

$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']=''

}

 

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

 

Replace with:

 

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

 

 

$template_pinfo['product_popup']= '<a rel="lightbox" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" title="'. $product_info['products_name'] .' - '. $manufacturer['manufacturers_name'] .'">'.$template_pinfo['imagesmall'] . '<br>' . TEXT_CLICK_TO_ENLARGE .'</a>'."\n";

} else {

$template_pinfo['imagesmall'] ='';

$template_pinfo['imagelarge'] ='';

$template_pinfo['product_popup']=''; 

}

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

 

:thumbsup: More help is available in the STS forum (thread).

Hope this helped,

 

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

Bill i have a similar issue regarding this, i have installed the Multiple Lightbox Addon. Unfortunately when i have create my own product_info.php.html, the code wouldn't execute. I have tried to use snippets of the code you mentioned within this post but it doesn't seem to work.

 

I was wondering if you could help me regarding this issue.

 

kindest regards

 

Ashley

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