I'm using the latest version.
It seems that if the product name has a single quote in it, the image will not display. Is this normal? How can I fix this?
I'm using the latest version.
It seems that if the product name has a single quote in it, the image will not display. Is this normal? How can I fix this?
Try putting a escape backslash \ in front of each single quote. PHP is getting confused with the single quotes and so for your text they need to handled with some extra care.
more info :: PHP Manual - Strings
edit:
FAQ :: reference
Last edited by lib99; 6 Jun 2007 at 03:37 PM. Reason: additional link reference
Okay, I tried that and got this error:
I had changed 12" X 15" Sim. Wal. Plq. Chief's Poem Und. Plexi Glass to 12" X 15" Sim. Wal. Plq. Chief\'s Poem Und. Plexi GlassCode:1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Poem Und. Plexi Glass', products_description = '12" X 15" Simulated Walnut Pla' at line 1 in: [update zen_products_description set products_name = '12" X 15" Sim. Wal. Plq. Chief\''s Poem Und. Plexi Glass', products_description = '12" X 15" Simulated Walnut Plaque, Chief''s Poem Under Plexi Glass With 5 Trumpet Hat Badge.', products_url = '' where products_id = '3739' and language_id = '1'] If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Sorry, my initial reply pertained more toward language defines and such. How are you entering this product's data? Is it via the ZC Categories/Products admin, or are you trying to import data with an add-on or other non-Zen-Cart tool?
afaik, ZC properly sanitizes the inputed data upon submission to avoid such issues. I've checked with a clean installation of ZC 1.3.7, and using single or double quotes randomly within the Product Name and/or Product Description does not demonstrate the issue you are experiencing.
Here is the product that has the issue:
http://aaau.com/cart/index.php?main_...oducts_id=3739
I am entering it normally, via the admin section.
If I simply delete the quote, the page is fixed and the image shows up.
If you disable javascript in your browser, does it work properly ?
What addons and customizations have been done to your shop?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Yes, it works fine if Javascript is disabled.
I should mention most other product images work fine.
I believe the only changes have been changes to the template.
Last edited by HDG; 6 Jun 2007 at 07:44 PM.
Please post the contents of your /includes/templates/YOURTEMPLATE/templates/tpl_modules_main_product_image.php file.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Code:<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> <div id="productMainImage" class="centeredContent back"> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id$ //--></script> <noscript> <?php echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($product$ ?> </noscript> </div>
It appears that your file is corrupt.
Please re-upload that file from your original Zen Cart zip.
Be sure to replace the template_default one with the one from the zip, and if you have the same file in various template override folders, be sure to either replace them with the master or merge your customizations with the master before uploading and replacing the one in your overrides folders.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks