Welcome Guest, Not a member yet? Register   Sign In
New Cart class frustrations
#1

[eluser]Unknown[/eluser]
I just finished a maddening 90-minute session trying to figure out why product A would go in the cart when product B would not.

Turns out CI's Cart class validates product names, but does so in a rather heavy-handed way (the docs are silent on this, btw). You can set the preg validation string in Cart.php, but the cart REJECTS any product whose name includes a "bad" character.

I see no reason to reject the item completely. Imagine a client puts in a product name with a "bad" character, and no user can order it. Result: frustrated user, angry client and ticked off developer!

Sure--you can and should filter on the input side, but this means you have to keep the input filtering and cart filtering in-sync. And you also have to remember to update your Cart.php preg string on every CI upgrade.

Why not have the cart REPLACE the "bad" characters with '' instead of rejecting the product completely?

Gosh, I love CI and how it simplifies my life. I appreciate the new cart class. But this product assassination code is making my life more complicated.
#2

[eluser]markup2go[/eluser]
So extend it to satisfy your needs!!




Theme © iAndrew 2016 - Forum software by © MyBB