HasteDesign / Registrations-for-WooCommerce

Add a registration product type to your WooCommerce installation.
GNU General Public License v2.0
38 stars 16 forks source link

don't allow '-'s in Product Name #26

Closed ajlowndes closed 6 years ago

ajlowndes commented 6 years ago

I had a course titled "Course Booking - TR". Somewhere down the line I wasn't getting the course dates in the order detail screen. Found out that the reason why was the code was using the php "explode" function to split the string by the character "-". So when the title and date were being recalled, the date was returning "TR" instead of the actual date.

allysonsouza commented 6 years ago

Thanks @ajlowndes , this kind of code makes me ashamed, but it was the solution I came up with at the time, hoping to be able to refactor the whole plugin for a 3.0 release

ajlowndes commented 6 years ago

yeah my solution isn't the cleanest - surprises are in store to anyone who makes a product with a "_" in the name... But I'm just starting out in php, not sure how to re-think the whole problem just yet.