Woocommerce Product page add on checkbox and price

Maybe this plugin will help: https://wordpress.org/plugins/woo-extra-product-options/ From what I understand, you need to add extra options to products. Variations are different versions of the same product (e.g., white or black). In the example you presented it looks like you want to add extra features to do product.

WooCommerce is_product_category() not working

is_product_category() – Check If Current Page is a Product Category Try this add_action( ‘woocommerce_single_product_summary’, ‘product_short_description_by_category’, 20 ); function product_short_description_by_category() { if( has_term( ‘cake-toppers’, ‘product_cat’ )){ echo ‘A cake topper’; } else{ echo ‘NOT CAKE TOPPER’; } }

Custom Woocommerce Product Query

Try this $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘product’, ‘meta_key’ => ‘var_confirmed_date’, ‘meta_type’ => ‘DATE’, ‘orderby’ => ‘meta_value_date’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘destination’, ‘field’ => ‘id’, ‘terms’ => array($t_id) ) ), ‘meta_query’ => array( array( ‘key’ => ‘var_confirmed_date’, ‘value’ => date(“Y-m-d”,time()), ‘compare’ => ‘>=’, ‘type’ => ‘DATE’, ), … Read more

WooCommerce display price before add to cart [closed]

The variable $product is undefined when your function runs, you need to access the object to call the method get_price_html(). One way to do it is to call the global variable: add_action( ‘woocommerce_before_add_to_cart_button’, ‘misha_before_add_to_cart_btn’ ); function misha_before_add_to_cart_btn(){ global $product; echo ‘<div class=”btn-price”>’.$product->get_price_html().'</div>’; }

How to retrieve a Menu Name by Menu Location with ACF fields

To retrieve the Menu Name: $menu_name = wp_get_nav_menu_name(“menu-products”); Then, using the menu name you can get data like the nav menu: $term = get_term_by(‘name’, $menu_name, ‘nav_menu’); And using the term taxonomy ID you can pull the ACF fields $menu_id = $term->term_taxonomy_id; $post_id = ‘term_’.$menu_id; $field = get_field(‘my_acf_field’, $post_id); To retrieve list of menu Items: $menu … Read more

Display WooCommerce product attribute on shop page

Just make a check, if you have any applications available, and if so – echo them. Here is an example: add_action( ‘woocommerce_after_shop_loop_item_title’, ‘display_applications_attribute’, 5 ); function display_applications_attribute() { global $product; $applications = $product->get_attribute(‘pa_applications’); if ( $applications ) { printf(‘<span class=”attribute-applications”>Applications: %1$s</span>’, $applications ); } }