We are trying to suppress products from displaying in the auto complete in the main search field in the global header. These products all have one thing in common. They have a sales reps name in a custom field called SalesRep. This code is located on the api page in the main template. Here is the code that I am attempting and it does not work:
<mvt:foreach iterator="product" array="ac:products">
<mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :SalesRep">
<mvt:foreachcontinue/>
</mvt:if>
<li><a href="&mvt:product:link;"><b>&mvt:product:code;</b> - &mvt:product:name;</a></li>
</mvt:foreach>
As a work around, since the client does not use the cost field, I populated the cost fields for these products with .01 and this does work:
<mvt:foreach iterator="product" array="ac:products">
<mvt:if expr=" '.01' CIN l.settings:product:cost ">
<mvt:foreachcontinue/>
</mvt:if>
<li><a href="&mvt:product:link;"><b>&mvt:product:code;</b> - &mvt:product:name;</a></li>
</mvt:foreach>
It seems to work fine with regular product fields but I need the code that will query custom fields please.
<mvt:foreach iterator="product" array="ac:products">
<mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :SalesRep">
<mvt:foreachcontinue/>
</mvt:if>
<li><a href="&mvt:product:link;"><b>&mvt:product:code;</b> - &mvt:product:name;</a></li>
</mvt:foreach>
As a work around, since the client does not use the cost field, I populated the cost fields for these products with .01 and this does work:
<mvt:foreach iterator="product" array="ac:products">
<mvt:if expr=" '.01' CIN l.settings:product:cost ">
<mvt:foreachcontinue/>
</mvt:if>
<li><a href="&mvt:product:link;"><b>&mvt:product:code;</b> - &mvt:product:name;</a></li>
</mvt:foreach>
It seems to work fine with regular product fields but I need the code that will query custom fields please.
Comment