commercepundit
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [WooCommerce Sample] Selecting Sample shows full priceI have also faced same issue. And Below codes solve my issue.
Please put this in theme functions.phpadd_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 9 years ago by bdbrown.
Thanks @drake2k for the honest feedback.
Thanks @drake2k for using the plugin and providing us honest feedback. Well I agree that Google captcha is bit complicated but on the same time it is secure and simpler than regular captcha we have.
We shall definitely work on the feedback you have provided and improve the overall experience of the plugin.Now We have fixed that Login will work perfectly even captcha is enabled or disabled.
Viewing 2 replies - 1 through 2 (of 2 total)