Welcome Guest, Not a member yet? Register   Sign In
Why carts library doesnt support polish dialectic signs???
#1

[eluser]penta997[/eluser]
Hi. I have problem with cart library. When I want to add items from database:
Code:
function addCards($id=1)
       {
            $query = $this->Kategorie_model->get_books_by_ID($id);
           $item = $query->row();
           $data = array
           (
               'id' => $id,
               'name' => $item->BOOK_Title,
               'qty' => 1,
               'price' => $item->BOOK_Price
           );
           $this->cart->insert($data);
            echo '<pre>';
           var_dump($data);
       }

var_dump displaing correct value, not empty. But when i call showCards function:
Code:
function showCarts()
       {
           $query = $this->cart->contents();
           echo '<pre>';
           print_r($query);
       }

there is no data witch include polish dialectic signs and I can add only 4 records to carts library. How can I fix it? Please, help
#2

[eluser]penta997[/eluser]
I was fixed a 4 records limit. I was only changed in config file :$config['sess_encrypt_cookie'] to False. But still i cant add items with polish signs.
I was changed var $product_name_rules in cart.php file to '\.\:\-_ a-z0-9///^[a-zA-ZąęćżźńłóśĄĆĘŁŃÓŚŹŻ\s]+$/';
But didnt work.
#3

[eluser]Isern Palaus[/eluser]
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:

Code:
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    
    class MY_Cart extends CI_Cart {
    
        var $product_name_rules    = '[:print:]';
    
    }

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

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

This should work! :-)
#4

[eluser]penta997[/eluser]
It works, but now I have another problem. I was created sessoion table ci_session and when i call addCards function the sesssion expired immediately. But is not a carts falt. When I added too many data to sesstin data even without using carts library, the sesstion expired too.




Theme © iAndrew 2016 - Forum software by © MyBB