Category : product-variations

Objective: add product to cart despite unselected variations, i.e. remove/disable the mandatory nature of variation fields. Issue: WooCommerce’s absolute requirement for all variations to be selected before adding to cart. Tried: filtering out/removing/disabling unselected variations before adding to cart using various hooks; woocommerce_before_calculate_totals, woocommerce_add_to_cart, woocommerce_add_cart_item, woocommerce_add_to_cart_validation I understand that this is how WooCommerce works and ..

Read more

I created one custom filed under product variations. Here is the code of the custom field in the functions.php file. // 1. Add custom field input @ Product Data > Variations > Single Variation add_action( ‘woocommerce_variation_options_pricing’, ‘bbloomer_add_custom_field_to_variations’, 10, 3 ); function bbloomer_add_custom_field_to_variations( $loop, $variation_data, $variation ) { woocommerce_wp_text_input( array( ‘id’ => ‘custom_field[‘ . $loop . ..

Read more

This is how, I add an admin custom field for product Variations: add_action( ‘woocommerce_variation_options_pricing’, ‘add_custom_field_to_variations’, 10, 3 ); function add_custom_field_to_variations( $loop, $variation_data, $variation ) { woocommerce_wp_text_input( array( ‘id’ => ‘custom_field[‘ . $loop . ‘]’, ‘class’ => ‘short’, ‘label’ => __( ‘Custom Field’, ‘woocommerce’ ), ‘value’ => get_post_meta( $variation->ID, ‘custom_field’, true ) ) ); } Save ..

Read more

I have this code that works perfect for the products that are in the two categories: <?php if (has_term(array(‘italian-easter-eu’, ‘italian-easter-us’), ‘product_cat’)) { ?> <div id="product-video-container">. …. </div> <?php } ?> All of them are simple products, except one that has two variations and only in that products the Div doesn’t show (as if it weren’t ..

Read more

Pass some WooCommerce product data to Contact Form 7 enquiry form above just "out of stock" form product data (product name and the variation attribute "Color") everything works. Thanks. but there is another form. The "all stock" product name and the variation attribute do not show "Color". [contact-form-7 id="12715" title="Soru Sor"] Can you prepare all ..

Read more

I have products with multiple attributes allowing for multiple dimensions of variations. I’d like to show the price difference in the dropdown, but it is not comparing the absolute minimum price, for each option. This is the code I am using: add_filter( ‘woocommerce_variation_option_name’,’display_price_in_variation_option_name’); function display_price_in_variation_option_name( $term ) { global $product; if ( empty( $term ) ..

Read more