As per this thread here Milan was asking if there is a way to tell if an entry has or hasn’t been added to the Simple Commerce Module (SCM).
As it stands the SCM tag will output data such as the buy buttons if the item has been added to the module but if an entry hasn’t been added then it will show nothing. This plugin gets around this problem although can’t itself (the plugin that is) be used within the SCM tag it will need to go within the weblog tag so that it can pick up the {entry_id} variable for the current entry.
Usage
{exp:weblog:entries weblog="default_site"}
<h2>{title}</h2>
{exp:scm_item entry_id="{entry_id}"}
{if item_added == "TRUE"}
This item has been added to the Simple Commerce Module
{if:else}
This item hasn't been added to the Simple Commerce Module
{/if}
{/exp:scm_item}
{exp:simple_commerce:purchase entry_id="{entry_id}" success="site/success" cancel="site/index"}
<strong>{item_sale_price}</strong>
<a >Buy Now</a>
<a >Add to Cart</a>
<a >View Cart</a>
{/exp:simple_commerce:purchase}
{/exp:weblog:entries}
Hope that helps someone out a bit.
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.