post custom data when fetching a variation via ajax

Sometimes it is needed to add "context" to a variations ajax request, in order modify the returned object content. For instance, in cases where the variation is part of a bundled variable product, we may need to modify the price, stock status or the description of the variation according to the "context".
This commit is contained in:
Manos Psychogyiopoulos 2016-07-07 11:16:46 +03:00
parent 1ff19a31b1
commit 982e2011a6
1 changed files with 2 additions and 1 deletions

View File

@ -116,7 +116,8 @@
if ( all_attributes_chosen ) {
// Get a matchihng variation via ajax
data.product_id = $product_id;
data.product_id = $product_id;
data.custom_data = $form.data( 'custom_data' );
$( '.variations_form' ).block({
message: null,