parent
f3762d9ed5
commit
be9b7bd4b5
|
@ -713,6 +713,12 @@ class WC_Form_Handler {
|
|||
$missing_attributes = array();
|
||||
$variations = array();
|
||||
$attributes = $adding_to_cart->get_attributes();
|
||||
|
||||
// If no variation ID is set, attempt to get a variation ID from posted attributes.
|
||||
if ( empty( $variation_id ) ) {
|
||||
$variation_id = $adding_to_cart->get_matching_variation( wp_unslash( $_POST ) );
|
||||
}
|
||||
|
||||
$variation = wc_get_product( $variation_id );
|
||||
|
||||
// Verify all attributes
|
||||
|
|
|
@ -560,7 +560,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns an array of date for a variation. Used in the add to cart form.
|
||||
* Returns an array of data for a variation. Used in the add to cart form.
|
||||
* @since 2.4.0
|
||||
* @param WC_Product $variation Variation product object or ID
|
||||
* @return array
|
||||
|
|
Loading…
Reference in New Issue