Why codeigniter shopping cart class doesn't allow any special character in the name?

后端 未结 5 1066
春和景丽
春和景丽 2020-12-29 09:32

I have a question just like in the title - Why codeigniter shopping cart class doesn\'t allow any special character in the name? When I\'m adding some item with normal name

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 10:31

    If you look on Cart.php you will see on line 31 var $product_name_rules = '\.\:\-_ a-z0-9';.

    A nice way to change this variable is putting a MY_Cart.php on your application\libraries\MY_Cart.php with this code:

    Or you can also modify it when you add the product, using:

    $this->cart->product_name_rules = '[:print:]';
    $this->cart->insert(array());
    

提交回复
热议问题