Support » Plugin: WooCommerce » Hide certain attributes on condition of another attribute

  • Good Morning!

    I’m wondering if certain attributes can be hidden dependent on the selection of another attribute.

    Lemme try explain my need. I sell art as either prints, canvas or framed.

    If a buyer decides on a print or canvas, then they do not need to choose a frame colour.

    Currently, I have the frame colour attribute set to N/A in my product settings. But Ideally I’d like to hide this attribute altogether on the product page as it is not needed when print or canvas is selected.

    I’m looking at adding further options that are only applicable to framed orders and another for canvas orders, so I don’t want the buyer to have to select N/A in all the options that aren’t relevant to their order.

    I’ve tried googling Hide/Display attributes but not finding what I need…

    Take a look at https://lexiart.uk/product/buddha-the-serenity-by-sharon-mendez/
    and try playing with the order attributes.

    Thanks in advance for any help available…

    Mark Lee

    =========================
    WooCommerce system status
    =========================
    ‘`
    ### WordPress Environment ###

    Home URL: https://lexiart.uk
    Site URL: https://lexiart.uk
    WC Version: 2.6.14
    Log Directory Writable: ✔
    WP Version: 4.7.2
    WP Multisite: –
    WP Memory Limit: ❌ 40 MB – We recommend setting memory to at least 64MB. See: Increasing memory allocated to PHP
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US

    ### Server Environment ###

    Server Info: Apache
    PHP Version: 5.6.22
    PHP Post Max Size: 100 MB
    PHP Time Limit: 0
    PHP Max Input Vars: 1000
    cURL Version: 7.41.0
    OpenSSL/1.0.2a

    SUHOSIN Installed: –
    MySQL Version: 5.7.14
    Max Upload Size: 100 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔

    ### Database ###

    WC Database Version: 2.6.14
    :
    woocommerce_sessions: ✔
    woocommerce_api_keys: ✔
    woocommerce_attribute_taxonomies: ✔
    woocommerce_downloadable_product_permissions: ✔
    woocommerce_order_items: ✔
    woocommerce_order_itemmeta: ✔
    woocommerce_tax_rates: ✔
    woocommerce_tax_rate_locations: ✔
    woocommerce_shipping_zones: ✔
    woocommerce_shipping_zone_locations: ✔
    woocommerce_shipping_zone_methods: ✔
    woocommerce_payment_tokens: ✔
    woocommerce_payment_tokenmeta: ✔
    MaxMind GeoIP Database: ✔

    ### Active Plugins (37) ###

    AccessPress Custom CSS: by AccessPress Themes – 1.0.7
    AccessPress Social Icons: by AccessPress Themes – 1.6.6
    All In One SEO Pack: by Michael Torbert – 2.3.12
    All-in-One WP Migration: by ServMask – 6.40
    AP Custom Testimonial: by AccessPress Themes – 1.3.2
    Builder WooCommerce: by Themify – 1.1.4
    Contact Form 7 MailChimp Extension: by Renzo Johnson – 0.4.38
    Contact Form 7: by Takayuki Miyoshi – 4.7
    Duplicate Page: by mndpsingh287 – 2.2
    Enhanced Media Library: by wpUXsolutions – 2.4.4
    Envira Gallery: by Envira Gallery Team – 1.5.9.8
    Hide Title: by Brandon Kraft & Randall Runnels – 1.0.4
    Instagram Feed: by Smash Balloon – 1.4.8
    InfiniteWP – Client: by Revmakx – 1.6.3.2
    Jetpack by WordPress.com: by Automattic – 4.7
    Limit Login Attempts: by Johan Eenfeldt – 1.7.1
    Media Library Assistant: by David Lingren
    Fair Trade Judaica – 2.41

    PixelYourSite: by PixelYourSite – 5.0.0
    PopupAlly: by AmbitionAlly – 2.0.1
    Redirection: by John Godley – 2.5
    Remove Query Strings From Static Resources: by Speed Up My Website
    Your WP Expert – 1.4

    Scroll Back to Top: by Joe Sexton – 1.1.3
    Simple Custom CSS: by John Regan
    Danny Van Kooten – 3.3

    Themify Portfolio Post: by Themify – 1.0.5
    Themify Product Filter: by Themify – 1.0.5
    Ultimate Form Builder Lite: by AccessPress Themes – 1.3.2
    W3 Total Cache: by Frederick Townes – 0.9.5.2
    WC Custom Thank You: by Nicola Mustone – 1.1.0
    WooCommerce – All in One SEO Pack: by Visser Labs – 1.3.4
    WooCommerce Stripe Gateway: by WooCommerce – 3.0.7
    Woocommerce Products Per Page: by Jeroen Sormani – 1.2.2
    WooCommerce Show Attributes: by Isabel Castillo – 1.5.2
    WooCommerce: by WooThemes – 2.6.14
    WooCommerce Helper: by WooCommerce – 1.7.2
    WP 1 Slider: by AccessPress Themes – 1.1.5
    WP Media Category Management: by DeBAAT – 1.9.1
    Media Library Categories: by Jeffrey-WP – 1.5.4

    ### Settings ###

    Force SSL: ✔
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2

    ### API ###

    API Enabled: ✔

    ### WC Pages ###

    Shop Base: #43 – /shop/
    Cart: #44 – /cart/
    Checkout: #45 – /checkout/
    My Account: #46 – /my-account-2/

    ### Taxonomies ###

    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)

    ### Theme ###

    Name: Themify Ultra
    Version: 1.6.7
    Author URL: http://www.themify.me
    Child Theme: ❌ – If you’re modifying WooCommerce on a parent theme you didn’t build personally
    then we recommend using a child theme. See: How to create a child theme

    WooCommerce Support: ✔

    ### Templates ###

    Overrides: –
    `

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have had a look at your product. When I choose “Print”, I cannot choose a frame colour, which is how it should be. The other inapplicable attributes are not available. Maybe you fixed it, but anyway the drop-downs are working as they normally do.

    There is a threshold to the number of variations of 30 combinations. Beyond the threshold, different selection behaviour will occur, but the threshold can be changed. You don’t seem to be near the threshold with this product.

    Thread Starter Leem2209

    (@leem2209)

    I’ve had to setup my variations to include a “N/A” under frame colour. The buyer still has to pick this, so I don’t want this option to show at all…

    The reason I want this is because I will be expanding my options and I don’t want the buyer to have to keep selecting N/A for options that don’t apply to the product.

    Got it. Conditional logic in that way is not supported by the core WooCommerce plugin. Their offering for product add-ons:
    https://docs.woocommerce.com/document/product-add-ons/
    won’t do it either, but tells us:
    “Product Add-ons does not have support for conditional logic. If you want your customers to fill out different fields based on information they fill out, we recommend that you use the powerful Gravity Forms plugin to create forms with conditional logic. Then link those forms to your WooCommerce products with the Gravity Forms Product Add-Ons extension.”. There will be costs and a learning curve with that.

    https://codecanyon.net/item/woocommerce-extra-product-options/7908619
    has conditional logic, but not based on variations. So you would need to make a simple product and have a bunch of fields for the extras, each with conditional logic. That’ll be a long job and difficult to check and edit, if it works.

    You can hire someone to make you a custom product page:
    http://jobs.wordpress.net/

    By far the easiest way though would be to make separate products. You can put links in one to the other in the description field so customers can easily navigate to other product if they want.

    Thread Starter Leem2209

    (@leem2209)

    Hmmm…. thanks Lorro….

    I did see something about Gravity Forms late yesterday but didn’t read into it too much.

    I thought there might be some Woocommerce plugin to easily enable this function.

    Something like a simple “hide” option in the drop down menu when setting up variations would do the trick!

    Anyway, enough time has been spent consistently editing product attributes and variations. I’m going to leave as is for now and in future expand the attributes to suit, not perfect but will do for now until outsourcing this is an option.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide certain attributes on condition of another attribute’ is closed to new replies.