I'm customizing OpenCart3. For some reasons I have to save contents of cart
table in a session, then re-insert them back, but while adding session data using $this->cart->add(...)
extra codes are added to options which I don't know how to prevent.
foreach($this->session->data['in_cart']['rows'] as $key => $row){
if ($row['store_id'] != $this->session->data['cart_store_id']) {
$this->cart->add($row['product_id'], $row['quantity'], $row['option'], $row['recurring_id'], $row['store_id']);
}
}
Originally options should be saved like:
{"90":["263"],"89":["260"]}
But they get saved as:
"{\"142\":[\"494\"],\"141\":[\"492\"]}"
Thanks for any kind help, but not down voting
.