I use a 3rd party shopping module for this site and hence i cannot tinker with the sourcecode of this module.
Everthing works fine but here is my issue. On the checkout option the summary contains field which are redundant and i want to hide this fields.
Discount: GBP £0.00
Sub total: GBP £90.00
Shipping: GBP £10.00
Handling: GBP £0.00
Total: GBP £100.00
As you see above only 3 fields have values. I want to use Javascript and hide the fields which do not have any values like "Discount", "Shipping" and "Handling".
Here is a Fiddle to my code
Here is my code
<div class="CartTotalAmountContainer">
<div class=" TotalSalesOrderDetailDiscountAmount">
<div>
<label> <span>Discount:</span>
</label>
</div> <span>GBP £0.00</span>
</div>
<div class="SubTotalAmount">
<div>
<label> <span>Sub total:</span>
</label>
</div> <span>GBP £90.00</span>
</div>
<div class="TotalShippingAmount">
<div>
<label> <span>Shipping:</span>
</label>
</div> <span>GBP £10.00</span>
</div>
<div class="TotalHandlingAmount">
<div>
<label> <span>Handling:</span>
</label>
</div> <span>GBP £0.00</span>
</div>
<div class="TotalAmount">
<div class="dnnLabel">
<label> <span>Total:</span>
</label>
</div> <span>GBP £100.00</span>
</div>
</div>
No my logic is i can access the topcontainer of the elements by using
var X= document.getElementsByClassName("CartTotalAmountContainer");
but how do i access the data inside the individual spans and make the style="display:none" for their parent divs.