xml SD4 - 子类别的子类别产品的图像......什么

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml SD4 - 子类别的子类别产品的图像......什么相关的知识,希望对你有一定的参考价值。

<h4 class="subcategory-title" style="clear: both;">Subcategories in &mvte:category:name;</h4>
<mvt:if expr="NOT ISNULL g.subcategoryHide">
    <mvt:if expr="g.subcategoryHide EQ 'false'">
        <mvt:item name="customfields" param="Write_Basket( 'sc_hide', 'false' )" />
    <mvt:elseif expr="g.subcategoryHide EQ 'true'">
        <mvt:item name="customfields" param="Write_Basket( 'sc_hide', 'true' )" />
    </mvt:if>
</mvt:if>
<mvt:item name="customfields" param="Read_Basket( 'sc_hide', l.settings:subcategoryHide )" />
<mvt:if expr="l.settings:subcategoryHide EQ 'false' OR ISNULL l.settings:subcategoryHide">
    <a class="subcategory-hide form-control" href="&mvt:breadcrumbs:current_item:link;?subcategoryHide=true">Hide</a>
<mvt:else>
    <a class="subcategory-hide form-control" href="&mvt:breadcrumbs:current_item:link;?subcategoryHide=false">Show</a>
</mvt:if>
<div class="clearfix"></div>
<mvt:if expr="l.settings:subcategoryHide EQ 'false' OR ISNULL l.settings:subcategoryHide">
<div class="subcategory-listing col-md-12 container-fluid clearfix">
    <mvt:foreach iterator="sub_category" array="sub_categories">
        <mvt:assign name="subcat_image" value="''" />
        <mvt:item name="toolkit" param="cxp|pcount|l.all_settings:sub_category:id" />
        <mvt:if expr="pcount GT 0">
            <mvt:assign name="prodcounter" value="0" />
            <mvt:foreach iterator="sub_product" array="sub_products">
                <mvt:assign name="prodcounter" value="g.prodcounter + 1" />
                <mvt:if expr="g.prodcounter EQ 1">
                    <mvt:item name="toolkit" param="customimage|subcat_image|l.all_settings:sub_product:id|thumb|234|144|1" />
                </mvt:if>
            </mvt:foreach>
        </mvt:if>
        <mvt:if expr="ISNULL g.subcat_image">
            <mvt:item name="toolkit" param="subcat2|ccount2|l.all_settings:sub_category:code" />
            <mvt:if expr="ccount2 GT 0">
               <mvt:assign name="scatscounter" value="0" />
               <mvt:foreach iterator="sub_category2" array="sub_categories2">
                <mvt:assign name="scatscounter" value=" g.scatscounter + 1" />
                <mvt:if expr="g.scatscounter EQ 1">
                <mvt:assign name="subcat_image" value="''" />
                <mvt:item name="toolkit" param="cxpc|pcount|l.all_settings:sub_category2:code" />
                <mvt:if expr="pcount GT 0">
                    <mvt:assign name="prodcounter" value="0" />
                    <mvt:foreach iterator="sub_product" array="sub_products">
                        <mvt:assign name="prodcounter" value="g.prodcounter + 1" />
                        <mvt:if expr="g.prodcounter EQ 1">
                            <mvt:item name="toolkit" param="customimage|subcat_image|l.all_settings:sub_product:id|thumb|234|144|1" />
                        </mvt:if>
                    </mvt:foreach>
                </mvt:if>                    
                </mvt:if>
                </mvt:foreach>
            </mvt:if>
        </mvt:if>
        <div class="col-md-4 col-sm-4 col-xs-6 subcategory-wrapper">
            <div class="subcategory-item box-shadow">
                <div class="item-image">
                <mvt:item name="toolkit" param="cattreeimage|subcatImage|l.all_settings:sub_category:code" />
                <mvt:if expr="g.subcatImage">
                    <img src="&mvte:global:subcatImage" class="img-responsive" alt="Shop &mvte:sub_category:name; Now" title="Shop &mvte:sub_category:name; Now" />
                <mvt:elseif expr="g.subcat_image">
                    <a href="/&mvt:sub_category:code;.html"><img src="&mvt:global:subcat_image" class="img-responsive" alt="Shop &mvte:sub_category:name; Now" title="Shop &mvte:sub_category:name; Now" /></a>
                <!-- If there is no image to pull it will check for existence of a category title image -->
                <mvt:elseif expr="NOT ISNULL l.settings:sub_category:image">
                    <a href="/&mvt:sub_category:code;.html"><img src="&mvt:sub_category:image;" class="img-responsive" alt="Shop &mvte:sub_category:name; Now" title="Shop &mvte:sub_category:name; Now" /></a>
                <mvt:else>
                    <a href="/&mvt:sub_category:code;.html"><img src="graphics/00000001/images/img-unavailable.png" class="img-responsive" alt="Shop &mvte:sub_category:name; Now" title="Shop &mvte:sub_category:name; Now" /></a>
                </mvt:if>                   
                </div>
                <div class="item-details">
                    <h5><a href="/&mvta:sub_category:code;.html">&mvte:sub_category:name;</a></h5>
                </div>
            </div>
        </div>
    </mvt:foreach>
</div>
</mvt:if>

以上是关于xml SD4 - 子类别的子类别产品的图像......什么的主要内容,如果未能解决你的问题,请参考以下文章

Woocommerce 插件 - 子类别的嵌套产品

想要在cakephp 3中获得子类别产品

xml Miva - 使用产品主图像的CTGY子类别图像

xml Eventblossom //如果没有产品,请使用下一个子类别的产品图片 - 也使用列表中的FIRST图像。

xml Eventblossom //如果没有产品,请使用下一个子类别的产品图片 - 也使用列表中的FIRST图像。

SELECT 子类别和没有子类别的父类别