• Resolved hnwp

    (@hnwp)


    For some reason, if an item is hidden from search results and the shop page, the product image is duplicated in the cart.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hi,

    I just checked your site and the problem is related to the theme which you are using.

    We filter the page/post content and we replace all img src attr with placeholder image. For SEO reason we add noscript tag with original image below the main image.

    In public_html/wp-content/themes/HN/woocommerce/cart/cart.php

    you are using wp_kses_post for product images, which strips all tags that are not allowed for post context.

    As you can see here the noscript tag is not part of allowed post tags and it’s removed, but the img tag is still rendered.

    You can fix the problem by removing the wp_kses_post or by using wp_kses. Note that if you choose to use wp_kses, you have to add all allowed post tags along with noscript.

    Thread Starter hnwp

    (@hnwp)

    Hi Stanimir. Thank you so much!

    I just removed the wp_kses_post and it now removes the duplicate.

    A follow-up question at this URL: https://herbalnitro.com/cart/?add-to-cart=2146

    If you add or remove the quantity of items in the cart, the image no longer loads. The same thing occurs if you proceed to checkout and then check “Ship to Different Address.”

    It seems like any time the server updates the cart the images no longer loads.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with “Hidden from Catalog” Woocommerce Images’ is closed to new replies.