Skip to content

I Want My Sale and Featured Products To Display Differently. Is This Possible?

Yes. The plugin allows you to check if the following fields are On:

  • hasshippingcalculation
  • istaxable
  • isfeaturedproduct
  • isdiscountenabled
  • isvalid
  • usesaleprice

This enables you to insert HTML into the Product Detail Format or Product List Item Format fields only if those fields are On.

The command format is -

#if[fieldname|HTML]

#if(usesaleprice|<div class='saleitem'></div>)

The above will render the HTML code <div class='saleitem'></div> only if the Use Sale Price field is checked in 1ShoppingCart.com.

#if(isfeaturedproduct|<div class='featureitem'></div>)

The above will render the HTML code <div class='featureitem'></div> only if the Featured Product field is checked in 1ShoppingCart.com.

For example, I want to insert this HTML - <div class='saleitem'></div> before the product details but only on the items that I have marked Use Sale Price in 1ShoppingCart.com.  I would insert the following into the Product List Item Format

<div class="product">
     #if(usesaleprice|<div class='saleitem'></div>)
     #if(isfeaturedproduct|<div class='featureitem'></div>)
     <div class="col1">
          <a href="/store/#ProductHyphenName">#ProductImage</a>
     </div>
     <div class="col2">
          <span class="product_name"><a href="/store/#ProductHyphenName">#ProductName</a></span>
          <span class="product_details">
               <span class="description">#ShortDescription</span>
               <span class="sku">#ProductSku</span>
               <span class="price">#ProductPrice</span>
               <span class="buy-now">#BuyNow</span>
          </span>
          <div class="clear"> </div>
     </div>
     <div class="clear"> </div>
</div>

A live example of this code in action can be found at wpdemo.equalserving.com/store

Feedback and Knowledge Base