Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento get images that are only in stock
    primarykey
    data
    text
    <p>I need to list thumbnail images that are only in stock but i cant find the way to insert the filter to say <code>addAttributeToFilter('is_saleable', TRUE)</code> to the next code.</p> <p>The structure of product: </p> <p>2 Options</p> <p>Color and Size</p> <p>All sku's are associated to the configurable product, and Gallery image have the Color Label that Match with the Color form Option.</p> <p>When you open the Configurable product in product view page, this show a dropdown or checkbox form, that allow you to select the <code>Color</code> first then Show all <code>Sizes</code> in stock. But in the dropdown show only <code>Colors</code> that are in stock.</p> <p>Example:</p> <pre><code>Red =&gt; S,M,L Blue =&gt; L,XL Yellow =&gt; S Gray =&gt; Not in stock, not in the dropdown. </code></pre> <p>Is there any way to insert a filter to skip images colors that are not saleable or in stock?</p> <pre><code>&lt;?php $_gallery = Mage::getModel('catalog/product')-&gt;load($_product-&gt;getId())-&gt;getMediaGalleryImages(); ?&gt; &lt;?php $imgcount = Mage::getModel('catalog/product')-&gt;load($_product-&gt;getId())-&gt;getMediaGalleryImages()-&gt;count();?&gt; &lt;?php if($imgcount &gt;1): ?&gt; &lt;div class="more-views"&gt; &lt;a href="&lt;?php echo $_product-&gt;getProductUrl(); ?&gt;" title="&lt;?php echo html_entity_decode($_helper-&gt;productAttribute($_product, $_product-&gt;getName(), 'name')); ?&gt; &lt;?php // echo $this-&gt;htmlEscape($_image-&gt;getLabel()) ?&gt;"&gt; &lt;img style="padding-top:2px;" src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_product, 'thumbnail', $_image-&gt;getFile())-&gt;resize(33, 31); ?&gt;" width="33" height="31" alt="&lt;?php echo html_entity_decode($_helper-&gt;productAttribute($_product, $_product-&gt;getName(), 'name')); ?&gt; &lt;?php echo $this-&gt;htmlEscape($_image-&gt;getLabel()); ?&gt;" title="&lt;?php echo html_entity_decode($_helper-&gt;productAttribute($_product, $_product-&gt;getName(), 'name')); ?&gt; &lt;?php echo $this-&gt;htmlEscape($_image-&gt;getLabel()); ?&gt;" /&gt; &lt;/div&gt; &lt;?php endif; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload