Duplicate product button in the "Edit Product" screen

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 – Feature Request Duplicate product button in the "Edit Product" screen

Viewing 5 reply threads
  • Author
    Posts
    • #61139
      productsexport
      Participant

      Can you please add “Duplicate Product” button in the “Edit Product” screen? put it beside the “Add New” button.

      For example this would be extremely handy for vendors who have similar products with slight variation. Once they add a product and submit it, then when the screen refreshes, they can just click on “Duplicate Product” and make another copy. They can edit the copy and submit it, then make another copy. This will save time and make it faster to add products

      Attachments:
      You must be logged in to view attached files.
    • #61661
      WCFM Forum
      Member

      Hi,

      Please add this code to your child theme’s functions.php for the purpose –

      add_action( 'after_wcfm_products_manage_action', function() {
      	global $wp;
      	if( isset( $wp->query_vars['wcfm-products-manage'] ) && !empty( $wp->query_vars['wcfm-products-manage'] ) ) {
      		echo '<a id="wcfm_product_duplicate" class="wcfm_product_duplicate add_new_wcfm_ele_dashboard text_tip" href="#" data-proid="'. $wp->query_vars['wcfm-products-manage'] .'" data-tip="' . __('Duplicate Product', 'wc-frontend-manager') . '"><span class="wcfmfa fa-copy"></span><span class="text">' . __( 'Duplicate Product', 'wc-frontend-manager') . '</span></a>';
      		?>
      		<script>
      		jQuery(document).ready(function($) {
      			$('#wcfm_product_duplicate').click(function(event) {
      				event.preventDefault();
      				jQuery('#wcfm_products_manage_form').block({
      					message: null,
      					overlayCSS: {
      						background: '#fff',
      						opacity: 0.6
      					}
      				});
      				var data = {
      					action : 'wcfmu_duplicate_product',
      					proid : $(this).data('proid')
      				}	
      				jQuery.ajax({
      					type:		'POST',
      					url: wcfm_params.ajax_url,
      					data: data,
      					success:	function(response) {
      						if(response) {
      							$response_json = $.parseJSON(response);
      							if($response_json.status) {
      								if( $response_json.redirect ) window.location = $response_json.redirect;	
      							}
      						}
      					}
      				});
      				return false;
      			});
      		});
      		</script>
      		<?php
      	}
      }, 50 );

      Thank You

    • #61802
      productsexport
      Participant

      Thank you for your efforts… Sorry this code did not work. No button appeared… Can you please look into it and add this feature… It is really good to have

    • #61803
      productsexport
      Participant

      You can add the “Duplicate” button new “Add New” or near “View” “Draft” “Submit” buttons.

      Attachments:
      You must be logged in to view attached files.
    • #61805
      productsexport
      Participant

      Ok, the code above works now. Thank you very much. You are so helpful.

    • #61907
      WCFM Forum
      Member

      Great … you are welcome 🙂

Viewing 5 reply threads
  • The topic ‘Duplicate product button in the "Edit Product" screen’ is closed to new replies.