Cart Class - Products with brackets included in the name dont get added - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Cart Class - Products with brackets included in the name dont get added (/showthread.php?tid=22731) |
Cart Class - Products with brackets included in the name dont get added - El Forum - 09-18-2009 [eluser]alan-tucker[/eluser] I have noticed that product that have brackets included in them dont get added to the basket. Any ideas? Code: array( Cart Class - Products with brackets included in the name dont get added - El Forum - 09-18-2009 [eluser]brianw1975[/eluser] Take a look at your logs and see if you find "An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces'" I took a look at the code and found the following info in the _insert function Code: // Validate the product name. It can only be alpha-numeric, dashes, underscores, colons or periods. appears that the cart class documentation needs a bit of work... Cart Class - Products with brackets included in the name dont get added - El Forum - 09-18-2009 [eluser]alan-tucker[/eluser] Yea I updated the following: From Code: var $product_name_rules = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods To Code: var $product_name_rules = '\()\(\)\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods Cart Class - Products with brackets included in the name dont get added - El Forum - 09-18-2009 [eluser]brianw1975[/eluser] a lot of people may have to make the same update if they have already existing tables of items that don't have separate tables of options -- in your instance Small would be an option and used in the options section of the array - but I assume that the item_name is already existing and that there are multiple item ids for a shirt like shirt (small), shirt (medium), shirt (large) Cart Class - Products with brackets included in the name dont get added - El Forum - 10-07-2009 [eluser]mikegniewosz[/eluser] Thanks for this. I spent too much time trying to figure out why my items weren't being added to the cart. What are the security risks of adding other characters? Cart Class - Products with brackets included in the name dont get added - El Forum - 10-08-2009 [eluser]darkhouse[/eluser] I'm going through this same issue. I've got products with French characters, and I really don't want to have to add every possible character to the list. I'm wondering what the purpose of this is in the first place, it's just a name. I'm thinking I might just remove the whole thing that checks the item names altogether. I know it would solve my immediate problem, but I'm not sure what issues I could run into in the future. Any thoughts? |