Please refer to TemplateMonster Support for any issues surrounding TemplateMonster/TemplateTuning Themes – thanks, Jigoshop Team

do_action(‘jigoshop_variable_product_table_data_save’ , $ID, $meta)


11 Jun, 2013 05:14 AM

I obviously didn’t understand the do_action() function.
But, still when I saw the following line

do_action(‘jigoshop_variable_product_table_data_save’ , $ID, $meta);

around line# 260 in jigoshop/admin/write-panels/product-types/variable.php,
I expected to find some kind of function with similar name with * variable_product_table_data_save*, but I couldn’t find it.

Am I wrong to expect to find this kind of function? or if any, where is it?

  1. Support Staff 2 Posted by Jeff on 11 Jun, 2013 08:09 PM

    Jeff's Avatar

    Yes, you are wrong to expect to find this kind of function. Jigoshop may have some of these ‘actions’ defined internally certainly, but not necessarily.

    With WordPress action hooks:…

    … you ARE expected to provide a function your self and add it to the WordPress Action Hook mechanism … and Jigoshop will call this function with the do_action that you have seen in the code.

    When saving variations, that action hook is passed the variation product ID and all it’s meta data. You need something like this in your plugin, or theme’s functions.php, depending on what you are doing:

    function my_variations_meta_save( $variation_id, $meta ) {
        // do something useful to each variation
        // if you bugger your variations ... do not come complaining to me  :)
    add_action( 'jigoshop_variable_product_table_data_save', 'my_variations_meta_save' );

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don’t have an account yet, we need to confirm you’re human and not a machine trying to post spam.