wpsc_edit_item

Located in: cart.class.php

Functions that call this hook: wpsc_cart::set_item()

Arguments Accepted: $product_id, $parameters, $wpsc_cart

Version Introduced: 3.8.9

Description: This action is triggered when a cart item is edited (e.g. quantity).

Code in context:

[php firstline=”856″ highlight=”875″]

foreach($this->cart_items as $key => $cart_item) {

// compare product ids and variations.

if(($cart_item->product_id == $new_cart_item->product_id) &&

($cart_item->product_variations == $new_cart_item->product_variations) &&

($cart_item->custom_message == $new_cart_item->custom_message) &&

($cart_item->custom_file == $new_cart_item->custom_file)) {

// if they are the same, increment the count, and break out;

if(!$updater){

$this->cart_items[$key]->quantity += $new_cart_item->quantity;

} else {

$this->cart_items[$key]->quantity = $new_cart_item->quantity;

}

$this->cart_items[$key]->refresh_item();

$add_item = false;

$edit_item = true;

do_action(‘wpsc_edit_item’ , $product_id , $parameters , $this);

}

}

[/php]