price

Show Price Suffix only on all WooCommerce Product loops

强颜欢笑 提交于 2021-02-04 07:50:56
问题 I have an online shop with WooCommerce. I want to show a custom price Suffix only on the Product List Page (like Shop Page), where all products are listed. I have the following code: add_filter( 'woocommerce_get_price_html', 'custom_price_suffix', 100, 2 ); function custom_price_suffix( $price, $product ){ $price = $price . ' Suffix '; return apply_filters( 'woocommerce_get_price', $price ); } But with this code, the suffix is display in the Product list Page and on single Products. Can

How to get WooCommerce variation prices to have two decimals (trailing zero)?

风流意气都作罢 提交于 2021-01-29 06:23:19
问题 I have a product with variations, that is being displayed by the templates/single-product/add-to-cart/variation.php template, which uses JavaScript-based templates {{{ data.variation.display_price }}} . When I have price that end with a zero, for example, € 12.50, the price on the front-end will be displayed as € 12.5 (without the zero). I want to have the price include the trailing zero. I've tried the following filter, but it does not work. add_filter( 'woocommerce_price_trim_zeros', 'wc

Combine discounted shipping cost with discounted cart items prices in WooCommerce

佐手、 提交于 2021-01-29 00:39:41
问题 I need some help to combine custom shipping cost with discounted cart item prices in WooCommerce. In the below code, the first function is responsible for adding a 50% discount depending on the selected delivery option and the 2nd one is responsible for calculating a 50% discount for each item in the basket, except for specific category (and its subcategories). I would like to make sure when a customer chooses "Pickup" delivery to display "-50%" of discount that is added only for goods not

Combine discounted shipping cost with discounted cart items prices in WooCommerce

久未见 提交于 2021-01-29 00:39:00
问题 I need some help to combine custom shipping cost with discounted cart item prices in WooCommerce. In the below code, the first function is responsible for adding a 50% discount depending on the selected delivery option and the 2nd one is responsible for calculating a 50% discount for each item in the basket, except for specific category (and its subcategories). I would like to make sure when a customer chooses "Pickup" delivery to display "-50%" of discount that is added only for goods not

How can I round up the price in WooCommerce?

亡梦爱人 提交于 2021-01-28 18:25:10
问题 I'd like to know if there is a way to round up the prices in WooCommerce keeping 2 decimals displayed (so the price will end with the first and second decimal ,00). For example: €12,54 will be rounded to €13,00 and €145,67 will be rounded up to €146,00. I'm using a plugin to discount the product price i.e. €39,00 - 20% = €35,10 (it should became €36,00). I'd like to round up all the prices as explained before. Is there a way to do so? 回答1: You can't really round up globally all real

Display prefixed price and additional unit price in Woocommerce simple products

核能气质少年 提交于 2021-01-28 12:26:00
问题 Using Woocommerce I sell wine per box with 6 bottles in a box. So naturally I enter a price per box when setting up my product. I do however want the user to see the price per bottle as well. $120 / box $20 / bottle I tried using Display on shop pages the unit price and the wholesale price on product pages answer code. It does exactly what I want, except, it removes the original ( per box ) price. The edited snippet below display both the original $price and the unit $price as well as the

Woocommerce Variable Product Prices prefix

送分小仙女□ 提交于 2021-01-28 06:52:03
问题 Currently I'm using a this code/plugin to show prefix and lowest price the shop: function show_only_lowest_prices_in_woocommerce_variable_products_load_plugin_textdomain() { load_plugin_textdomain( 'show-only-lowest-prices-in-woocommerce-variable-products', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); } add_action( 'plugins_loaded', 'show_only_lowest_prices_in_woocommerce_variable_products_load_plugin_textdomain' ); //Simple products function wc_wc20_variation_price_format(

Hide displayed product prices from Woocommerce Product Add-ons Fields

╄→гoц情女王★ 提交于 2021-01-28 05:25:46
问题 In Woocommerce I am using Woocommerce Product Add-Ons plugin and I am trying to figure out how I can hide the prices from Add-ons fields. This is the current output with prices: This is the desired Output without prices (yellow underlined) : I figured out that the the select.php in product-addons/templates/addons/select.php could be the the solution I'm bad in php so i try to comment out some things ... if I comment out line 27 then I have the desired output, but the Price from the addons

Replace the price of the cart item with a custom field value in Woocommerce

岁酱吖の 提交于 2021-01-27 18:08:26
问题 In WooCommerce I am trying to replace the price of the cart items inwith a custom field price. This is my code: function custom_cart_items_price ( $cart_object ) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; foreach ( $cart_object->get_cart() as $cart_item ) { // get the product id (or the variation id) $id = $cart_item['data']->get_id(); // GET THE NEW PRICE (code to be replace by yours) $new_price = (int)get_post_meta( get_the_ID(), '_c_price_field', true ); // <== Add your code

Google cloud storage egress high cost, how can I reduce it?

一个人想着一个人 提交于 2021-01-04 05:38:51
问题 I have an android/ionic app running on 28 smart TVs. this app show in the TV images and videos like promotions and other informative banners, this images are stored in google cloud storage are 78 images with total size of 300mb. The app have the URL of the image and show it like a html web <img src="googlecloudimageurl"> Every 10 seconds the googlecloudimageurl changes to show the next image like a slide, every 10 seconds the image is downloaded from a Google Cloud Storage URL that is in the