{"id":456,"date":"2011-12-05T13:46:15","date_gmt":"2011-12-05T13:46:15","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=456"},"modified":"2011-12-05T13:46:15","modified_gmt":"2011-12-05T13:46:15","slug":"wp-e-commerce-gold-cart-product-gallery-lightbox","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/wp-e-commerce-gold-cart-product-gallery-lightbox\/","title":{"rendered":"WP E-Commerce Gold Cart Product Gallery &#8211; no lightbox"},"content":{"rendered":"<p>I was pumped to upgrade to the Gold Cart plugin for WP E-Commerce today, but was disappointed to find that the product gallery lightboxes simply don&#39;t function. This was a disappointment, as it was the primary reason for the upgrade.<\/p>\n<p>When clicking on a Product Thumbnail in the Gallery, nothing happens. A deeper look at the WP E-Commerce JavaScript reveals this event handler, which effectively cancels any actions from taking place by clicking a thumbnail:<\/p>\n<pre>jQuery(&#39;.attachment-gold-thumbnails&#39;).click(function(){\r\n\tjQuery(this).parents(&#39;.imagecol:first&#39;).find(&#39;.product_image&#39;).attr(&#39;src&#39;, jQuery(this).parent().attr(&#39;rev&#39;));\r\n\tjQuery(this).parents(&#39;.imagecol:first&#39;).find(&#39;.product_image&#39;).parent(&#39;a:first&#39;).attr(&#39;href&#39;, jQuery(this).parent().attr(&#39;href&#39;));\r\n\t<strong>return false;<\/strong>\r\n});<\/pre>\n<p>So, what can we do. If we alter the JavaScript file, we leave ourselves vulnerable to any upgrades that will simply overwrite our changes. Same deal with modifying the<strong> gold_shpcrt_display_gallery<\/strong> function to remove the <em>attachment-gold-thumbnails<\/em> class.<\/p>\n<p>I rather &quot;hacky&quot; solution that I employed was to use a little string manipulation to strip out the attachment-gold-thumbnails class from any &lt;a&gt; tags present in the function output. This had no effect on the display, but did solve the issue. In your customized version of the <em>wpsc-single_product.php<\/em> or<em> wpsc-products_page.php<\/em>, make the following adjustment:<\/p>\n<p><code>&lt;?php <br \/>\n\tif ( function_exists( &#39;gold_shpcrt_display_gallery&#39; ) )<br \/>\n\t&nbsp;&nbsp;&nbsp; echo str_replace(&#39;attachment-gold-thumbnails&#39;, &#39;&#39;, gold_shpcrt_display_gallery( wpsc_the_product_id() ));<br \/>\n\t?&gt;<br \/>\n\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was pumped to upgrade to the Gold Cart plugin for WP E-Commerce today, but was disappointed to find that the product gallery lightboxes simply&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[103],"tags":[292,135],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/456"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=456"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/456\/revisions"}],"predecessor-version":[{"id":457,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/456\/revisions\/457"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}