简体   繁体   中英

Joomla 3 - Virtuemart - Virtuemar product module

I'm using Joomla 3 and Virtuemart 3.0.18.

I'm building a website to show products of my store. So, I created 2 modules in the same type: mod_virtuemart_product. I need one of them display my newest products and other display featured products.

My problem is my website just display one of them in a same page.

Please help me! Thank you so much!

Update:

In my template, I load those modules using like this:

<?php if ($this->countModules('modpro')) : ?>
    <div class="modpro">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <jdoc:include type="modules" name="modpro" style="xhtml" />
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <?php if ($this->countModules('modnew')) : ?>
    <div class="modnew">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <jdoc:include type="modules" name="modnew" style="xhtml" />
                </div>
            </div>
        </div>
    </div>
<?php endif; ?>

I tried setting them in the same position, but it doesn't work.

I disabled one of them, other were be renderred. I set them on difference pages, them were be renderred.

Thanks everyone who viewed this question.

I has found the reason of my issue. In the sortSearchListQuery() function of the VirtueMartModelProduct class, I found these code line:

if(self::$_alreadyLoadedIds){
    $where[] = ' p.`virtuemart_product_id`!='.implode(' AND p.`virtuemart_product_id`!=',self::$_alreadyLoadedIds).' ';
    //$where[] = ' p.`virtuemart_product_id` NOT IN ('.implode(',',self::$_alreadyLoadedIds).') ';
}

It prevent my second module from loading the same products again.

So, thank you again!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM