简体   繁体   English

Joomla 3-Virtuemart-Virtuemar产品模块

[英]Joomla 3 - Virtuemart - Virtuemar product module

I'm using Joomla 3 and Virtuemart 3.0.18. 我正在使用Joomla 3和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. 因此,我创建了2个相同类型的模块: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: 在VirtueMartModelProduct类的sortSearchListQuery()函数中,我找到了以下代码行:

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! 所以,再次感谢您!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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