fbpx

Require image product on register

WCMp Core

Require image product on register Resolved

Viewing 3 reply threads
  • Author
    Posts
    • #137263
      nubalaio
      Participant

      How to Require image product on register?

    • #137267

      Hi @nubalaio, thanks for getting in touch with us.

      In order to make product image a required option, please use the below code :

      /**
      **required some wcmp product field 
      **/
      add_action( 'wcmp_before_post_update', 'required_wcmp_product_field' );
      function required_wcmp_product_field(){
          $required_feature_image = isset( $_POST['featured_img'] ) ? $_POST['featured_img'] : '';
             if(!$required_regular_price || !$required_product_description || !$required_feature_image || !$required_product_image || !$required_shipping_weight_field ){
              wc_add_notice( __('You have to add description,images,regualar price and shipping weight', 'dc-woocommerce-multi-vendor'), 'error' );
              wp_redirect( apply_filters( 'wcmp_vendor_save_product_redirect_url', wcmp_get_vendor_dashboard_endpoint_url( get_wcmp_vendor_settings( 'wcmp_edit_product_endpoint', 'vendor', 'general', 'edit-product' ), $_POST['post_ID'] ) ) );
              exit;
          }
      }
      Copy
    • #137322
      nubalaio
      Participant

      <3 thkssss

    • #137331

      we are happy to help you
      We would love it if you shared your experience by giving us 5/5 review here :
      https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post
      Seeing glowing reviews from existing customers makes others more comfortable knowing they’ll get the support they need with an issue with our services when arise.

Viewing 3 reply threads

The topic ‘Require image product on register’ is closed to new replies.

Buy all Marketplace addons together!!

Check Slashed Price