Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › What is the hook
- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by Sarmistha Chakraborty.
- AuthorPosts
- March 5, 2020 at 9:09 am #110054MarsMarsParticipant
Hi
I want to activate an action one a vendor select a product to be added to his/her store
So what is the hook for add to my storeRegardd
- March 5, 2020 at 1:05 pm #110068Sarmistha ChakrabortyMember
Hello,
You can use this action
do_action( 'after_wcfmmp_product_multivendor_clone', $duplicate->get_id(), $product );
You can check this php file<wc-multivendor-marketplace>/core/class-wcfmmp-product-multivendor.php
function name: wcfmmp_product_multivendor_cloneThanks.
- March 5, 2020 at 1:53 pm #110075MarsMarsParticipant
thanks..
but seems its not working.. or I am doing something wrongdo_action( 'after_wcfmmp_product_multivendor_clone','doSomeThing' ); function doSomeThing() { alert("I am an alert box!"); }
- March 5, 2020 at 2:56 pm #110079Sarmistha ChakrabortyMember
Hi,
Please go through the function “wcfmmp_product_multivendor_clone”. The action “after_wcfmmp_product_multivendor_clone” is a php code which we provide you.
If you want add some javascript, then add below script in your “js” file –jQuery(document).ready(function ($) { $('.wcfm_product_multivendor').click(function(event) { alert("I am an alert box!"); }); });
Thanks.
- March 5, 2020 at 11:25 pm #110144MarsMarsParticipant
thanks for help
this is wasnt the error
the error was I should use add_action not do_action - March 6, 2020 at 11:51 am #110218Sarmistha ChakrabortyMember
Hello,
You have to write,
add_action( 'after_wcfmmp_product_multivendor_clone','doSomeThing',10 ,2 ); function doSomeThing($duplicate_id, $product) { //add your php code here }
Ref: https://developer.wordpress.org/reference/functions/do_action/
Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.