Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $posted_field_name = 'mnm_quantity';
- $child_item_quantity = ! empty( $_REQUEST[ $posted_field_name ] ) && ! empty( $_REQUEST[ $posted_field_name ][ $child_product_id ] ) ? intval( $_REQUEST[ $posted_field_name ][ $child_product_id ] ) : 0;
- // One more check for inputs that are not arrays. Ajax add to cart will frequently not handle array inputs well (esp in themes) so as a last resort let's check for a single string key: ie: "mnm_quantity[99]".
- if ( $child_item_quantity <= 0 ) {
- $posted_field_name .= '[' . $child_product_id . ']';
- $child_item_quantity = ! empty( $_REQUEST[ $posted_field_name ] ) ? intval( $_REQUEST[ $posted_field_name ] ) : 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement