variations

WooCommerce Variation Images not displaying

情到浓时终转凉″ 提交于 2019-12-05 19:29:17
On the single product page, when I select a color, the featured image doesn't change. WordPress has been updated to 4.6.1, WooCommerce to 2.6.2, and the Storefront theme to 2.1.2. I have deactivated all plugins except WooCommerce and am using the Storeront theme exactly as I installed it. I cleared all caches, cleared my browser cache (Chrome, latest version),and even went so far as to re-enter all variation images for a single product. Further testing hs yielded the same result. I have no PHP errors, no errors in Dev tools, and no errors in WooCommerce System Status. After searching through a

Woocommerce Show default variation price

非 Y 不嫁゛ 提交于 2019-12-05 18:30:48
I'm using Woocommerce and product variations and all my variations have a default variation defined. I would like to know, how I can find the default variation and display it's price. This is the code I got so far, but it displays the cheapest variation price, and I'm looking for my default variation product price instead. // Use WC 2.0 variable price format, now include sale price strikeout add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 ); function wc_wc20

Get the count of “in stock” product variations for a variable product in Woocommerce

穿精又带淫゛_ 提交于 2019-12-05 06:21:32
问题 I'm trying to make a snippet for functions.php file that shows only one price of selected variation, thus omitting the price range displayed along with variation price on single product page. I'm using the following code: add_action( 'woocommerce_before_single_product', 'my_remove_variation_price' ); $product_variations=$product_variable->get_available_variations; function my_remove_variation_price() { global $product; if ( $product->is_type( 'variable' ) { remove_action( 'woocommerce_single

Using checkboxes for variations in WooCommerce to allow multiple choice

我怕爱的太早我们不能终老 提交于 2019-12-05 02:02:43
问题 I've been using WooCommerce for a while now but this one issue is causing me a problem. The client I'm making a site for provides training courses and presentations, and this partiular product (or presentation) allows several different options to be added to the cart, each with its own price. So, the base price is zero. Then there are 8 different presentations that the user can select via checkbox on their existing website - I somehow need to replicate that using WooCommerce on their new site

Add custom dimension fields to each variation settings for variable products

血红的双手。 提交于 2019-12-04 08:20:45
I'm trying to add a "Built Dimensions" fields to each product variation settings. Here's a mock of what I'm trying to accomplish: I've followed these following tips but they aren't doing quite what I want: http://www.remicorson.com/mastering-woocommerce-products-custom-fields/ Add Advanced Custom Fields to WooCommerce Product Variation Those are adding it to one of the other data tabs. I need it per variation. Each variation has a built dimension and a shipping dimension. With the 2 hooked functions below you will get exactly what you are expecting like in your mock: // Add variation custom

Change WooCommerce variable product title based on variation

左心房为你撑大大i 提交于 2019-12-04 07:54:32
Im looking for some help getting the WooCommerce variable product title to change based on variations. In this specific case i would like the title to change when a color is selected, like "Productname Black". Is there any easy snippet to get this to work? Thankfull for all the help i can get. UPDATE FEB 2018 The following code, will add to title the color attribute vakue of the chosen variation, meaning that if there is many select fields (many attributes), the color text value will be displayed in the title only once the variation price will appear (selected variation). its based on PHP and

Woocommerce: Display Product Variation Description on Cart page

▼魔方 西西 提交于 2019-12-04 05:30:33
I'm trying to display my product variation description in my Cart. I have tried inserting this code in the cart.php template: if ( $_product->is_type( 'variation' ) ) {echo $_product->get_variation_description();} By following this documentation https://docs.woocommerce.com/document/template-structure/ But it's still not showing up. Not sure what I'm doing wrong here. Can anyone help on this? Thanks UPDATE COMPATIBILITY for WooCommerce version 3+ Since WooCommerce 3, get_variation_description() is now deprecated and replaced by the WC_Product method get_description() . To get your product item

Get the count of “in stock” product variations for a variable product in Woocommerce

青春壹個敷衍的年華 提交于 2019-12-03 21:38:28
I'm trying to make a snippet for functions.php file that shows only one price of selected variation, thus omitting the price range displayed along with variation price on single product page. I'm using the following code: add_action( 'woocommerce_before_single_product', 'my_remove_variation_price' ); $product_variations=$product_variable->get_available_variations; function my_remove_variation_price() { global $product; if ( $product->is_type( 'variable' ) { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' ); } } The problem is when you have, for instance

add additional button on product page for woocommerce

我们两清 提交于 2019-12-03 17:24:24
I have spent the majority of the day trying to figure out how to adjust the single product page using woocommerce. I would like to add a custom button next to the "Add to cart" button that would be a custom link that says "Next". I am working on an invitation website where there are numerous components to an invitation, so after a user adds a product to their cart, I want there to be an option that says "Next" so they can go ahead and customize the next piece of the invitation. (I will have custom fields for each). The next button won't be on all products, and the link will be different for

Add the variation price to variable product dropdown item names in Woocommerce

断了今生、忘了曾经 提交于 2019-12-02 12:22:45
问题 I'm using this code to get the variable product options $terms = wc_get_product_terms( $bundle_product_id, $name, array( 'fields' => 'all' ) ); foreach ( $terms as $term ) { if ( !in_array( $term->slug, $options ) ) { continue; } echo '<option value="' . esc_attr( $term->slug ) . '" ' . selected( sanitize_title( $selected_value ), sanitize_title( $term->slug ), false ) . '>' . apply_filters( 'woocommerce_variation_option_name', $term->name ) . '</option>'; } I tried a lot of codes to get