Change Price by Product id

Home – SaaS Forums Presale questions Woo Price Calculator Change Price by Product id

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4641
    Anonymous
    Guest

    Hello, I tried to change a product price according to the code in this link https://altoswebsolutions.com/documentation/14-1-1-change-the-price and also add a condition to it, but it seems it doesn’t work, nothing happens! any help? Thanks in advance!

    add_filter(‘woo_price_calculator_calculate_price’, ‘cmw_custom_price’, 10, 4);

    function cmw_custom_price($price, $product_id, $calculator_id, $data){

    if($product_id==36) { $price=100;}

    else{$price = $price*5;}

    return $price;
    }

    #4642
    Enrico
    Participant

    Hi Mostafa,

    Your code is working ok in my test environment so it could be something related to your theme, plugin, etc.

    Could you please send your WP-admin and your FTP password to “https://altoswebsolutions.com/contact-us”?

    Please remember to add the link of this page in your email.

    Kind Regards,
    Enrico
    AT263

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