Title: Stock Control for dynamically-generated shortcode product
Last modified: April 13, 2020

---

# Stock Control for dynamically-generated shortcode product

 *  Resolved [intowernet](https://wordpress.org/support/users/intowernet/)
 * (@intowernet)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/stock-control-for-dynamically-generated-shortcode-product/)
 * I’ve read your tutorial “Creating a Payment Button by Dynamically Adding Item
   Details in the Shortcode” and wonder if there’s a way to specify there only being
   1 of a particular item? For example, I have 2 unique products for sale. I’d like
   to copy/paste the shortcode for each and just have to change the name. That way,
   once the product sells nobody else can pay for it. Something like below…
 * [accept_stripe_payment name=”Product-1″ price=”50″ button_text=”Buy Now” billing_address
   =”1″ shipping_address=”1″ **stock=”1″**]
 * [accept_stripe_payment name=”Product-2″ price=”50″ button_text=”Buy Now” billing_address
   =”1″ shipping_address=”1″ **stock=”1″**]

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * (@alexanderfoxc)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/stock-control-for-dynamically-generated-shortcode-product/#post-12667533)
 * Hi.
 * Single-use shortcodes do not have any kind of stock control options since the
   database doesn’t have any data regarding those shortcodes.
 * Use products instead as they provide more configurable options then shortcodes.
   Create 2 products `Product 1` and `Product 2` and set stock options for those.
 * Then you can use `[asp_product id="123"]` and `[asp_product id="124"]` shortcodes
   to add those anywhere you like. You can also enable “Show Button Only” on “Appearance”
   metabox of product edit page to have payment button displayed without any additional
   info (just like single-use shortcode).
 *  Thread Starter [intowernet](https://wordpress.org/support/users/intowernet/)
 * (@intowernet)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/stock-control-for-dynamically-generated-shortcode-product/#post-12667954)
 * Thanks for your swift reply!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Stock Control for dynamically-generated shortcode product’ is closed 
to new replies.

 * ![](https://ps.w.org/stripe-payments/assets/icon-128x128.png?rev=2705524)
 * [Accept Stripe Payments](https://wordpress.org/plugins/stripe-payments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stripe-payments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stripe-payments/)
 * [Active Topics](https://wordpress.org/support/plugin/stripe-payments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stripe-payments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stripe-payments/reviews/)

## Tags

 * [stock control](https://wordpress.org/support/topic-tag/stock-control/)

 * 2 replies
 * 2 participants
 * Last reply from: [intowernet](https://wordpress.org/support/users/intowernet/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/stock-control-for-dynamically-generated-shortcode-product/#post-12667954)
 * Status: resolved