How do I only show color swatches in non-single product pages

2 replies3 participantsUpdated by Andrew Mitchell

  • Avatar: Safe Desires
    Safe Desires
    Participant

    So, on regular pages and archive

    Please, contact administrator
    for this information.

    2 Answers

    Avatar: Jack Richardson
    Jack Richardson
    Support staff

    Hello @Safe Desires,

    You can prevent certain product swatches from appearing on your pages by using the following custom CSS in Theme Options:

    .et_st-default-holder[data-et-holder]:not([data-et-holder=pa_color]) {  
        display: none;  
    }

    Alternatively, you can hide these product swatches only on specific pages by using:

    .page-id-181774 .et_st-default-holder[data-et-holder]:not([data-et-holder=pa_color]) {  
        display: none;  
    }

    If you would like to display all swatches only on the shop page, please use the following snippet:

    body:not(.tax-product_cat, .post-type-archive, .tax-product-tag) .et_st-default-holder[data-et-holder]:not([data-et-holder=pa_color]) {  
        display: none;  
    }

    Please note that this is considered an additional customization. If you require such customization, you may submit a request for our customization services, as our standard support is provided in accordance with Envato’s policy.

    Best regards,
    Jack Richardson
    The 8Theme’s Team

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff

    Hello, Safe Desires,

    Please add the following custom CSS to Theme Options → Theme Custom CSS → Global CSS in order to display color swatches only on non-single product pages:

    .etheme-product-grid-content [data-attribute="pa_size"] {
        display: none;
    }

    Best regards,
    8Theme Team

Want to reply? Log in, or register with your ThemeForest purchase code, to reply to this topic.

Login / Register