Home Forums WoodMart support forum Removing woodmart_swatches_list(); from archives

Removing woodmart_swatches_list(); from archives

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #110138

    eimulex
    Participant

    Hi,

    We want to remove swatches list php request from archives as it takes ages to load products with a lot of variations.
    We did manage to remove the woodmart_swatches_list(); from archives (shop, category page and etc), as when we have on average 30 variations per product for 50 products, the query takes ages. However, after updating to 3.5.2 woodmart version the queries blasted again and we can’t find what we are missing.
    We removed it from these files http://prntscr.com/mr0fms in /child-theme/woocommerce/ .
    Here are the query count for the same page and plugins for woodmart http://prntscr.com/mr0hur and shopkeeper http://prntscr.com/mr0gno

    What are we missing?

    #110146

    Artem Temos
    Keymaster

    Hi,

    You can disable attribute to be displayed on the shop page via Theme Settings -> Shop -> Attribute swatches.

    Regards

    #110176

    eimulex
    Participant

    We understand that, but on variable products, on product page we need the theme to take the product image for color (spalva) image directly uploaded to variable product.
    when we disable on settings >attribute swatches the image is not taken on the product page.
    therefore we just need to eliminate the code from products loops everywhere.
    how to do that?

    #110184

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_swatches_list( $attribute_name = false ) {}

    #110188

    eimulex
    Participant

    That works well!
    Thanks!

    #110189

    Artem Temos
    Keymaster

    You are welcome.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Removing woodmart_swatches_list(); from archives’ is closed to new replies.