Comments on: WooCommerce – update product price programmatically https://pluginrepublic.com/woocommerce-update-product-price-programmatically/ WooCommerce Plugins Mon, 14 Mar 2022 20:52:44 +0000 hourly 1 By: Edvin Uddfalk https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-175677 Mon, 14 Mar 2022 20:52:44 +0000 https://pluginrepublic.com/?p=6443#comment-175677 Hello, thanks for a good article. In my case I want to use addons to my main product that has a percentage price of both the main product + all addons added by the user. Is that possible? Trying to add percentage based price addons today will only result in showing the 10% cost of the main product, and the addons aren’t counted in the 10% prices.

Any ideas?

]]>
By: Gareth https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-94432 Mon, 18 May 2020 06:33:24 +0000 https://pluginrepublic.com/?p=6443#comment-94432 In reply to arash.

This method updates prices on the front end. Are you pulling in data remotely to the back end?

]]>
By: arash https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-94311 Sun, 17 May 2020 19:06:09 +0000 https://pluginrepublic.com/?p=6443#comment-94311 Hi @Gareth.Is That Possible to Update Product Price And In-Stock Status In WooCommerce DataBase?
We Read This Info From A Remote DataBase And Insert Into WooCommerce DataBase.
Thanks

]]>
By: Gareth https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-87729 Wed, 29 Apr 2020 10:16:27 +0000 https://pluginrepublic.com/?p=6443#comment-87729 In reply to André Gouveia.

Hi – yes, using the Add-Ons Ultimate plugin, you could set the product price to 0 then assign a flat rate price to the add-on field.

Thanks

Gareth

]]>
By: André Gouveia https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-87727 Wed, 29 Apr 2020 10:13:46 +0000 https://pluginrepublic.com/?p=6443#comment-87727 Hi,
Is it possible for a specific product that the price does not multiply by the quantity? I just want the quantity to appear but not multiply it in just one product.

Example: https://prnt.sc/s6uumo

Thanks.

]]>
By: Alvina https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-34120 Thu, 12 Sep 2019 15:00:32 +0000 https://pluginrepublic.com/?p=6443#comment-34120 I want to change the pricing on display. Can you give me any reference how to change product price on display as I have already gone through this tutorial https://www.cloudways.com/blog/change-woocommerce-price-display/ and having an error while running the code that I have mentioned below. Is there any alternative to do this?

function cw_change_product_price_display( $price ) {
$price .= ‘ At Each Item Product’;
return $price;
}
add_filter( ‘woocommerce_get_price_html’, ‘cw_change_product_price_display’ );
add_filter( ‘woocommerce_cart_item_price’, ‘cw_change_product_price_display’ );

]]>
By: Craig F https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-18866 Fri, 01 Feb 2019 15:32:37 +0000 https://pluginrepublic.com/?p=6443#comment-18866 So I ended up writing the code myself. This will display the warranty information inside the basket.

function display_warranty_option( $item_data, $cart_item ) {
if (!empty($cart_item[‘extended_warranty’])) {
$item_data[] = array(
‘key’ => ‘Extended Warranty’,
‘value’ => wc_clean($cart_item[‘extended_warranty’]),
‘display’ => ‘Extended warranty included.’,
);
}

return $item_data;
}

add_filter(‘woocommerce_get_item_data’, ‘display_warranty_option’, 10, 2);

]]>
By: Craig F https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-18829 Thu, 31 Jan 2019 15:12:23 +0000 https://pluginrepublic.com/?p=6443#comment-18829 The code works perfectly thanks. If a customer ticks the warranty box, how would I get that to display in the basket? The new price displays correctly but I’d like to display “Extended Warranty – £250” to my item description in the basket/checkout.

]]>
By: Rick https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-13559 Thu, 18 Oct 2018 16:41:56 +0000 https://pluginrepublic.com/?p=6443#comment-13559 Thank you!!!!

]]>
By: Gareth https://pluginrepublic.com/woocommerce-update-product-price-programmatically/#comment-13547 Thu, 18 Oct 2018 08:46:05 +0000 https://pluginrepublic.com/?p=6443#comment-13547 In reply to Rick.

You’re absolutely right. I’ve updated the article to filter the Add to Cart buttons on archive pages.

]]>