getThumbnail not working on an attribute object
Permalink 1 user found helpful
HI,
why, oh why, this is not working?
While this is working as it should?
>:(
why, oh why, this is not working?
if($c->getAttribute('product_icon')) { $icon = Loader::Helper('image'); $icon->getThumbnail($c->getAttribute('product_icon'), 128, 128); echo '<img class="product-icon" alt="test" src="'. $icon->src .'" width="'.$icon->width.'" height="'.$icon->height.'" />'; }
While this is working as it should?
if($c->getAttribute('product_icon')) { $icon = Loader::Helper('image'); $icon->outputThumbnail($c->getAttribute('product_icon'), 128, 128); }
>:(
I think like this:
if($c->getAttribute('product_icon')) { $ih = Loader::Helper('image'); $icon = $ih->getThumbnail($c->getAttribute('product_icon'), 128, 128); echo '<img class="product-icon" alt="test" src="'. $icon->src .'" width="'.$icon->width.'" height="'.$icon->height.'" />'; }
What an idiot…
I didn't even test it but I am sure that's the issue.
Forgetting to assign the object to the variable it is a clear sign I need to go sleeping.
Thanks a lot for getting time to reply to such a stupid question.
I didn't even test it but I am sure that's the issue.
Forgetting to assign the object to the variable it is a clear sign I need to go sleeping.
Thanks a lot for getting time to reply to such a stupid question.
Are API just broken?
Could be just after update to lates version?