We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

NEW Plugin - SCM Item…

Development and Programming

Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

Mark, I saw that thread earlier and just knew you’d have a plugin whipped up in a couple of hours.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Mark, I saw that thread earlier and just knew you’d have a plugin whipped up in a couple of hours.

1 hour 18 minutes to be precise 😉

Just hope it helps someone out really.

Best wishes,

Mark

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.