Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Duplicate product button in the "Edit Product" screen
- This topic has 5 replies, 2 voices, and was last updated 5 years, 7 months ago by WCFM Forum.
- AuthorPosts
- May 8, 2019 at 9:09 am #61139productsexportParticipant
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. - May 10, 2019 at 3:24 pm #61661WCFM ForumMember
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
- May 11, 2019 at 7:07 am #61802productsexportParticipant
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
- May 11, 2019 at 7:17 am #61803productsexportParticipant
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. - May 11, 2019 at 8:07 am #61805productsexportParticipant
Ok, the code above works now. Thank you very much. You are so helpful.
- May 12, 2019 at 10:04 am #61907WCFM ForumMember
Great … you are welcome 🙂
- AuthorPosts
- The topic ‘Duplicate product button in the "Edit Product" screen’ is closed to new replies.