Support » Fixing WordPress » Price Disappear when clicking Related Product into Single Product Page

  • Hello!

    We’ve noticed that the price disappears whenever we click on any product (Simple, Variable or Discounted) in the “Popular Product in Category” list at the bottom of the product archive page.

    The same occurs when clicking any “Related Product” at the bottom of the Single Product Page.

    We already have the following code snippet applied that fixed the price not showing if variable products have same price:

    add_filter(‘woocommerce_show_variation_price’, ‘__return_true’ );

    Strangely, prices show up fine if products are accessed straight from the list of items generated on the Product Archive page.

    I have a thought it is a bug of some sort but perhaps I am missing something.

    Hopefully anyone can help and provide a fix for what we’ve encountered.

    Thank you in advance.

    Have a prosperous 2021 to all!

    – Sam

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @brwnfsh,

    I can see the price when I visit the page source. You can check the page source from here: view-source:https://your-url/here/

    On the source, if you search for the price-wrapper, you’ll see the price.

    I can see another piece of Javascript code on your site and that is manipulating the price once the page loads.

    $( ".single_variation_wrap" ).on( "show_variation", function ( event, variation ) {
      $('.price-wrapper').html( variation.price_html );
      console.log(event, variation)
    } );

    Do you know where the code is added in the WordPress Admin area? Maybe it’s injected by a plugin. Please check if you can find that and try removing it to check if that solves the issue.

    If you open the browser’s console, you’ll see n.Event> Object>
    Once you expand the “Object” you’ll notice the “price_html” set to empty. Your actual product price is getting replaced by the empty value, that’s why the price is disappearing.


    Thread Starter brwnfsh


    Hello and thank you, Sharif @smeunus!

    Apparently, the link on the staging area goes into the live site and the custom php snippet I mentioned above have not been implemented when I sent the support request earlier.

    I saw that it is now working great both on the staging and the live site, although I just noticed the SALE (%) label disappeared on the “Popular Product in Category” and “Related Product”

    Maybe you have some thoughts about it?

    All the best,

    Hey @brwnfsh,

    “POPULAR PRODUCTS IN THIS CATEGORY” and “Related Product” seems like a slider that has different markup than the normal products that contains a SALE label.

    Afraid, I’m not sure how these sections are made up. I assume it’s custom made/from a plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.