Welcome Guest, Not a member yet? Register   Sign In
Cart - insert (add) item - how do you get the generated rowid?

I want to get the rowid of the item at the point of me calling $this->cart->insert(...)

Is there a way to accomplish this, without hacking up core/libraries/cart.php?


For now, I accomplished this by hacking up the library and setting the $items parameter in insert() and _insert() to be passed by reference, and then setting

$items['rowid'] = $rowid;

...right before return of _insert()

This way, I get the rowid back in the same array that I passed to insert()

Please let me know if there are any negative implication to this approach, though it seems to be working good at first glance.

Theme © iAndrew 2016 - Forum software by © MyBB