Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

Invalid product status. error on product submit

Resolved
Viewing 7 reply threads
  • Author
    Posts
    • #134531
      cbshourov
      Participant

      hi, I am working o a website with this plugin. made a template for editing the product page. I think I made a mistake somewhere on the template.

      can you check if I missed something here? attached is my moded template.

    • #134532
      cbshourov
      Participant

      I see PHP file is blocked, hope txt isn’t.

    • #134533
      cbshourov
      Participant

      <?php
      /**
      * WCMp edit product template
      *
      * Used by WCMp_Products_Edit_Product->output()
      *
      * This template can be overridden by copying it to yourtheme/dc-product-vendor/vendor-dashboard/product-manager/edit-product.php.
      *
      * HOWEVER, on occasion WCMp will need to update template files and you
      * (the theme developer) will need to copy the new files to your theme to
      * maintain compatibility. We try to do this as little as possible, but it does
      * happen. When this occurs the version of the template file will be bumped and
      * the readme will list any important changes.
      *
      * @author WC Marketplace
      * @package WCMp/templates/vendor dashboard/product manager
      * @version 3.3.0
      *
      * moded by mrcs
      */
      defined( ‘ABSPATH’ ) || exit;

      global $WCMp;
      ?>
      <div class=”col-md-12 add-product-wrapper”>
      <?php do_action( ‘before_wcmp_add_product_form’ ); ?>
      <form id=”wcmp-edit-product-form” class=”woocommerce form-horizontal” method=”post”>
      <?php do_action( ‘wcmp_add_product_form_start’ ); ?>
      <!– Top product highlight –>
      <?php
      $WCMp->template->get_template( ‘vendor-dashboard/product-manager/views/html-product-highlights.php’, array( ‘self’ => $self, ‘product_object’ => $product_object, ‘post’ => $post, ‘is_update’ => $is_update ) );
      $image_size = apply_filters(‘wcmp_product_uploaded_image_size’, ‘medium’);
      ?>
      <!– End of Top product highlight –>

      <div class=”custom-panel” style=”border-left-width: 4px;margin-bottom: 38px;”>
      <label class=”control-label col-md-12 pt-0″ for=”product_short_description” style=”font-size: 18px;”><?php _e( ‘General information’, ‘dc-woocommerce-multi-vendor’ );?></label>
      <div style=”min-width: 50%; float: left;”>
      <?php
      $WCMp->template->get_template( ‘vendor-dashboard/product-manager/views/html-product-data-general.php’, array( ‘self’ => $self, ‘product_object’ => $product_object, ‘post’ => $post ) );
      if ( !apply_filters(‘wcmp_disabled_product_shipping_tab’, true) || wcmp_is_allowed_vendor_shipping() ) {
      $WCMp->template->get_template( ‘vendor-dashboard/product-manager/views/html-product-data-shipping.php’, array( ‘self’ => $self, ‘product_object’ => $product_object, ‘post’ => $post ) );
      }?>
      </div>
      <div style=”min-width: 50%; float:right;”>
      <div class=”col-md-12″>
      <?php if( ( get_wcmp_vendor_settings(‘is_disable_marketplace_plisting’, ‘general’) == ‘Enable’ ) ) :
      $product_categories = wcmp_get_product_terms_HTML( ‘product_cat’, $post->ID, apply_filters( ‘wcmp_vendor_can_add_product_category’, false, get_current_user_id() ) ); ?>
      <?php if ( $product_categories ) : ?>
      <div class=”panel panel-default pannel-outer-heading”>
      <div class=”panel-heading d-flex”>
      <label class=”control-label” for=”product_length”><?php printf( __( ‘Categories’, ‘dc-woocommerce-multi-vendor’ ), get_option( ‘woocommerce_dimension_unit’ ) ); ?></label>
      </div>
      <div>
      <?php
      echo $product_categories;
      ?>
      </div>
      </div>
      <?php endif;
      endif; ?>
      <?php $product_tags = wcmp_get_product_terms_HTML( ‘product_tag’, $post->ID, apply_filters( ‘wcmp_vendor_can_add_product_tag’, true, get_current_user_id() ), false ); ?>
      <?php if ( $product_tags ) : ?>
      <div>
      <div class=”panel-heading d-flex”>
      <label class=”control-label” for=”product_length”><?php printf( __( ‘Tags’, ‘dc-woocommerce-multi-vendor’ ), get_option( ‘woocommerce_dimension_unit’ ) ); ?></label>
      </div>
      <div class=”panel-body panel-content-padding form-group-wrapper”>
      <div class=”form-group”>
      <?php
      echo $product_tags;
      ?>
      </div>
      </div>
      </div>
      <?php endif; ?>
      <?php
      $custom_taxonomies = get_object_taxonomies( ‘product’, ‘objects’ );
      if( $custom_taxonomies ){
      foreach ( $custom_taxonomies as $taxonomy ) {
      if ( in_array( $taxonomy->name, array( ‘product_cat’, ‘product_tag’ ) ) ) continue;
      if ( $taxonomy->public && $taxonomy->show_ui && $taxonomy->meta_box_cb ) { ?>
      <div class=”panel panel-default pannel-outer-heading”>
      <div class=”panel-heading d-flex”>
      <h3 class=”pull-left”><?php echo $taxonomy->label; ?></h3>
      </div>
      <div class=”panel-body panel-content-padding form-group-wrapper”>
      <div class=”form-group”>
      <div class=”col-md-12″>
      <?php
      echo wcmp_get_product_terms_HTML( $taxonomy->name, $post->ID, apply_filters( ‘wcmp_vendor_can_add_’.$taxonomy->name, false, get_current_user_id() ) );
      ?>
      </div>
      </div>
      </div>
      </div>
      <?php }
      }
      }
      ?>
      <?php do_action( ‘after_wcmp_product_tags_metabox_panel’, $post->ID ); ?>
      </div>
      </div>
      </div>
      <div id=”product_images_container” class=”custom-panel” style=”border-left-width: 4px; margin-bottom: 38px;”>
      <label class=”control-label col-md-12 pt-0″ for=”product_short_description” style=”font-size: 18px;”><?php _e( ‘Artwork gallery’, ‘dc-woocommerce-multi-vendor’ );?></label>

      <div class=”left-primary-info” style=”float: left;”>
      <div class=”featured-img upload_image”><?php $featured_img = isset($_POST[‘featured_img’]) ? wc_clean($_POST[‘featured_img’]) : ($product_object->get_image_id( ‘edit’ ) ? $product_object->get_image_id( ‘edit’ ) : ”); ?>
      ” <?php echo current_user_can( ‘upload_files’ ) ? ” : ‘data-nocaps=”true” ‘; ?>data-title=”<?php esc_attr_e( ‘Product image’, ‘dc-woocommerce-multi-vendor’ ); ?>” data-button=”<?php esc_attr_e( ‘Set product image’, ‘dc-woocommerce-multi-vendor’ ); ?>” rel=”<?php echo esc_attr( $post->ID ); ?>”>
      <div class=”upload-placeholder pos-middle”>
      <i class=”wcmp-font ico-image-icon”></i>
      <p><?php _e( ‘Fetured/Cover Image’, ‘dc-woocommerce-multi-vendor’ );?></p>
      </div>
      ” />
      <input type=”hidden” name=”featured_img” class=”upload_image_id” value=”<?php echo esc_attr( $featured_img ); ?>” />

      </div>
      </div>
      <div class=”right-primary-info” style=”float: right;padding-left: 24px;”>
      <ul class=”product_images”>
      <?php
      if ( metadata_exists( ‘post’, $post->ID, ‘_product_image_gallery’ ) ) {
      $product_image_gallery = get_post_meta( $post->ID, ‘_product_image_gallery’, true );
      } else {
      // Backwards compatibility.
      $attachment_ids = get_posts( ‘post_parent=’ . $post->ID . ‘&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image&fields=ids&meta_key=_woocommerce_exclude_image&meta_value=0’ );
      $attachment_ids = array_diff( $attachment_ids, array( get_post_thumbnail_id() ) );
      $product_image_gallery = isset($_POST[‘product_image_gallery’]) ? wc_clean($_POST[‘product_image_gallery’]) : implode( ‘,’, $attachment_ids );
      }

      $attachments = array_filter( explode( ‘,’, $product_image_gallery ) );
      $update_meta = false;
      $updated_gallery_ids = array();

      if ( ! empty( $attachments ) ) {
      foreach ( $attachments as $attachment_id ) {
      $attachment = wp_get_attachment_image( $attachment_id, ‘thumbnail’ );

      // if attachment is empty skip
      if ( empty( $attachment ) ) {
      $update_meta = true;
      continue;
      }

      echo ‘<li class=”image” data-attachment_id=”‘ . esc_attr( $attachment_id ) . ‘”>
      ‘ . $attachment . ‘
      <ul class=”actions”>

    • ‘ . __( ‘Delete’, ‘dc-woocommerce-multi-vendor’ ) . ‘
    • ‘;

      // rebuild ids to be saved
      $updated_gallery_ids[] = $attachment_id;
      }

      // need to update product meta to set new gallery ids
      if ( $update_meta ) {
      update_post_meta( $post->ID, ‘_product_image_gallery’, implode( ‘,’, $updated_gallery_ids ) );
      }
      }
      ?>

      <input type=”hidden” id=”product_image_gallery” name=”product_image_gallery” value=”<?php echo esc_attr( $product_image_gallery ); ?>” />
      <p class=”add_product_images”>
      data-choose=”<?php esc_attr_e( ‘Add images to product gallery’, ‘dc-woocommerce-multi-vendor’ ); ?>” data-update=”<?php esc_attr_e( ‘Add to gallery’, ‘dc-woocommerce-multi-vendor’ ); ?>” data-delete=”<?php esc_attr_e( ‘Delete image’, ‘dc-woocommerce-multi-vendor’ ); ?>” data-text=”<?php esc_attr_e( ‘Delete’, ‘dc-woocommerce-multi-vendor’ ); ?>”><?php _e( ‘Add artwork gallery images (Atlest 3 images)’, ‘dc-woocommerce-multi-vendor’ ); ?>
      </p>
      <p class=”add_product_images”>You can seclect multiple images by holing Ctrl (on Windows) or Control (on Mac) button.</p>
      </div>
      </div>

      <div class=”product-primary-info custom-panel” style=”border-left-width: 4px;margin-bottom: 38px;”>

      <label class=”control-label col-md-12 pt-0″ for=”product_short_description” style=”font-size: 18px;”><?php esc_html_e( ‘Artwork short description’, ‘dc-woocommerce-multi-vendor’ ); ?></label>
      <div class=”col-md-12″>
      <p class=”add_product_images”>Enter Artworks details in short (3-4 sentences)</p>
      <?php
      $settings = array(
      ‘textarea_name’ => ‘product_excerpt’,
      ‘textarea_rows’ => get_option(‘default_post_edit_rows’, 10),
      ‘quicktags’ => array( ‘buttons’ => ’em,strong,link’ ),
      ‘tinymce’ => array(
      ‘theme_advanced_buttons1’ => ‘bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator’,
      ‘theme_advanced_buttons2’ => ”,
      ),
      ‘editor_css’ => ‘<style>#wp-product_excerpt-editor-container .wp-editor-area{height:100px; width:100%;}</style>’,
      );
      if( !apply_filters( ‘wcmp_vendor_product_excerpt_richedit’, true ) ) {
      $settings[‘tinymce’] = $settings[‘quicktags’] = $settings[‘media_buttons’] = false;
      }
      $settings[‘tinymce’] = $settings[‘quicktags’] = $settings[‘media_buttons’] = false;
      wp_editor( htmlspecialchars_decode( isset($_POST[‘product_excerpt’]) ? wc_clean($_POST[‘product_excerpt’]) : $product_object->get_short_description( ‘edit’ ) ), ‘product_excerpt’, $settings );
      ?>
      </div>
      </div>

      <div class=”product-primary-info custom-panel” style=”border-left-width: 4px;”>

      <label class=”control-label col-md-12 pt-0″ for=”product_description” style=”font-size: 18px;”><?php esc_attr_e( ‘Artwork description in details’, ‘dc-woocommerce-multi-vendor’ ); ?></label>

      <div class=”col-md-12″>
      <p class=”add_product_images”>Enter Artworks details (No limit)</p>
      <?php
      $settings = array(
      ‘textarea_name’ => ‘product_description’,
      ‘textarea_rows’ => get_option(‘default_post_edit_rows’, 10),
      ‘quicktags’ => array( ‘buttons’ => ’em,strong,link’ ),
      ‘tinymce’ => array(
      ‘theme_advanced_buttons1’ => ‘bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator’,
      ‘theme_advanced_buttons2’ => ”,
      ),
      ‘editor_css’ => ‘<style>#wp-product_description-editor-container .wp-editor-area{height:225px; width:100%;}</style>’,
      );
      if( !apply_filters( ‘wcmp_vendor_product_description_richedit’, true ) ) {
      $settings[‘tinymce’] = $settings[‘quicktags’] = $settings[‘media_buttons’] = false;
      }
      $settings[‘tinymce’] = $settings[‘quicktags’] = $settings[‘media_buttons’] = false;
      wp_editor( $product_object->get_description( ‘edit’ ), ‘product_description’, $settings );
      ?>
      </div>
      </div>
      <?php do_action(‘wcmp_product_manager_right_panel_after’, $post->ID); ?>
      </div>
      </div>
      <div class=”row”>
      <div class=”col-md-12″>
      <?php do_action( ‘wcmp_after_product_excerpt_metabox_panel’, $post->ID ); ?>
      <?php do_action( ‘wcmp_afm_after_product_excerpt_metabox_panel’, $post->ID ); ?>

      <?php
      do_action( ‘wcmp_before_product_note_metabox_panel’, $post->ID );
      $vendor = get_wcmp_vendor(get_current_user_id() );
      $notes = WCMp_Product::get_product_note($post->ID);
      ?>
      <?php if($post->post_status == ‘pending’) { ?>
      <div class=”panel panel-default pannel-outer-heading order-action”>
      <div class=”panel-heading d-flex”>
      <?php esc_html_e( ‘Rejection Note’, ‘dc-woocommerce-multi-vendor’ ); ?>
      </div>
      <div class=”panel-body panel-content-padding form-group-wrapper”>
      <ul class=”order_notes list-group mb-0″>
      <li class=”list-group-item list-group-item-action flex-column align-items-start add_note”>
      <?php if (apply_filters(‘is_vendor_can_add_product_notes’, true, $vendor->id)) : ?>
      <!– <form method=”post” name=”add_product_comment”> –>
      <?php wp_nonce_field(‘dc-vendor-add-product-comment’, ‘vendor_add_product_nonce’); ?>
      <h3><?php _e( ‘Add note’, ‘dc-woocommerce-multi-vendor’ ); ?> <span class=”img_tip” data-desc=”<?php echo __( ‘Add a note for your reference, or add a customer note (the user will be notified).’, ‘dc-woocommerce-multi-vendor’ ); ?>”></span></h3>
      <div class=”form-group”>
      <textarea placeholder=”<?php _e(‘Enter text …’, ‘dc-woocommerce-multi-vendor’); ?>” class=”form-control” name=”product_comment_text”></textarea>
      </div>
      <div class=”form-group”>
      <input class=”btn btn-default wcmp-add-order-note” type=”submit” name=”wcmp_submit_product_comment” value=”<?php _e(‘Submit’, ‘dc-woocommerce-multi-vendor’); ?>”>
      </div>
      <input type=”hidden” name=”product_id” value=”<?php echo $post->ID; ?>”>
      <input type=”hidden” name=”current_user_id” value=”<?php echo $vendor->id; ?>”>
      <!– </form> –>
      <?php endif; ?>

      <li class=”list-group-item list-group-item-action flex-column align-items-start”><div class=”form-group”><h3><?php esc_html_e( ‘Communication Log’, ‘dc-woocommerce-multi-vendor’ ); ?></h3></div>
      <?php
      if ($notes) {
      foreach ($notes as $note) {
      $author = get_comment_meta( $note->comment_ID, ‘_author_id’, true );
      $Seller = is_user_wcmp_vendor($author) ? “(Seller)” : ”;
      ?>
      <li class=”list-group-item list-group-item-action flex-column align-items-start order-notes”>
      <p class=”order-note”><span><?php echo wptexturize( wp_kses_post( $note->comment_content ) ); ?></span></p>
      <p><?php echo esc_html($note->comment_author); ?><?php echo $Seller; ?> – <?php echo esc_html( date_i18n(wc_date_format() . ‘ ‘ . wc_time_format(), strtotime($note->comment_date) ) ); ?></p>

      <?php
      }
      }else{
      echo ‘<li class=”list-group-item list-group-item-action flex-column align-items-start order-notes”>’ . __( ‘There are no notes yet.’, ‘dc-woocommerce-multi-vendor’ ) . ‘‘;
      }
      ?>

      </div>
      </div>
      <?php do_action( ‘wcmp_after_product_note_metabox_panel’, $post->ID ); ?>
      <?php } ?>
      </div>
      </div>
      <?php if ( ! empty( wcmp_get_product_types() ) ) : ?>
      <div class=”wcmp-action-container”>
      <?php
      $primary_action = __( ‘Submit’, ‘dc-woocommerce-multi-vendor’ ); //default value
      if ( current_vendor_can( ‘publish_products’ ) ) {
      if ( ! empty( $product_object->get_id() ) && get_post_status( $product_object->get_id() ) === ‘publish’ ) {
      $primary_action = __( ‘Update’, ‘dc-woocommerce-multi-vendor’ );
      } else {
      $primary_action = __( ‘Publish’, ‘dc-woocommerce-multi-vendor’ );
      }
      }
      ?>
      <input type=”submit” class=”btn btn-default” name=”submit-data” value=”<?php echo esc_attr( $primary_action ); ?>” id=”wcmp_afm_product_submit” />
      <input type=”submit” class=”btn btn-default” name=”draft-data” value=”<?php esc_attr_e( ‘Draft’, ‘dc-woocommerce-multi-vendor’ ); ?>” id=”wcmp_afm_product_draft” />
      <input type=”hidden” name=”status” value=”<?php echo esc_attr( get_post_status( $post ) ); ?>”>
      <?php wp_nonce_field( ‘wcmp-product’, ‘wcmp_product_nonce’ ); ?>
      </div>
      <?php endif; ?>
      <?php do_action( ‘wcmp_add_product_form_end’ ); ?>
      </form>
      <?php do_action( ‘after_wcmp_add_product_form’ ); ?>
      </div>

  • #134556

    Hi, thanks for reaching out to us.
    As it is not possible for us to go through the entire code kindly let us know what changes you’ve made in the code.
    And also explain what do you want to change so that we can assist you further.

  • #134562
    cbshourov
    Participant

    thanks, I just managed to fix the problem.

    another thing is there a way to divide tax between admin and vendor,
    I have the site set to 65% vendor commission(admin fee), now is there a way to also divide the tax in 65% for vendor and 35% for admin?

  • #134567

    The default flow is such that either admin will bear the entire tax per product or vendor will bear the entire tax per product.
    To set this flow enable tax via admin dashboard, WCMp>Settings>Payments>Tax . (see screenshot- https://prnt.sc/26xuw8e )

    However if you want any other flow then you have to do custom code on your end.

  • #134568
    cbshourov
    Participant

    for custom code is it possible to do that by overwriting a template file as I did for the “edit product” page? which one?

    or if I need to modify other plugin files then what happens on plugin update?

    also, is it possible to provide me with the code that I need to change for this?

  • #134603

    @cbshourov, as this is payment-related changes, hence you have to use our hook/filter to add the modification.

    But I am afraid, we don’t have ready-made code for this change.

  • Viewing 7 reply threads
    • The topic ‘Invalid product status. error on product submit’ is closed to new replies.
    Shopping Cart
    Scroll to Top