product-variations

Set and display a custom product variation value dynamically on WooCommerce single products

半城伤御伤魂 提交于 2021-02-09 07:28:49
问题 I have a WooCommerce jewelry site. On single variable product page I have variations and I added a text box (text box is for the customer to write something that will be printed on the jewelry). So I expect the page to work as follows: If the customer selects a particular product variation and starts typing in the textbox price of the product should change depending on number of letters (NOTE: this should only work if one specific variation is selected) on every other product price will be

Set and display a custom product variation value dynamically on WooCommerce single products

懵懂的女人 提交于 2021-02-09 07:26:25
问题 I have a WooCommerce jewelry site. On single variable product page I have variations and I added a text box (text box is for the customer to write something that will be printed on the jewelry). So I expect the page to work as follows: If the customer selects a particular product variation and starts typing in the textbox price of the product should change depending on number of letters (NOTE: this should only work if one specific variation is selected) on every other product price will be

Auto add to cart a Gift product variation programmatically in WooCommerce?

倾然丶 夕夏残阳落幕 提交于 2021-01-06 03:29:48
问题 I'm trying to create a buy one get one offer for woocommerce when someone adds a product to the cart. The code below works but only with simple products, I've tried adding the variation ID to the variable but it does not work. Any ideas? thanks to the community add_action( 'template_redirect', 'bbloomer_add_gift_if_id_in_cart' ); function bbloomer_add_gift_if_id_in_cart() { if ( is_admin() ) return; if ( WC()->cart->is_empty() ) return; $product_bought_id = 421; $product_gifted_id = 1256; //

Auto add to cart a Gift product variation programmatically in WooCommerce?

混江龙づ霸主 提交于 2021-01-06 03:28:34
问题 I'm trying to create a buy one get one offer for woocommerce when someone adds a product to the cart. The code below works but only with simple products, I've tried adding the variation ID to the variable but it does not work. Any ideas? thanks to the community add_action( 'template_redirect', 'bbloomer_add_gift_if_id_in_cart' ); function bbloomer_add_gift_if_id_in_cart() { if ( is_admin() ) return; if ( WC()->cart->is_empty() ) return; $product_bought_id = 421; $product_gifted_id = 1256; //

Auto add to cart a Gift product variation programmatically in WooCommerce?

倾然丶 夕夏残阳落幕 提交于 2021-01-06 03:28:27
问题 I'm trying to create a buy one get one offer for woocommerce when someone adds a product to the cart. The code below works but only with simple products, I've tried adding the variation ID to the variable but it does not work. Any ideas? thanks to the community add_action( 'template_redirect', 'bbloomer_add_gift_if_id_in_cart' ); function bbloomer_add_gift_if_id_in_cart() { if ( is_admin() ) return; if ( WC()->cart->is_empty() ) return; $product_bought_id = 421; $product_gifted_id = 1256; //

Auto add to cart a Gift product variation programmatically in WooCommerce?

佐手、 提交于 2021-01-06 03:27:10
问题 I'm trying to create a buy one get one offer for woocommerce when someone adds a product to the cart. The code below works but only with simple products, I've tried adding the variation ID to the variable but it does not work. Any ideas? thanks to the community add_action( 'template_redirect', 'bbloomer_add_gift_if_id_in_cart' ); function bbloomer_add_gift_if_id_in_cart() { if ( is_admin() ) return; if ( WC()->cart->is_empty() ) return; $product_bought_id = 421; $product_gifted_id = 1256; //

Display variation stock status on single dropdown variable products in Wocommerce 3 [closed]

为君一笑 提交于 2020-12-13 03:17:13
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 16 days ago . Improve this question I am using Show stock status next to each attribute value in WooCommerce variable products answer code to display the variation stock status on single product attribute dropdown for variable product pages. This works fine, but take too much time to load a product. How could I