Welcome Guest, Not a member yet? Register   Sign In
CI 1.7.? (SVN) Shopping Cart Class
#1

[eluser]exodus7[/eluser]
I'm not 100% if this is a bug, however I can reproduce it every time:

The problem occurs when adding an item to the cart. If a string has a ' | ' character it fails to insert into the cart.

for example:

Code:
$data = array(
               'id'      => 'sku_123ABC',
               'qty'     => 1,
               'price'   => 39.95,
               'name'    => 'T-Shirt|434' // this would cause it to not insert into the cart.
            );

$this->cart->insert($data);

Has anyone else experienced this? if the character in question is removed, the item will be added successfully. I have not tried any other characters yet...


My current setup is:

VPS Running CentOS 5.2
PHP 5.2.9
Apache 2.2.3

Thanks!
#2

[eluser]exodus7[/eluser]
If anyone is following this, I realized that the problem is not related to the '|' character, but rather the length of the item name. If the item has a name with too many characters, it will not insert it into the cart. Has anyone else experienced this?
#3

[eluser]Stefano G[/eluser]
Hi exodus7,
as far as I can see on the class' first lines there's a rule that prevents names to contain pipe | character... if I ain't wrong Smile

Code:
var $product_name_rules    = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods

try to remove it and see what happens but I am confident it should work.

Stefano




Theme © iAndrew 2016 - Forum software by © MyBB