My items are not showing an out of stock message/label on the catogroy pages, if you click a sold out item it does state as out of stock on the product page..
I installed an app to move all of the out of stock items last. I also edited my theme a little and I am wondering if I have excellently clicked the wrong settings or removed some code. I can't find any information about this online, as I am sure its not something that normally goes wrong, or I am just being stupid.
This is very annoying because people do not know what is out of stock until they click items and then they may just think everything is out of stock and give up looking.
===
<?php
/**
* Magento
*
* @category design
* @package meigeetheme_default
* @copyright Copyright (c) 2012 MeigeeTeam. (http://www.meigeeteam.com)
*/
?>
<?php
/**
* Product list template
*
* @see Mage_Catalog_Block_Product_List
*/
?>
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
$meigee_minimalism_general = MAGE::helper('ThemeOptionsMinimalism')->getThemeOptionsMinimalism('meigee_minimalism_general');
$fancybox = $meigee_minimalism_general['fancybox'];
$categoryComplete = Mage::getModel('catalog/category')->load(Mage::getModel('catalog/layer')->getCurrentCategory()->getId());
if($categoryComplete->getMeigeeGridLayout()) {
$grid = $categoryComplete->getMeigeeGridLayout();
} else {
$grid = $meigee_minimalism_general['productlisting']['grid'];
}
$helpImg = $this->helper('ThemeOptionsMinimalism/images');
if($categoryComplete->getQuickview()) {
$quickview = $categoryComplete->getQuickview();
if($quickview == 2){$quickview = 0;}
} else {
$quickview = $meigee_minimalism_general['productlisting']['quickview'];
}
if($categoryComplete->getProductname()) {
$productname = $categoryComplete->getProductname();
if($productname == 2){$productname = 0;}
} else {
$productname = $meigee_minimalism_general['productlisting']['productname'];
}
if($categoryComplete->getProductprice()) {
$productprice = $categoryComplete->getProductprice();
if($productprice == 2){$productprice = 0;}
} else {
$productprice = $meigee_minimalism_general['productlisting']['productprice'];
}
if($categoryComplete->getAddtocart()) {
$addtocart = $categoryComplete->getAddtocart();
if($addtocart == 2){$addtocart = 0;}
} else {
$addtocart = $meigee_minimalism_general['productlisting']['addtocart'];
}
if($categoryComplete->getCompareproducts()) {
$compareproducts = $categoryComplete->getCompareproducts();
if($compareproducts == 2){$compareproducts = 0;}
} else {
$compareproducts = $meigee_minimalism_general['productlisting']['compareproducts'];
}
if($categoryComplete->getWishlist()) {
$wishlist = $categoryComplete->getWishlist();
if($wishlist == 2){$wishlist = 0;}
} else {
$wishlist = $meigee_minimalism_general['productlisting']['wishlist'];
}
$labelsoptions = $meigee_minimalism_general['productlabels'];
$productOnlyXleft = $meigee_minimalism_general['productlabels']['labelonlyxleft'];
$labelsType = $meigee_minimalism_general['productlabels']['labelview'];
$labelsPosition = $meigee_minimalism_general['productlabels']['labelsposition'];
?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<section class="category-products">
<?php echo $this->getToolbarHtml() ?><?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<ol class="products-list<?php echo ' '.$labelsType.' '.$labelsPosition; ?>" id="products-list">
<?php foreach ($_productCollection as $_product): ?>
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?><?php if($labelsoptions['labelsorder'] == 'sale_new'):?> labels-sale-new<?php endif; ?>">
<?php // Product Image ?>
<div class="grid_3 alpha">
<div class="product-img-box">
<?php echo MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'new'); ?>
<?php if (!MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'new')) : ?>
<div class="no-label-new">
<?php endif; ?>
<?php if($productOnlyXleft and MAGE::helper('ThemeOptionsMinimalism')->getProductOnlyXleft($_product)): ?>
<?php echo MAGE::helper('ThemeOptionsMinimalism')->getProductOnlyXleft($_product); ?>
<?php else: ?>
<?php echo MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'sale'); ?>
<?php endif; ?>
<?php if (!MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'new')) : ?>
</div>
<?php endif; ?>
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><?php /* Hover Image */ echo $helpImg->getHoverImage($_product, 'small_image', 300, null); ?><img <?php echo $helpImg->getImgSources($_product, 'small_image', 300, null); ?> alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
<?php // Fancybox
if ($fancybox['fancybox_status'] && $fancybox['fancybox_listing'] == 1): ?>
<a class="fancybox category-gallery" title="<?php echo $_productNameStripped; ?>" href="<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('fancybox'); ?></a>
<?php endif; // End Fancybox ?>
<?php if(Mage::getStoreConfig('ajax/general/enabledpro') and $quickview){ ?>
<div class="quick-view-holder">
<button type="button" title="<?php echo $this->__('Quick View') ?>" class="button btn-quick-view" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Quick View') ?></span><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('quickview'); ?></span></button>
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='ajax-fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'>Test</a>
</div>
<?php } ?>
</div>
</div>
<?php // Product description ?>
<div class="<?php
if(!Mage::getStoreConfig('ajax/general/enabledpro')){
switch($this->getLayout()->getBlock('root')->getTemplate()){
case 'page/1column.phtml':
echo 'grid_9';
break;
case 'page/3columns.phtml':
echo 'grid_3';
break;
default:
echo 'grid_6';
}
}
?> omega right-col">
<div class="product-shop">
<?php if($productname): ?>
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
<?php endif; ?>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product) ?>
<?php endif; ?>
<?php if(!$_product->isSaleable()): ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<div class="desc std">
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
</div>
<?php if($productprice): ?>
<?php echo $this->getPriceHtml($_product, true) ?>
<?php endif; ?>
<?php if($_product->isSaleable()): ?>
<?php if(Mage::getStoreConfig('ajax/general/enabledpro')){ ?>
<?php if ( !($_product->getTypeInstance(true)->hasRequiredOptions($_product) || $_product->isGrouped()) and $addtocart): ?>
<div class="button-holder">
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<span id='ajax_loader<?php echo $_product->getId()?>' class="ajax-loader-item" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>' alt="" /></span>
</div>
<?php elseif($addtocart): ?>
<div class="button-holder">
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='ajax-fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'>Test</a>
</div>
<?php endif; ?>
<?php }elseif($addtocart){ ?>
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
<?php } ?>
<?php endif; ?>
<?php if(Mage::getStoreConfig('ajax/wishlistcompare/enabledpro')){?>
<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()and $wishlist) : ?>
<li><a href="#" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>");return false;' class="link-wishlist"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('wishlist'); ?><span id='ajax_wishlist_loading<?php echo $_product->getId()?>' class="ajax-loader-item" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>' alt="" /></span></a></li>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product) and $compareproducts): ?>
<li><span class="separator">|</span> <a href="#" onclick='ajaxCompare("<?php echo $_compareUrl ?>","<?php echo $_product->getId()?>");return false;' class="link-compare"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('compare'); ?><span id='ajax_loading<?php echo $_product->getId()?>' class="ajax-loader-item" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>' alt="" /></span></a></li>
<?php endif; ?>
</ul>
<?php }else{?>
<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow() and $wishlist) : ?>
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('wishlist'); ?></a></li>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product) and $compareproducts): ?>
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('compare'); ?></a></li>
<?php endif; ?>
</ul>
<?php } ?>
</div>
</div>
</li>
<?php endforeach; ?>
</ol>
<script type="text/javascript">
decorateList('products-list', 'none-recursive')
<?php if(Mage::getStoreConfig('ajax/general/enabledpro')): ?>
mainContainer = jQuery('.main-container');
rightCol = jQuery('.right-col');
if(mainContainer.hasClass('col3-layout')){
rightCol.addClass('grid_3');
}else if(mainContainer.hasClass('col1-layout')){
rightCol.addClass('grid_9');
}else{
rightCol.addClass('grid_6');
}
<?php endif; ?>
</script>
<?php else: ?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = $this->getColumnCount(); ?>
<ul class="products-grid <?php echo 'grid-'.$grid.'-columns'; echo ' '.$labelsType.' '.$labelsPosition; ?>">
<?php $i=1; foreach ($_productCollection as $_product): ?>
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<li class="item<?php if($labelsoptions['labelsorder'] == 'sale_new'):?> labels-sale-new<?php endif; ?>">
<div class="product-container">
<div class="product-img-box">
<?php echo MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'new'); ?>
<?php if (!MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'new')) : ?>
<div class="no-label-new">
<?php endif; ?>
<?php if($productOnlyXleft and MAGE::helper('ThemeOptionsMinimalism')->getProductOnlyXleft($_product)): ?>
<?php echo MAGE::helper('ThemeOptionsMinimalism')->getProductOnlyXleft($_product); ?>
<?php else: ?>
<?php echo MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'sale'); ?>
<?php endif; ?>
<?php if (!MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product, 'new')) : ?>
</div>
<?php endif; ?>
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><?php /* Hover Image */ echo $helpImg->getHoverImage($_product, 'small_image', 300, null); ?><img <?php echo $helpImg->getImgSources($_product, 'small_image', 300, null); ?> alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
<?php // Fancybox
if ($fancybox['fancybox_status'] && $fancybox['fancybox_listing'] == 1): ?>
<a class="fancybox category-gallery" title="<?php echo $_productNameStripped; ?>" href="<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('fancybox'); ?></a>
<?php endif; // End Fancybox ?>
<?php if(Mage::getStoreConfig('ajax/general/enabledpro') and $quickview){ ?>
<div class="quick-view-holder">
<button type="button" title="<?php echo $this->__('Quick View') ?>" class="button btn-quick-view" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Quick View') ?></span><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('quickview'); ?></span></button>
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='ajax-fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'>Test</a>
</div>
<?php } ?>
</div>
<?php if($productname): ?>
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
<?php endif; ?>
<?php if($productprice): ?>
<?php echo $this->getPriceHtml($_product, true) ?>
<?php endif; ?>
<?php if($_product->isSaleable()): ?>
<?php if(Mage::getStoreConfig('ajax/general/enabledpro')){ ?>
<?php if ( !($_product->getTypeInstance(true)->hasRequiredOptions($_product) || $_product->isGrouped()) and $addtocart): ?>
<div class="button-holder">
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<span id='ajax_loader<?php echo $_product->getId()?>' class="ajax-loader-item" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>' alt="" /></span>
</div>
<?php elseif($addtocart): ?>
<div class="button-holder">
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='ajax-fancybox' id='fancybox<?php echo $_product->getId()?>' style='display:none'>Test</a>
</div>
<?php endif; ?>
<?php }elseif($addtocart){ ?>
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
<?php } ?>
<?php endif; ?>
<?php if(Mage::getStoreConfig('ajax/wishlistcompare/enabledpro')){?>
<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()and $wishlist) : ?>
<li><a href="#" onclick='ajaxWishlist("<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>","<?php echo $_product->getId()?>");return false;' class="link-wishlist"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('wishlist'); ?><span id='ajax_wishlist_loading<?php echo $_product->getId()?>' class="ajax-loader-item" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>' alt="" /></span></a></li>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product) and $compareproducts): ?>
<li><span class="separator">|</span> <a href="#" onclick='ajaxCompare("<?php echo $_compareUrl ?>","<?php echo $_product->getId()?>");return false;' class="link-compare"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('compare'); ?><span id='ajax_loading<?php echo $_product->getId()?>' class="ajax-loader-item" style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>' alt="" /></span></a></li>
<?php endif; ?>
</ul>
<?php }else{?>
<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow() and $wishlist) : ?>
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('wishlist'); ?></a></li>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product) and $compareproducts): ?>
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo MAGE::helper('ThemeOptionsMinimalism')->getIcon('compare'); ?></a></li>
<?php endif; ?>
</ul>
<?php } ?>
</div>
</li>
<?php $i++; endforeach ?>
</ul>
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
<script type="text/javascript">
jQuery(window).load(function(){
jQuery('.products-grid').isotope({
itemSelector: '.item',
resizable: true,
layoutMode : 'fitRows'
});
});
</script>
<?php endif; ?>
<?php if(Mage::getStoreConfig('ajax/general/enabledpro')){ ?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.ajax-fancybox').fancybox(
{
hideOnContentClick : true,
width:600,
autoDimensions: true,
type : 'iframe',
showTitle: false,
scrolling: 'no',
afterLoad: function(){
setTimeout(function(){
var frameBodyHeight = jQuery('.fancybox-iframe').contents().find('body').addClass('iframe-body').height();
if(jQuery(window).height() > frameBodyHeight+30){
jQuery('.fancybox-inner').css('height', frameBodyHeight);
}
}, 1000);
}
}
);
/* button loader */
jQuery('.products-grid li.item .btn-cart').on('click', function(){
jQuery(this).parent().addClass('active');
});
jQuery('.lockshow-bg').remove();
});
function showOptions(id){
jQuery('#fancybox'+id).trigger('click');
}
function setAjaxData(data,iframe){
if(data.status == 'ERROR'){
alert(data.message);
}else{
if(jQuery('.top-cart')){
jQuery('.top-cart').replaceWith(data.sidebar);
}
jQuery.fancybox.close();
jQuery('body').append('<div class="add-to-cart-success">' + data.message +' <a href="<?php echo $this->getUrl('checkout/cart'); ?>"><span><?php echo $this->__('Go to Shopping Cart') ?></span></a><a href="#" class="btn-remove"><i class="fa fa-times"></i></a></div>');
setTimeout(function () {jQuery('.add-to-cart-success').slideUp(500)}, 5000);
jQuery('.add-to-cart-success a.btn-remove').click(function(){
jQuery(this).parent().slideUp(500);
return false;
});
}
}
function setLocationAjax(url,id){
url += 'isAjax/1';
url = url.replace("checkout/cart","ajax/index");
jQuery('#ajax_loader'+id).show();
try {
jQuery.ajax( {
url : url,
dataType : 'json',
success : function(data) {
jQuery('#ajax_loader'+id).hide();
jQuery('.products-grid li.item').removeClass('active');
setAjaxData(data,false);
}
});
} catch (e) {
}
}
labelsHeight();
productHoverImages();
</script>
<?php }else{ ?>
<script type="text/javascript">
jQuery('.lockshow-bg').remove();
</script>
<?php } ?>
<div class="toolbar-bottom">
<?php echo $this->getToolbarHtml() ?>
</div>