variations

WooCommerce: Get custom field from product variations and display it as a suffix to variation prices

﹥>﹥吖頭↗ 提交于 2021-02-05 07:51:34
问题 I'm trying to get a value from a custom numbers field on product variations, and show it as a suffix to variation prices along with custom text. I'm working from WooCommerce: Get custom field from product variations and display it on the “additional information area” Adding custom text to the variation price in Woocommerce This is what I have: // 1. Add custom field input @ Product Data > Variations > Single Variation add_action( 'woocommerce_variation_options_pricing', 'Add_bulk_price_to

Display the variations weight on a variable product page in Woocommerce?

若如初见. 提交于 2021-01-29 03:51:19
问题 When the user clicks on a product variant of a dropdown of my products' variants, I would like to also have the weight of each variant. How would I do this? I have been trying to do it like this, but it is not working: add_filter( 'woocommerce_get_price_html', 'wb_change_product_html' ); function wb_change_product_html( $price ) { global $product; $weight = $product->get_weight(); $price_html = '<span class="amount">' . $price . $weight . '</span>'; return $price_html; } 回答1: The following

Display the variations weight on a variable product page in Woocommerce?

巧了我就是萌 提交于 2021-01-29 03:50:44
问题 When the user clicks on a product variant of a dropdown of my products' variants, I would like to also have the weight of each variant. How would I do this? I have been trying to do it like this, but it is not working: add_filter( 'woocommerce_get_price_html', 'wb_change_product_html' ); function wb_change_product_html( $price ) { global $product; $weight = $product->get_weight(); $price_html = '<span class="amount">' . $price . $weight . '</span>'; return $price_html; } 回答1: The following

Replace the Variable Price range by the chosen variation price in WooCommerce 3

谁都会走 提交于 2021-01-24 11:33:52
问题 On WooCommerce I would like to change the Variable single product page layout. Because, when you have an variable product you get this wired price rage ( below product title ) in the Variable Product page and it shows in the shop page as well. For me the standard way is to show the lowest price of the product in the shop as well as product page and change that price according to user selection of variables. I can't believe why. I can remove the price range and show the lowest price using this