• 1.
    <?php
  • 2.
     
  • 3.
    $product_id="9999";
  • 4.
    $current_product_stock_level=get_post_meta( $product_id, '_stock', true ); 
  • 5.
     
  • 6.
    new GW_Inventory( array(
  • 7.
     'form_id' => 363,
  • 8.
     'field_id' => 2.3,
  • 9.
     'stock_qty' => $current_product_stock_level,
  • 10.
     'out_of_stock_message' => 'Sorry, there are no more tickets!',
  • 11.
     'not_enough_stock_message' => 'You ordered %1$s tickets. There are only %2$s tickets left.',
  • 12.
     'approved_payments_only' => false,
  • 13.
     'hide_form' => false,
  • 14.
     'enable_notifications' => true
  • 15.
    ) );
<?php $product_id="9999"; $current_product_stock_level=get_post_meta( $product_id, '_stock', true ); new GW_Inventory( array( 'form_id' => 363, 'field_id' => 2.3, 'stock_qty' => $current_product_stock_level, 'out_of_stock_message' => 'Sorry, there are no more tickets!', 'not_enough_stock_message' => 'You ordered %1$s tickets. There are only %2$s tickets left.', 'approved_payments_only' => false, 'hide_form' => false, 'enable_notifications' => true ) );

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter