Regular Price Field

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!

Viewing 2 reply threads
  • Author
    Posts
    • #102483
      info100
      Participant

      Hi
      I have a special price calculation plugin.
      Vendor only needs to add a price to the purchase price field when adding products.
      Vendor Regular price should see
      but cannot edit
      You can see in the picture.

      Attachments:
      You must be logged in to view attached files.
    • #104641
      Sushobhan
      Keymaster

      Hello,
      Thanks for getting in touch with us. From what I have understood, you want to make regular price field read-only/disabled. You can do so via the following snippet-

      function make_price_readonly( $fields ) {
          if ( wcfm_is_vendor() ) {
              if ( isset( $fields['regular_price'] ) ) {
                  $fields['regular_price']['attributes'] = array( 'readonly' => 'readonly', 'disabled' => 'disabled' );
              }
          }
          return $fields;
      }
      add_filter('wcfm_product_manage_fields_pricing', 'make_price_readonly');

      Thanks

    • #104751
      info100
      Participant

      Thank you so much.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.