0

Here is code this module(3rd party ) is use in admin but it proper work in magento admin panel but noting display on front end because _getList() is empty that why else condition execute how i solve it ???

after <?php include('default_js.phtml'); ?> this condition is written and execute

} else {
    echo 'Has no item to show!';
} ?>



$helper = Mage::helper('listingtabs/data');
$list = $this->_getList();

if (!empty($list)) {

$import_str = "";
$jsHelper = Mage::helper('core/js');
// jquery has not added yet
if (!defined('MAGENTECH_JQUERY') && (int)$this->_getConfig('include_jquery')) {
    // if module allowed jquery.
    $import_str .= $jsHelper->includeSkinScript('sm/listingtabs/js/jquery-1.8.2.min.js');
    $import_str .= $jsHelper->includeSkinScript('sm/listingtabs/js/jquery-noconflict.js');
    define('MAGENTECH_JQUERY', 1);
}

$import_str .= $jsHelper->includeSkinScript('sm/listingtabs/js/owl.carousel2.js');
echo $import_str;

$module_id = $this->_moduleID();
$tag_id = 'sm_listing_tabs_' . rand() . time();
$class_ltabs = 'ltabs00-' . $this->_getConfig('nbi_column1', 4) . ' ltabs01-' . $this->_getConfig('nbi_column1', 3) . ' ltabs02-' .
    $this->_getConfig('nbi_column2', 3) . ' ltabs03-' . $this->_getConfig('nbi-column3', 2) . ' ltabs04-' . $this->_getConfig('nbi-column4', 1);
$show_loadmore_slider = $this->_getConfig('show_loadmore_slider');
$class_show = ($show_loadmore_slider == 'loadmore') ? ' show-loadmore' : ' show-slider';
//effect
$center = $this->_getConfig('center') == 1?'true':'false';
$nav = $this->_getConfig('nav') == 1?'true':'false';
$loop = $this->_getConfig('loop') == 1?'true':'false';
$margin = (int)$this->_getConfig('margin') >= 0 ? $this->_getConfig('margin') : 5;
$slideBy = (int)$this->_getConfig('slideBy') > 0 ? $this->_getConfig('slideBy') : 1;
$autoplay = $this->_getConfig('autoplay') == 1?'true':'false';
$autoplayHoverPause = $this->_getConfig('autoplayHoverPause') == 1?'true':'false';
$autoplaySpeed = $this->_getConfig('autoplaySpeed') >= 0 ? $this->_getConfig('autoplaySpeed') : 5000;
$navSpeed = $this->_getConfig('navSpeed') >= 0 ? $this->_getConfig('navSpeed') : 5000;
$smartSpeed = $this->_getConfig('smartSpeed') >= 0 ? $this->_getConfig('smartSpeed') : 5000;
$startPosition = $this->_getConfig('startPosition') > 0 ? $this->_getConfig('startPosition') : 1;
$mouseDrag = $this->_getConfig('mouseDrag') == 1?'true':'false';
$touchDrag = $this->_getConfig('touchDrag') == 1?'true':'false';
$pullDrag = $this->_getConfig('pullDrag') == 1?'true':'false';

$nb_column1 = $this->_getConfig('nbi_column1', 6);
$nb_column2 = $this->_getConfig('nbi_column2', 6);
$nb_column3 = $this->_getConfig('nbi_column3', 6);
$nb_column4 = $this->_getConfig('nbi_column4', 6);

?>

<div id="<?php echo $tag_id; ?>" class="sj-listing-tabs first-load"><!--<![endif]-->
    <?php if ($this->_getConfig('listingtabs_title_text')) { ?>
        <div class="tab-listing-titles block-title">
            <strong><span><?php echo $this->_getConfig('listingtabs_title_text', 'Tab Listing'); ?></span></strong>
            <div class="sn-img icon-bacsic"></div>
        </div>
    <?php
    }
    $pretext = $this->_getConfig('pretext');
    if (!empty($pretext)) {
        ?>
        <div class="pre-text"><?php echo $this->_getConfig('pretext'); ?></div>
    <?php } ?>
    <div class="ltabs-wrap ">
        <div class="ltabs-tabs-container" data-delay="<?php echo $this->_getConfig('delay', 300); ?>"
             data-duration="<?php echo $this->_getConfig('duration', 600); ?>"
             data-effect="<?php echo $this->_getConfig('effect'); ?>"
             data-ajaxurl="<?php echo Mage::getBaseUrl() . 'listingtabs/index/ajax'; ?>"
             data-modid="<?php echo $tag_id; ?>">
            <!--Begin Tabs-->
            <?php include('default_tabs.phtml'); ?>
        </div>
        <!-- End Tabs-->
        <div class="ltabs-items-container super-cat-wrapper <?php echo $class_show; ?>"><!--Begin Items-->
            <div class="row">
                <div class="col-lg-3 col-md-3 hidden-sm hidden-xs"> 
                    <div class="ltabs-tabs-containers">
                        <div class="imgleft  img-effect">
                            <a class="img-class " href="#"><img alt="img-listing-left" src="<?php echo Mage::getBaseUrl('media')?>wysiwyg/img-listing-left.jpg" /></a>
                        </div>      
                    </div>

                </div>
                <div class="col-lg-9 col-md-9 col-sm-12"  style="position: static;">
                    <?php foreach ($list as $items) {

                        $child_items = isset($items->child) ? $items->child : '';
                        $cls_device = $class_ltabs;
                        $cls_animate = $this->_getConfig('effect');
                        $cls = (isset($items->sel) && $items->sel == "sel") ? ' ltabs-items-selected ltabs-items-loaded' : '';
                        $cls .= ($items->id == "*") ? ' items-category-all' : ' items-category-' . $items->id;
                        ?>
                        <div class="ltabs-items <?php echo $cls; ?>">
                            <div class="ltabs-items-inner <?php echo $cls_device . ' ';
                            echo $cls_animate; ?>">
                                <?php if (!empty($child_items)) {
                                    include('default_items.php');
                                } else {
                                    ?>
                                    <div class="ltabs-loading"></div>
                                <?php } ?>
                            </div>

                            <?php if($show_loadmore_slider == 'loadmore') { ?>
                                <?php $classloaded = ($this->_getConfig('product_limitation', 2) >= $items->count || $this->_getConfig('product_limitation', 2) == 0) ? 'loaded' : '';?>
                                <div class="ltabs-loadmore"
                                     data-active-content=".items-category-<?php echo ($items->id == "*") ? 'all' : $items->id; ?>"
                                     data-categoryid="<?php echo $items->id; ?>"
                                     data-rl_start="<?php echo $this->_getConfig('product_limitation', 2) ?>"
                                     data-rl_total="<?php echo $items->count ?>"
                                     data-rl_allready="<?php echo $this->__('All ready'); ?>"
                                     data-ajaxurl="<?php echo Mage::getBaseUrl() . 'listingtabs/index/ajax'; ?>"
                                     data-modid="<?php echo $module_id; ?>"
                                     data-rl_load="<?php echo $this->_getConfig('product_limitation', 2) ?>">
                                    <div class="ltabs-loadmore-btn <?php echo $classloaded ?>"
                                         data-label=" <?php echo ($classloaded) ? $this->__('All ready') : $this->__('Load more'); ?>">
                                        <span class="ltabs-image-loading"></span>
                                        <img class="add-loadmore"
                                             src="<?php echo $this->getSkinUrl('sm/listingtabs/images/add.png'); ?>">
                                    </div>
                                </div>
                            <?php } ?>

                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
        <!--End Items-->
    </div>
    <?php
    $posttext = $this->_getConfig('posttext');
    if (!empty($posttext)) {
        ?>
        <div class="post-text"><?php echo $this->_getConfig('posttext'); ?></div>
    <?php } ?>
</div>

<?php include('default_js.phtml'); ?>
  • any one guide me to fix this issue? – Pak Taza Aug 8 '17 at 5:48
  • $helper = Mage::helper('listingtabs/data'); $list = $this->_getList(); this function not send data _getList() is empty . how i solve it where i found it ????? – Pak Taza Aug 8 '17 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.