Forums » Plugin: WooCommerce » Variable product price not displaying in custom single product template

  • Resolved thinckx

    (@thinckx)


    I’ve got my own single-product.php template, where i call the

    do_action( 'woocommerce_single_product_summary' )

    hook. However, when choosing an attribute (in my case a custom attribute, ‘contents’), the price of the variation is not shown. So I dived in to this and found that the javascript (add-to-cart-variation.js) is not loading. When I add this file manually, to check if that’s causing the problem, price still isn’t showing up.

    The from-to-price however, is showing (€25 – €100). The html that is responsible, is this:

    <div class="woocommerce-variation single_variation"></div>

    Which should be:

    <div class="woocommerce-variation single_variation" style="display:block;">
      <div class="woocommerce-variation-description"></div>
      <div class="woocommerce-variation-price">
        <span class="price">
          <span class="amount">€25.00</span>
        </span>
      </div>
      <div class="woocommerce-variation-availability"></div>
    </div>

    I’ve got wp_footer() and wp_head() where they should be, and no plugins except for one which I disabled.

    I’ve also copied the single-product/add-to-cart templates (variable.php, varation-add-to-cart-button.php, variation.php) to my theme folder.

    WC version = 2.5.5. What am I missing? Thanks for your support!

    https://wordpress.org/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thinckx

    (@thinckx)

    Ok I found the solution. Apparently, that was not the only problem, the product was also not adding to the cart. So I looked into that and I found this article. I changed mytheme/woocommerce/single-product/add-to-cart/variable.php back to the original and everything works again. I probably changed some classes or so, which failed the javascript.

    hi there i m new here having an issue, related to variable products price variation
    i have product with 5 sizes
    each size has different price
    its shows on product 169.90 – 699.90
    but when i select any size the price related to its size desent appear

    working on same theme at local host its work its shows the price related to its size but working on hosting server its not working properly

    i m using avada theme fusion

    please help me to solve this issue thank you so much

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Variable product price not displaying in custom single product template’ is closed to new replies.