wcfm-santa

Making Christmas merrier with our special gift! Enjoy upto 25% off on all WCFM Addons.

CLAIM OFFER
01Day 18Hr 09Min 25Sec

What is the hook

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!

Viewing 5 reply threads
  • Author
    Posts
    • #110054
      MarsMars
      Participant

      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 store

      Regardd

    • #110068

      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_clone

      Thanks.

    • #110075
      MarsMars
      Participant

      thanks..
      but seems its not working.. or I am doing something wrong

      do_action( 'after_wcfmmp_product_multivendor_clone','doSomeThing' );
      function doSomeThing()
      {
      
        alert("I am an alert box!"); 
      }
    • #110079

      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.

    • #110144
      MarsMars
      Participant

      thanks for help
      this is wasnt the error
      the error was I should use add_action not do_action

    • #110218

      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.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.