×

Ichitux

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: How to multiply the price in "bookings" #894
    Ichitux
    Participant

    Hello,

    My idea is more or less this one:

    function price_discount_by_id( $price ){
    $my_product_id = YYY;
    $product = wc_get_product( $my_product_id );

    if ( $product === $my_product_id ) {
    return $price*0.15;
    }
    return $price
    }
    add_filter( ‘woocommerce_product_get_price’, ‘price_discount_by_id’, 10, 2 );

    I don’t know if it really works but i need to know the “YYY” ID to set manually a discount price only for one variation ID or what i ment one product built by your plugin had a 15% discount.

    Kind regards.

    in reply to: How to multiply the price in "bookings" #889
    Ichitux
    Participant

    Hello,

    Thanks for your reply, i’m trying to do this by myself.
    Is there any way to identify the “product ids” for this variations? I mean, If i create a WooCommerce product variation it has its own IDs for Product and for Variations.
    Then, can i get the Product building ids somehow?

    Then with this IDs i can do some function filter/hook to reproduce my ideas.

    I look forward to hear from you

    Kind regards.

Viewing 2 posts - 1 through 2 (of 2 total)