Support » Plugin: Food Menu – WooCommerce Food Ordering – Restaurant Reservation » shortcode tab include draft products & variatopn products wrongly displayed

  • Resolved kapilaya

    (@kapilaya)


    Hello friends, two issues, Just to let you know bc I could fix them by changing briefly your code:
    1- the tab shortcode does not filter draft products, this is a problem bc you have to send to trash to avoid product is displayed. I could fixed adding the code: $args['post_status'] = 'publish';
    before line539: return wc_get_products($args);, in wpc-utilities.php.

    2.- Variable products without price changing wrongly displayed: ie: $20-00-$. I could fixed replacing the code in hook.php line 196 (inside conditional if (is_array($variation_price) && isset($variation_price['price'])) { code replaced }:

    $first = array_shift($variation_price['price']);
    $array_pop = array_pop($variation_price['price']);
    $last = ( !empty( $array_pop ) ) ?  "-" . get_woocommerce_currency_symbol() . $array_pop : '';
    $var_price = get_woocommerce_currency_symbol() . $first . $last ;

    which prevents displaying the “-$” if array_pop($variation_price[‘price’]) is empty.

    Now, I have to re-change after every update. It would be great if you could fix them for next versions.

    great plugin many thanks friends

    Eduardo

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.