KomplikatedOne Posted September 5, 2011 Share Posted September 5, 2011 hello all started using oscommerce a few weeks back, getting on really well with it and the forums are really useful so far when i have encountered a problem. but i am stuck with an issue, and cannot find any refrerence to it elsewhere on the net. Basically on one of the 2 sites i am in process of building i get the words : "undefined" under the main product image, but only when I add more than 1 image. (product_info.php) i suspect the reason is that different code is used when more than 1 image present. Strangely despite the text all images display fine, the lightbox etc all work correctly. i thought it was at first due to fact images were not in the default directory, but even if i do save them to the /images/ folder i get same issue. the line of text acts as a hyperlink to the image, not sure if that is useful? ive compard the data being entered against the products and the images between the site, and they appear to be the same the only difference i can see between the 2 sites is that the one i have the problem on runs in the root domain folder whereas the other site runs from the /catalog/ folder anyone else encountered this? or able to tell me why i am getting this line of text under my image ive attached a screen shot of what i am getting many thanks k Link to comment Share on other sites More sharing options...
lildog Posted September 5, 2011 Share Posted September 5, 2011 I am currently trying to solve this problem also. I have narrowed my problem to jQuery. I updated my jQuery and get this issue. I took a stock osc 2.3.1 site and only changed the jquery include line from: <script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script> to: <script type="text/javascript" src="ext/jquery/jquery-1.6.2.min.js"></script> I have not found the solution yet. I assume it may be the same for you. Todd Link to comment Share on other sites More sharing options...
KomplikatedOne Posted September 5, 2011 Author Share Posted September 5, 2011 ah i reckon thats it i did upgrade on jquery in an attempt to resolve a different issue with the theme colour scheme (it turned out not to be a version issue) might see if i can change back to 1.4.2, not a long term solution, but hopefully will get my by for now thanks Link to comment Share on other sites More sharing options...
KomplikatedOne Posted September 5, 2011 Author Share Posted September 5, 2011 i thought i would just do a quick check to make sure there wasnt also a newer version of the bxgalleryor fancybox plugins, as i didnt upgrade those at same time as ui but it appears 1.1 and 1.3.4 are the current versions Link to comment Share on other sites More sharing options...
KomplikatedOne Posted September 5, 2011 Author Share Posted September 5, 2011 i can confirm setting the line in template_top.php back to <script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script> will stop the error, (assuming the file still exists) when i have more time ill have to take a look at in more detail Link to comment Share on other sites More sharing options...
lildog Posted September 5, 2011 Share Posted September 5, 2011 At least we have it narrowed down. Unfortunately I do not want to go back to 1.4.2 because I still want to use theme roller for my themes. I will also look into it. I will see if upgrading fancy box helps... Todd Link to comment Share on other sites More sharing options...
lildog Posted September 5, 2011 Share Posted September 5, 2011 Oops...it looks like you already determined we have the latest versions of fancybox and bxGallery. Link to comment Share on other sites More sharing options...
lildog Posted September 5, 2011 Share Posted September 5, 2011 Here is a solution. It works, I don't however know if it is correct. Replaced all "attr(" with "prop(" in jquery.bxGallery.1.1.min.js file. Todd Link to comment Share on other sites More sharing options...
multimixer Posted September 5, 2011 Share Posted September 5, 2011 This issue is related to bx gallery. What you get on the screen is a <div class="caption"> and as content the word "undefined" Following happens: 1) File ext/jquery/begallery/jquery.bxGallery.1.1.min.js is checking if the image has a title or not, like this function set_main_img(){$orig.find('img').each(function(){var $this=$(this);var $imgheight=$this.height();var $imgwidth=$this.width();if($this.attr('title')!=''){caption=$this.attr('title');$this.parent().append('<div class="caption">'+caption+'</div>');} If image has a title it should be displayed as the image caption 2) File product_info.php, does not provide a title for the image $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a>'; 3) In the jQuery site we can read that As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. In addition, .attr() should not be used on plain objects, arrays, the window, or the document. To retrieve and change DOM properties, use the .prop() method. That is why in version 1.4 the condition of bx gallery work, but in 162 not anymore What to do? 2 options: 1) Update file product_info.php to get a title for the image 2) Update bx gallery script to use an other condition format (fix on github) My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
lildog Posted September 5, 2011 Share Posted September 5, 2011 And here is an updated version of bxGallery for those who do not want to edit it themselves. Credit to acidVertigo. Link to comment Share on other sites More sharing options...
acidvertigo Posted September 6, 2011 Share Posted September 6, 2011 And here is an updated version of bxGallery for those who do not want to edit it themselves. Credit to acidVertigo. Thank you for the credit :) Link to comment Share on other sites More sharing options...
KomplikatedOne Posted September 6, 2011 Author Share Posted September 6, 2011 great work guys thank you very much Link to comment Share on other sites More sharing options...
lildog Posted September 6, 2011 Share Posted September 6, 2011 You are very welcome acidVertigo, thank you for the fix. I would also like to thank multiMixer and komolikatedOne, I did search for the solution to this problem but working with them helped narrow the search down and find the answer. Great work everyone...the power of many outweighs the power of one. Link to comment Share on other sites More sharing options...
adelgado Posted November 11, 2011 Share Posted November 11, 2011 Thank you ALL! Being a newbie at all this, it was my first attempt at changing code - and following your instructions, SUCCESS! Time to open the bubbly.....LOL Link to comment Share on other sites More sharing options...
Guest Posted November 15, 2011 Share Posted November 15, 2011 Whow!! thank you!! you are great! :D Link to comment Share on other sites More sharing options...
adam smith Posted November 16, 2011 Share Posted November 16, 2011 At least we have it narrowed down. Unfortunately I do not want to go back to 1.4.2 because I still want to use theme roller for my themes. I will also look into it. I will see if upgrading fancy box helps... Link to comment Share on other sites More sharing options...
sydjeii Posted February 1, 2012 Share Posted February 1, 2012 hello..I tried the solution given by acidvertigo and the "undefined" text was removed successfully.. However it gave me another problem. The large image and the other extra images appear in their actual sizes. So if I have 4 extra images of 500x500px they all appear as is. Please help. :) thanks in advance. -=PINOY AKO=- Link to comment Share on other sites More sharing options...
AlexandrZuyev Posted April 30, 2012 Share Posted April 30, 2012 in Firefox and IE everything is fine but in Google Chome the "underfined" word is still exist and no small images. Pease does anybody have got a sollution? Link to comment Share on other sites More sharing options...
RCHobbyAddict Posted May 13, 2012 Share Posted May 13, 2012 Thank you soo much... it worked... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.