Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Lightbox - Can't use apostrophes or inverted comma in products name


Guest

Recommended Posts

I hope someone can help with this one!

 

I just installed "OSCommerce Enlarge Image with Lightbox 2.4" (http://addons.oscommerce.com/info/5812)

 

Things were pretty simple, except I have my large, pop-up images in a separate folder (images/large) took me a while to sort out how to get it to display /large images for the pop-up, but figured it out in the end!

 

So, everything was working fine, except on some products, the small thumbnail with "click to enlarge" text wasn't displaying... weird I thought... finally realised that any Product Name with an ' (apostrophe) in it, wouldn't display the thumbnail and "click to enlarge" text.

Then, I also realised that, any product with an " (inverted comma) in the title, would display thumbnail and "click to enlarge" text BUT wouldn't display the full Product Name at the bottom of the lightbox pop up.

 

EG - PRODUCT TITLE: 1970s Flowery "Groovy" Men's shirt

 

The apostrophe stops the thumbnail / click to enlarge bits showing on product_info.php

 

And, if the apostrophe is then removed but the inverted commas remain, the title of the product, shown at the bottom of the light box pop-up, next to the "CLOSE" image, would simply read:

 

1970s Flowery

 

 

Now, I'm no great shakes at PHP, I've installed and tweaked a few contribs, but that's about it. Is there a way of telling this bit of display image code to "ignore" apostrophes and inverted commas in the Products Name? o_O

 

Thanks!

 

<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . 'large/' . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
</noscript>

Link to comment
Share on other sites

  • 5 months later...

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