twomice / com.joineryhq.percentagepricesetfield

Other
5 stars 10 forks source link

Extra "0.00" appearing in Total #44

Closed philmb closed 1 month ago

philmb commented 2 years ago

This has been the case for a while on our installation, and I've looked at the code a bit but couldn't determine where its happening. I'm guessing this is a conflict somewhere, because I'm sure it would have been fixed by now if it were a universal bug. Anyway, we have an extra "0.00" appearing in the total line, as per the images. If you could give me a general area of the code in which to look, I'd be glad to look into it more to see if I can sort it out. Screen Shot 2021-11-23 at 10 29 47 AM Screen Shot 2021-11-23 at 10 30 13 AM

twomice commented 2 years ago

Yes, it could be something unique to your site. Thanks for looking into it yourself; this info may help:

Most of the on-page stuff is done in public_price_set_form.js. Actual display of the modified total is in updateTotal()

Please report any findings or further questions here.

philmb commented 2 years ago

Thanks. I've determined that CRM.percentagepricesetfield.monetarySymbol is evaluating to include a number (0) and not just the symbol. Changing line 77 of public_price_set_form.js to cj('#percentagepricesetfield_pricevalue').html('$' + CRM.percentagepricesetfield.calculateTotal()); is at least a temporary fix for me. Not helpful for the code to maintain a variety of symbols.

What would be helpful is to wrap the monetary symbol in a <span> or put it in a :before element so it can be accessed independently of the total. Then whenever someone encounters whatever quirk is bothering me, or just wanted to style the symbol differently, it could be dealt with through some simple css.

philmb commented 2 years ago

Just noticing that this is the same issue experienced in PR https://github.com/twomice/com.joineryhq.percentagepricesetfield/pull/33 I'm also using Joomla.

twomice commented 1 month ago

Thanks for closing @philmb . Sorry I never got you a proper response, but if this is indeed the same as in #33 , then I expect it's also fixed by d4ec43f . I'm trying to clean out old tickets first, but plan to tag a new release this week.