Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter rwilliam125

    (@rwilliam125)

    1) Group simple product links display in group product detail page. but we set group simple product Visibility to Hidden

    We create Group simple product with visibility to hidden but the product link display in main group product detail page

    we found bug in you woocommerce\templates\single-product\add-to-cart\grouped.php
    Plugin code

    <label for="product-<?php echo $grouped_product->get_id(); ?>">
    								<?php echo $product->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', get_permalink(), $grouped_product->get_id() ) ) . '">' . get_the_title() . '</a>' : get_the_title(); ?>
    </label>

    ERROR In $product->is_visible()
    IF change with $product->is_visible() to $grouped_product->is_visible() then it working fine

    2) Sale label is not display in shop page and product detail page for group product

    yes we agree with you we but Sale label is display on main group product am i right ?

    we found bug in you woocommerce\includes\class-wc-product-grouped.php
    Plugin code

    public function is_on_sale( $context = 'view' ) {
    		global $wpdb;
    
    		$on_sale = $this->get_children() && 1 === $wpdb->get_var( "SELECT 1 FROM $wpdb->postmeta WHERE meta_key = '_sale_price' AND meta_value > 0 AND post_id IN (" . implode( ',', array_map( 'esc_sql', $this->get_children() ) ) . ");" );
    
    		return 'view' === $context ? apply_filters( 'woocommerce_product_is_on_sale', $on_sale, $this ) : $on_sale;
    	}

    it always return 0

Viewing 1 replies (of 1 total)