drcj64241 2016-03-23 12:29
浏览 37
已采纳

如何从Prestashop的数据库中获取特定产品

Is there any simple way to retrieve only 'Product Packs' from database? I want to display all the product pack combinations in different category.

And it would be great if I can disable this pack to be appeared in other category. If its become too much complex, I have no problem with it.

As I am using a custom templates I am giving a sample of code about how it displays product in my Prestashop 1.6.1.4.

<div class ='cate_title'>
                    {foreach from=$productCates item=productCate name=posTabCategory}
                     <div id="tabtitle_{$productCate.id}" class="tab_title">        
                            <h2>
                                <span>{$productCate.name}</span>
                            </h2>
                    </div>  
                    {/foreach}
                </div>
                <ul class="tab_cates"> 
                {$count=0}
                {foreach from=$productCates item=productCate name=posTabCategory}
                        <li data-title="tabtitle_{$productCate.id}" rel="tab_{$productCate.id}" {if $count==0} class="active"  {/if} > {$productCate.name}</li>
                        {$count= $count+1}
                {/foreach}  
                </ul>
            </div>  
            <div class="tab1_container"> 
            {foreach from=$productCates item=productCate name=posTabCategory}
                <div id="tab_{$productCate.id}" class="tab_category">
                    <div class="row">
                        <div class="productTabCategorySlider1">
                            {foreach from=$productCate.product item=product name=posTabCategory}

                                <div class="cate_item">
                                    <div class="item-inner">
                                        <a class ="bigpic_{$product.id_product}_tabcategory product_image" href="{$product.link|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}"><img class="img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{$product.name|escape:html:'UTF-8'}" />

      ..............................
      ...............................
  • 写回答

1条回答 默认 最新

  • doulian4762 2016-03-28 04:27
    关注

    Follow is sql by which you can get all pack products from database $pack_products = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'product WHERE cache_is_pack = 1');

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算