Woocommerce sale price update API call is not updating front-end - php

I have working WC shop. When I try to change the price to sale, I am using this code:
$prid = wc_get_product_id_by_sku('123456');
update_post_meta($prid,'_sale_price', 11.22);
update_post_meta($prid,'_price', 11.22);
This is a variable product.
So on the admin panel, it is showing that there is a sale price, but in the front-end I don't see it until I update the product by clicking the save button.
Why doesn't it show the sale price in the front-end before the save button is clicked?

Related

I want to add a feature in woocommerce cart were user can add margin and it should with total price of a procuct in woocommerce

Expected Result
I want a feature where user can add margin in a product price for which he is placing order in woocommerce cart or checkout page.

How can i add add percentage fees to the product page in Magento?

We have a drop-shipping business which we get products from our partner API as a searching results with original prices .
We want to add percentage fees "import duties, VAT , handling fee" immediately to the product price when the customer click on one of the results to open the product page .
so the customer see the final price including everything in the product page "not in the checkout page"
We are using Magento 1.9.2 .
Any solutions please :) ?

Magento 2 wrong product price in cart after removal of category discount

In Magento 2 I have created a custom module category discount. When active its working fine for product list, details and cart view page.
But when I remove this discount it shows the original price for list and details page which is correct but mini cart view shows me the discounted price which shouldn't be the case. However if I update the quantity then it's fine.
I don't want to click the update button in the mini cart view for the original price. I want to do this using an observer.

product special price changes in checkout page opencart

I am trying to add special price for my product in OpenCart 2.0.1.1 with custom theme. on first time it will show fine. but, When I click on add to cart button and trying to buy that product in checkout page special price is getting disappeared and it shows product MRP price, when I return to same product page special price is not shown, it only shows my MRP price.
You should assign a correct "Customer Group" when setting a special price for an item, if you delete this customer group later this special price will disappear.

Woocommerce - Add to Cart on Out of Stocks Items

i'm using Woocommerce for doing a ecommerce site and i need to get the option to Add to Cart even if the item is out of stock.
How can i achieve this ?
Thanks and have a nice day !
This can be done by:
Going to your dashboard -> WooCommerce -> Products -> Inventory -> Untick the "Out of Stock Visibility" checkbox.
Next go to the Products tab -> Edit product in question -> in the Product Data section click on the Inventory link and change the Allow Backorders? dropdown list to Allow or Allow, but notify customer.

Categories