Show short description after price updates
-
HI there,
I am using the plugin “Product Options and Price Calculation Formulas for WooCommerce – Uni CPO” to make calculations for product prices. It’s working great, but there’s something I’d like to do based on the final calculated price.
Underneath the price is where the short description would usually go, but I’d like to add some additional custom text in there instead. So I’ve added the short description and hidden it in the CSS. What I would like to do is toggle to show that description once the price updates
The price is in a bdi tag, so I was hoping that something like this would work:
<script> var bdi = this.priceDiv.find('bdi'); if (bdi.length){ this.priceDiv = bdi; } var hiddendesc = document.getElementsByClassName("woocommerce-product-details__short-description"); if (this.priceDiv.length > 1){ document.getElementById("woocommerce-product-details__short-description").style.display = "block"; } </script>
But it’s not working. Would anyone have any ideas on how I can get this to work?
Many thanks
Nicola
The page I need help with: [log in to see the link]
- The topic ‘Show short description after price updates’ is closed to new replies.