• Hey guys..just need some help with the variation display in cart and check out.

    I noticed some products would show the variation in detail below the product name, and some variation appears along the product name

    variation cart

    How do I make it display exactly like the product “Germ Free”?

    • This topic was modified 7 years, 7 months ago by fogalexchia.
Viewing 15 replies - 1 through 15 (of 16 total)
  • There are two ways to make attributes.

    If you go to:
    Dashboard > Products > Attributes
    and set up your attributes, then in the product edit page, Attributes tab, choose those attributes from the drop-down, you will get the “Germ Free” layout.

    Conversely, if you go straight to the product edit page, Attributes tab and make some custom attributes for that product only, you will get the “Smart Oil” layout.

    Thread Starter fogalexchia

    (@fogalexchia)

    @lorro

    Thanks but those two items is already variation items.

    It’s just how the variation is shown mystifies me. In one hand, it breaks down like “Germ Free”, while some appears as “Smart Oil” in a single line

    Yes I know they are both variation items. Variation items are setup using attributes, and there are two ways to set up attributes. If you set up site-wide attributes at Dashboard > Products > Attributes, you get the first format, but if you setup product-specific custom attributes, you get the second format.

    Thread Starter fogalexchia

    (@fogalexchia)

    @lorro
    OH! I see now what you meant.

    But I’ve been creating all the attributes via the Dashboard > Products > Attributes.

    I didn’t craft a single attribute from the product specific custom attributes.

    I did accidentally click “Create Custom attribute”..then deleted it to re-select the existing attribute. Could it have caused this?

    Any way to revert back to the first format?

    Hard to say. Remake the “Smart Oil” product and test and see if that results in the “Germ Free” format.

    Thread Starter fogalexchia

    (@fogalexchia)

    @lorro

    Yipes..with a long list of products and mostly variable products..I’ll just leave it as it is

    Thread Starter fogalexchia

    (@fogalexchia)

    I understood what’s going on now.

    If you have the variation pre-set for example

    Variation 1 = 5 Liter, 1 Bottle
    Variation 2 = 5 Liter, 4 Bottles

    It will show as how “Smart Oil” is shown.

    However, if you have a variation option that is left “Any [attribute name]” for example:

    Variation 1 = 5 Liter, 1 Bottle, Any Fragrance
    Variation 2 = 5 Liter, 4 Bottles, Any Fragrance

    The attribute of [Any Fragrance] will appear below the product title like “Germ Free”, and the “5 Liter, x Bottle(s)” will appear along the product name like “Smart Oil”

    Hey. I have the same problem. I have just one attribute to select on each product and for each variation I need to have different prices. So if I choose “Any [attribute name]” for the variations, then I cant set up different prices. And by the way, when the variation is displayed next to the product title, the variation is completely misssing in the checkout.

    Have you found out something more to solve this?

    Problem solved, add this to child theme function.php:

    add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );
    add_filter( 'woocommerce_is_attribute_in_product_name', '__return_false' );

    Hello,

    I was wondering the same thing, then I dug a little deeper in the code:

    If you are using 3.0+

    Variation values are shown only if they are not found in the title as of 3.0.
    This is because variation titles display the attributes.

    This is an actual comment from woocommerce/includes/class-wc-cart.php comment from line 541-542

    @ttsamisis that worked for me, variations are now displaying properly in the cart and checkout page, Thanks!

    @ttsamisis You’re a legend!

    @ttsamisis

    Not working for me. I need to show the details of a product (e.g. 20 Large & 20 Small shirt) in cart as well as in checkout.

    Can anyone please suggest a solution. My woocommerce version is 3.0.0 and 3.3.3 (in two setups)

    • This reply was modified 6 years, 8 months ago by subrat4php.

    @ttsamisis

    Here is the screenshots

    https://ibb.co/kV1DHn
    https://ibb.co/ctMDHn

    Any suggestions?

    ttsamisis thank you so much. Your piece of code worked!

    Woocommerce should implement it.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Help with Variation display in cart’ is closed to new replies.