bookingactivities / booking-activities

Wordpress plugin booking system
GNU General Public License v3.0
28 stars 8 forks source link

Availability particle not show on quantity of 1? #149

Closed rayedgar closed 1 year ago

rayedgar commented 2 years ago

I am a bit puzzled. I am trying to hide availability(quantity particle text) if greater than 0. Availability setting is on 1%. But it already removes the particle 'beschikbaar'on quantity of 1 instead of 0. and the quantity becomes hidden.

I removed all custom code and css.

What I eventually would like to achieve is the same, the way WC does:

QUANTITY PARTICLETEXT 0 FULL 1-3. only x available! (set threshold) 4-infinite x available

Screenshot 2022-05-06 at 08 06 16 Screenshot 2022-05-06 at 08 08 13
yoancutillas commented 2 years ago

If you set "Hide availability if greater than" to "1%", indeed, the availability will most likely always be hidden (unless your events availability is very high). Set it to to a higher percent to keep the availability displayed a bit more. E.g.: if your events availability is "20", then set it to "30%" to display the availability between 0 and 6.

You cannot achieve the same as WC without custom code. Booking Activities only allows to hide the event availability if greater to a certain percent. #140 describes how to add "only" before and "!" after the availability text with CSS only, but it would be regardless of the remaining number. If you need to take the avilability number into account, you would need to make custom javascript code.

Note that in the next release, the "Hide availability if greater than" option will hide (in CSS) the whole availability text instead of hiding only the number.

yoancutillas commented 2 years ago

Oh, sorry, regarding the "Beschikbaar" that is not displayed, you may be missing a translation (the "avail." text must be translated in both singular and plural), see the instructions below "Translate Booking Activities into my language" here: https://booking-activities.fr/en/documentation/faq/

rayedgar commented 2 years ago

Ah yes! the plural setting, that makes sense. i will await your next version. i hope it gives more flexibility to the quantity settings. for instance a differentiation in message between full, 1 and threshold particle text. Many Thanks

yoancutillas commented 2 years ago

Sorry this feature is not planned, the next version will simply hide (in CSS) the whole availability text instead of hiding only the number.

I have noted your feature request, thank you.

rayedgar commented 2 years ago

Thank you!

yoancutillas commented 1 year ago

I cannot provide support for custom code, but here is an example in the hope to help:

Result example: custom-css-availability

rayedgar commented 1 year ago

thank you, that works!