I’m having the same issue. The plugin is great but the price shown in cart is not correct.
I’m happy to pay if someone is able to fix it asap.
Same here. Downgraded WordPress to 4.6.5 and also woo commerce down to 3.0.0 and it shows the full price in the cart?
HELP!
I am experiencing the same issue after updating to Woocommerce 3.0.4
Same problem for me π
Does anyone got an answer or some idea ?
I’ve tryed to debug woocommerce-sample.php but found nothing, sample_price variable seems not to be send in the cart, whatever I try, even filling it manualy or using a free sample option…
@desfab, I went on your site designerfabricstore.co.uk and saw you seem to have solved the problem, any help ?
The Git repo for the plugin is here with 3 contributors, if that is any use:
https://github.com/isikom/woocommerce-sample
-
This reply was modified 9 years ago by
userland.
Thanks @userland, I’ve tried to ask my question there, we’ll see…
Hi delacour,
I actually had to revert to the old version of woo commerce as I couldn’t fix it. I am in a bit of fix actually as I go on maternity leave very soon so at present will be leaving the site without a major woo commerce update. Any ideas on the issue?
Many thanks,
Becks
No ideas yet, anyway thanks for you contribution, leading me to the idea that a downgrade restoration is needed…
I have been trying to debug the code and have gotten to far. If I fine a solution, I will post something.
Hi guys just thought I would chime into this, I have been trying to come up with a solution to this with no luck. I even found the “Zauker” developer on Linkedin and messaged him regarding this, I got an initial response but once I told him about the issue with his plugin the message was read but ignored and no response sinceβ¦.. even after i offered to pay.
The issues is Woocommerces new product CLI that is used from 3.+ update so to continue using this plugin your woocommerce cannot be updated to version 3.0 or above.
Hope someone can come up with a fix or easy alternative
Does someone tested the sample plugin with the latest woocommerce 3.0.6 update ? Anything encouraging somewhere ?
I have given up, trying to debug the code and begun dissecting it by using the existing foundation to provide a solution. As soon as I come up with something, I will post what I have and maybe we all can build on it. However, I am new to PHP, but making good progress. I have a client whose site I need to lunch soon…
Does someone have tested an alternative plugin ? Maybe the solution is here π
I’m going to do some searches…
I have also faced same issue. And Below codes solve my issue.
Please put this in theme functions.php
add_action( 'woocommerce_before_calculate_totals','cp_add_custom_price', 10, 1);
function cp_add_custom_price( $cart_obj ) {
// This is necessary for WC 3.0+
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
foreach ( $cart_obj->get_cart() as $key => $value ) {
if($value['sample']){
$product_id = $value['product_id'];
$sample_price_mode = get_post_meta($product_id, 'sample_price_mode', true) ? get_post_meta($product_id, 'sample_price_mode', true) : 'default';
$sample_price = get_post_meta($product_id, 'sample_price', true) ? get_post_meta($product_id, 'sample_price', true) : 0;
if ($sample_price_mode === 'custom'){
$price = $sample_price;
}else if ($sample_price_mode === 'free'){
$price = 0;
}else{
$price = $value['data']->price;
}
$value['data']->set_price( $price );
}
}
}
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
Hope this helps you…
-
This reply was modified 9 years ago by
Jan Dembowski.
-
This reply was modified 8 years, 12 months ago by
bdbrown.