Why NonSale items show up in Sale Block?

Hi, I have added the Sale Block to the Mega Menu under the heading ALL PATTERNS and it sometimes shows items onsale and sometimes just show random items? I only want it to show sale items.

The block onsale is setup according to the kidsland doc.

{{block type="joomlart_jmproducts/list" name="mega.jmproducts.list" template="joomlart/jmproducts/oneproduct.phtml" quanlity="2" title=""}}

Is there something missing in the code to limit the items to OnSale items only?

Thanks

8 answers

Profile photo of Seoki Lee 1510.00 $tone September 22, 2014
Public

You can do it by creating new category "sale" and set all products which you want to show on mega menu. To show it you just set ID for category like this

Code:

{{block type="joomlart_jmproducts/list" name="mega.jmproducts.list" template="joomlart/jmproducts/oneproduct.phtml" quanlity="2" title="" catsid="1"}}

Note: catsid="your category sale’s ID "

For your detail you can refer to documentation of JM products list here:
http://www.joomlart.com/documentatio…ct-list#config

#1
Profile photo of Mall Staff 184060.00 $tone September 25, 2014
Public

I have sent you a PM. Please check it.
The issue of Sale items on your website was resolved.

Have a look & let me know if you need more helps.

#4
Profile photo of Mall Staff 184060.00 $tone September 25, 2014
Public

This issue occurs on your site because it’s using old version of Jm Products.
To resolve this issue, please open the file at: /app/code/local/joomlArt/JmProducts/Block/List.php

and find to the block code bellow:

PHP Code:

function addCategoryIdsFilter($products_collection){
        
$categories_to_filter explode(","$this->_config['catsid']);
        
$ctf = array();
         
        foreach (
$categories_to_filter as $k => $cat) {
             
$ctf[]['finset'] = $cat;
        }
         
        
$products_collection->joinField('category_id''catalog/category_product''category_id''product_id = entity_id'null'left')
                    ->
addAttributeToFilter('category_id',array($ctf))->groupByAttribute('entity_id');
    } 




then replace it with block code bellow:

PHP Code:

public function addCategoryIdsFilter(&$collection)
{
        
$categoryIds explode(","$this->_config['catsid']);
        if(
count($categoryIds) == 1)
        {
            foreach (
$categoryIds as $catId) {
                
$categoryModel Mage::getModel('catalog/category')->load($catId);
                
$collection->addCategoryFilter($categoryModel); //category filter
            
}
        }
        else{
            
$ctf = array();
            foreach (
$categoryIds as $catId) {
                
$ctf[]['finset'] = $catId;
            }
            
$collection->joinField('category_id''catalog/category_product''category_id''product_id = entity_id'null'left')
                ->
addAttributeToFilter('category_id',array($ctf))->groupByAttribute('entity_id');
        }
    } 




Let do it to resolve the issue of your site.

#6

This question is now closed

Written By

Comments