woocommerce_get_price
-
Hi there,
Wondering if anyone can assist.
I have created the query below, to update the price (throughout the site)
Unfortunately it is updating the product price, but the cart is saying £0, as well as emails and everything else.
I am simply grabbing the price from another field (bespoke field) stored in the attribute > _wclsi_ls_obj
Now if I change web price to;
$webPrice = “100”;
It will show everything correctly.
However the code below must be working or it would not show the price on the product page.
> $webPrice = $postMeta->Prices->ItemPrice[2]->amount;
Any help/guidance really appreciated.
Will send you some beers if you want ??
function return_custom_price($price, $product) { global $post; $post_id = $post->ID; $postMeta = get_post_meta($post_id, '_wclsi_ls_obj', true); $webPrice = $postMeta->Prices->ItemPrice[2]->amount; return $webPrice; } add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘woocommerce_get_price’ is closed to new replies.