wcfm-santa

Making Christmas merrier with our special gift! Enjoy upto 25% off on all WCFM Addons.

CLAIM OFFER
01Day 17Hr 22Min 33Sec

Automatically remove vendor items once purchased

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Automatically remove vendor items once purchased

Viewing 2 reply threads
  • Author
    Posts
    • #81004
      Jose Gomez
      Participant

      I am having the problem where vendors’ items are remaining on the shop page for purchase after they have been purchased. Due to the nature of my marketplace I would like to be able to have published items automatically removed from the shop once they are purchased. In other words, items should only be available for purchase one time and then the listing expires.

    • #81360
      Jose Gomez
      Participant

      I received support via email and this code resolved it by adding it via snippet plugin:

      add_filter( ‘wcfm_product_fields_stock’, function( $stock_fields, $product_id, $product_type ) {
      if( !$product_id ) {
      if( isset( $stock_fields[‘manage_stock’] ) ) {
      $stock_fields[‘manage_stock’][‘dfvalue’] = ‘enable’;
      }
      if( isset( $stock_fields[‘stock_qty’] ) ) {
      $stock_fields[‘stock_qty’][‘value’] = 1;
      }
      if( isset( $stock_fields[‘sold_individually’] ) ) {
      $stock_fields[‘sold_individually’][‘dfvalue’] = ‘enable’;
      }
      }
      $stock_fields = wcfm_hide_field( ‘manage_stock’, $stock_fields );
      $stock_fields = wcfm_hide_field( ‘stock_status’, $stock_fields );
      $stock_fields = wcfm_hide_field( ‘stock_qty’, $stock_fields );
      $stock_fields = wcfm_hide_field( ‘backorders’, $stock_fields );
      $stock_fields = wcfm_hide_field( ‘sold_individually’, $stock_fields );
      return $stock_fields;
      }, 50, 3 );

    • #81654
      WCFM Forum
      Member

      Thanks for update this here 🙂

Viewing 2 reply threads
  • The topic ‘Automatically remove vendor items once purchased’ is closed to new replies.