• Resolved webgardengeek

    (@webgardengeek)


    Can one apply WooDiscount rules programmatically?

    e.g. if my code is:

    if (floor($product->get_price()) == $product->get_price()) {
    $products .= ‘<div class=”prod-price”>$’ . wc_get_product(get_the_ID())->get_price() . ‘.00</div>’;
    }
    else {
    $products .= ‘<div class=”prod-price”>$’ . $product->get_price() . ‘</div>’;
    }

    Is there a script I can call/run in the block that contains this code that will swap out the price with the price from the appropriate Woo Discount rule?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Apply Woo Discount Rules in a custom WooCommerce block?’ is closed to new replies.