Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › eStore cart thumbnail IMG SRC is full size image
- This topic has 3 replies, 2 voices, and was last updated 12 years, 7 months ago by
jsmoriss.
-
AuthorPosts
-
July 27, 2012 at 10:20 pm #7005
jsmoriss
MemberHi,
I’m using eStore with NextGEN and the 1 store item configuration. Everything is working great so far. I’ve created a shopping cart page, and I’m using the [wp_eStore_cart_with_thumbnail] shortcode to get the basket. So far so good – all my items are there and all the thumbnails too. The only problem is the thumbnail’s IMG SRC is the full size image from the NextGEN gallery!
Before I start hacking away at the eStore-extra-shortcodes plugin, I had a few questions…
Since the “pid” shown in the cart is the image ID why can’t eStore use wp_get_attachment_image_src? I’m pretty sure NextGEN has hooks into the “thumbnail” size (though it doesn’t work for other sizes, like medium, large, etc.).
I’ve added support for NextGEN gallery images in other plugins, so I could do the same with eStore-extra-shortcodes, but it’s a little difficult to spot where I would have to modify it… Any ideas?
BTW, the image can also be retrieved by a dynamic URL:
http://host/index.php?callback=image&pid=##&width=##&height=##&mode=crop
Could I use this URL in the eStore/NextGEN/single-item configuration somehow?
Thanks,
js.
July 28, 2012 at 12:35 am #47838jsmoriss
MemberFYI – Found where the problem was:
$ diff eStore_misc_functions.php-orig eStore_misc_functions.php
262c262
<
$replacement .= '<input type="hidden" name="thumbnail_url" value="'.$nggImage->imageURL.'" />';
---
>
$replacement .= '<input type="hidden" name="thumbnail_url" value="'.$nggImage->thumbURL.'" />';July 28, 2012 at 6:54 am #47839admin
KeymasterThank you. I will update this in the plugin.
July 29, 2012 at 1:25 am #47840jsmoriss
MemberExcellent – thanks.
BTW, here are some other changes I’ve made:
wp-cart-for-digital-products$ diff eStore_misc_functions.php-orig eStore_misc_functions.php
255c255,259
< $replacement .= '<input type="hidden" name="product" value="'.htmlspecialchars($nggImage->alttext).'" /><input type="hidden" name="product_name_tmp1" value="'.htmlspecialchars($nggImage->alttext).'" />';
---
> // jsmoriss - added caption to product_name_tmpl field
> $replacement .= '<input type="hidden" name="product" value="'.htmlspecialchars($nggImage->alttext);
> $replacement .= '" /><input type="hidden" name="product_name_tmp1" value="'.htmlspecialchars($nggImage->alttext);
> if(!empty($nggImage->caption)) $replacement .= ' : '.$nggImage->caption;
> $replacement .= '" />';
261,262c265,267
< if(!empty($nggImage->imageURL)){
< $replacement .= '<input type="hidden" name="thumbnail_url" value="'.$nggImage->imageURL.'" />';
---
> // jsmoriss - changed imageURL to thumbURL
> if(!empty($nggImage->thumbURL)){
> $replacement .= '<input type="hidden" name="thumbnail_url" value="'.$nggImage->thumbURL.'" />';eStore-extra-shortcodes$ diff shortcode_include.php-orig shortcode_include.php
1107a1108,1109
> // jsmoriss - added 100% to width of TD to maximize name / caption space
> // linked image instead of item name since it (may) contain caption text
1109c1111,1114
< <tr><td style='overflow: hidden;'><div class='eStore_cart_thumbnail'><img src='".$item['thumbnail_url']."' /></div><div class='eStore_cart_item_name'><a href='".$item['cartLink']."'>".$item['name']."</a></div><div class='eStore-fancy-clear'></div></td>";
---
> <tr><td style='overflow:hidden;width:100%;'>
> <div class='eStore_cart_thumbnail'><a href='".$item['cartLink']."'><img src='".$item['thumbnail_url']."' /></a></div>
> <div class='eStore_cart_item_name'>".$item['name']."</div>
> <div class='eStore-fancy-clear'></div></td>";Thanks,
js.
-
AuthorPosts
- You must be logged in to reply to this topic.