Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Popups not popping up, JS error line 1


theirishewe

Recommended Posts

I think I broke my pop-ups... They are not loading a larger image, instead returning an error message saying -

Line: 1

Char: 1

Error: Object expected

Code: 0

URL: (my url)/shop/product_info.php(this product's page)

 

This is the first 6 lines of my product info page

 

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 

Now, I am attempting to install STS, but all the product_info pages in every folder that I looked at (about 5 of them?) had the same 2 lines at top, the php and the funky star * thingy. Anyone have an idea? Is it terribly obvious and do I need more coffee? Or did I completely mess this up again?

Link to comment
Share on other sites

actually, i think you need to post the first line of the javascript, not the first line of the page.. THat is all standard oscommerce stuff there

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

This is the Lightbox add-on for STS -

2. Edit: includes/sts_templates/{your template name}/sts_template.html
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>

3. 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']='';	
}

 

Now, I did the above, tested and found the JS error, so I uploaded my initial copies of these two files that I had backed up. But the JS error still remains. I may try uploading the STS files as well (all of them) if I can't figure this out, but I am a bit weary of doing that... seems I get one thing to work and 3 others break. But hey, learning a lot this way! :blink:

Link to comment
Share on other sites

what does your actual code look like though???

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Not sure what you are asking for - you said to post the JS code, which I did? The Lightbox add-on was what I had added to the two STS files (product_info and template), which is the only thing I had changed.

 

In any case, I reloaded STS completely, and am still getting this same error message. I'm now wondering if this is an issue with STS, so I'm reinstalling that. After that, my only choice is to reinstall OSC again.

 

When in doubt, reinstall!

Link to comment
Share on other sites

you only posted the instructions. I was asking you post the actual code from your site.. but go ahead and do what your doing. I could be something simple though

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...