Total : 0.00 €

Before contacting us, please make sure to check our F.A.Q

Please, login or register to our website in order to be able to post a presale question in the forum.

Change Price by Product id

More
7 months 3 weeks ago - 7 months 3 weeks ago #1376 by Enrico
Enrico replied the topic: Change Price by Product id
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 " altoswebsolutions.com/contact-us "?

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

Kind Regards,
Enrico
AT263
Last Edit: 7 months 3 weeks ago by Enrico.

Please Log in or Create an account to join the conversation.

  • Mostafa
  • Mostafa's Avatar Topic Author
7 months 3 weeks ago #1372 by Mostafa
Mostafa created the topic: Change Price by Product id
Hello, I tried to change a product price according to the code in this link 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;
}

Please Log in or Create an account to join the conversation.

Moderators: david
Time to create page: 0.167 seconds

Cart

Total : 0.00 €