Back to PhocacartCart class

Method updateItemsFromCheckout

public
updateItemsFromCheckout
(mixed $idKey = '', mixed $quantity = 0)

Method updateItemsFromCheckout - Source code

/*
 * UPDATE - public function to update from CHECKOUT (update, remove buttons)
 */
public function updateItemsFromCheckout($idKey = '', $quantity = 0)
{
    // Don't check for quantity as it can be NULL
    if ($idKey != '' && (int) $quantity > 0) {
        $this->items[$idKey]['quantity'] = (int) $quantity;
        $this->updateItems();
        return true;
    } else {
        if ($idKey != '' && (int) $quantity == 0) {
            unset($this->items[$idKey]);
            $this->updateItems();
            return true;
        }
    }
}