price

Hide Price based on product category in Woocommerce

蓝咒 提交于 2020-08-07 07:15:42
问题 In Woocommerce I am trying to hide the product on the archive page and single product page based on category however the condition does not appear to work and just hide all the price whether I set the category or not add_filter( 'woocommerce_variable_sale_price_html', 'woocommerce_remove_prices', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'woocommerce_remove_prices', 10, 2 ); add_filter( 'woocommerce_get_price_html', 'woocommerce_remove_prices', 10, 2 ); function woocommerce

Hide Price based on product category in Woocommerce

六月ゝ 毕业季﹏ 提交于 2020-08-07 07:14:29
问题 In Woocommerce I am trying to hide the product on the archive page and single product page based on category however the condition does not appear to work and just hide all the price whether I set the category or not add_filter( 'woocommerce_variable_sale_price_html', 'woocommerce_remove_prices', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'woocommerce_remove_prices', 10, 2 ); add_filter( 'woocommerce_get_price_html', 'woocommerce_remove_prices', 10, 2 ); function woocommerce

Hide products with zero or empty price from Woocommerce archives pages

折月煮酒 提交于 2020-07-19 11:12:50
问题 I am setting wholesale store with Woocommerce and can't figure out following issue. I want to auto hide or delate all products, that have price set to zero or if product don't have price at all! I surf the web and found following code that should do exactly what i need, but i put it in my child theme functions.php file and it is not working for me! Hide products with the price set to zero in WooCommerce add_action( 'woocommerce_product_query', 'react2wp_hide_products_higher_than_zero' );

Get the regular price of variable product in Woocommerce

纵饮孤独 提交于 2020-07-18 06:17:05
问题 I found a lot of answers, but none works for a variable products. I would like to display both, sales price and regular price for variable products. global $product; if( $product->is_on_sale() ) { $sale_price = $product->get_sale_price(); } $regular_price = $product->get_regular_price(); This is working, but only if it is a normal product. I think there must be a possibility even for product variations, but I don't find it. Any help is appreciated 回答1: For prices in variable products you need

Price for simultaneous database connection in firebase

半世苍凉 提交于 2020-06-29 04:22:09
问题 document on homepage says only 200,000 per database. but what is it? how much would they charge me. hen simultaneous connection occurs 100,000? no mention for simultaneous connection on calculator. 回答1: While there are limits to the number of simultaneous connections that are allowed to each Firebase Realtime Database instance, there is no charge for this number of concurrent connections. Charges are only based on the amount of data stored, and the amount of data that is downloaded out of the

Display product prices with a shortcode by product ID in WooCommerce

落爺英雄遲暮 提交于 2020-06-25 04:16:46
问题 IN WooCommerce I am using the code of this tread to display with a short code the product prices from a defined product ID. But it don't really do what I want. Here is that code: function so_30165014_price_shortcode_callback( $atts ) { $atts = shortcode_atts( array( 'id' => null, ), $atts, 'bartag' ); $html = ''; if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ $_product = wc_get_product( $atts['id'] ); $number = number_format($_product->get_price(), 2, '.', ','); $html

Update product price using a hook in Woocommerce

给你一囗甜甜゛ 提交于 2020-05-26 09:43:26
问题 I am trying to update the the product regular price using the meta key _regular_price with an integer or string when the product is updated in the wp-admin. My desired user-flow is: Open the product edit page Click the update button See that the _regular_price is set to 20 after the page has reloaded. add_action( 'woocommerce_process_product_meta', 'update_test' ); function update_test( $post_id ) { update_post_meta( $post_id, '_regular_price', 20 ); } Please help me find what I'm doing wrong

Disable Woocommerce cart line item quantity price calculation

◇◆丶佛笑我妖孽 提交于 2020-05-14 11:04:32
问题 I am looking for function that can disable the quantity x item price in the cart page. Normally if product price is €1 and quantity is 3 | Line item subtotal is €3 … (1€ x 3) . Now I Would like to keep the product price without x quantity calculation like this: Product price is €1 and quantity is 3 | Line item subtotal is €1 Does anybody a idea how to disable this quantity price calculation? 回答1: Yes it's possible to disable the quantity item prices calculation, but it's quite complicated…

Hide product price and disable add to cart for specific product categories in Woocommerce

谁都会走 提交于 2020-05-13 07:06:43
问题 I'm looking for the right code that hides the prices for some specific categories in Woocommerce. I already have the code to hide the prices on de single product page: add_action( 'wp', 'remove_prices_based_on_category' ); function remove_prices_based_on_category() { // On product single pages if ( is_product() ) { remove_product_price( get_the_ID() ); } } function return_custom_price( $price, $instance ) { $price = '<span style="color:red; font-size:12px;">Call our office <strong>516.695

Hide product price and disable add to cart for specific product categories in Woocommerce

£可爱£侵袭症+ 提交于 2020-05-13 07:05:35
问题 I'm looking for the right code that hides the prices for some specific categories in Woocommerce. I already have the code to hide the prices on de single product page: add_action( 'wp', 'remove_prices_based_on_category' ); function remove_prices_based_on_category() { // On product single pages if ( is_product() ) { remove_product_price( get_the_ID() ); } } function return_custom_price( $price, $instance ) { $price = '<span style="color:red; font-size:12px;">Call our office <strong>516.695