EllisLab text mark
Advanced Search
     
ci cart help needed with regexp
Posted: 31 October 2012 12:22 PM   [ Ignore ]
Joined: 2008-08-02
112 posts

Hi, I just discovered the hard way that the cart rejects a product with names containing eg slash (often used in product names eg cream/offwhite etc). Not being good on regexp and in need of a quick fix, can someone tell me the preg_replace formula for “replace any char not in $this->product_name_rules with space”. This would be imo a nice line to insert in cart at circa line 193 and maybe also put a note in the user guide that such characters are not allowed. another nice change would be to include

if (! isset($items['qty'])) $items['qty''1'

at circa line 152. the 2 changes would make it a bit more tolerant to errors
many thanks, Bill