remove a purchased line-item from an order

shopp_rmv_order_line ( $order, $line )

@param int $order (required) the order id to remove the line from
@param int $line (optional default:0) the index of the line to remove
@return bool true on success, false on failure


remove a purchased line-item from an order

This function will delete a purchased item from the order, adjust the order subtotal, shipping total (if the item has an item-level shipping fee associated with it), and the grand total figures. It will also issue an amt-voided order event to void the items balance on the order, if applicable.


// Add item from Product 15

// First get the Price object of the product's single priceline
$Price = shopp_product_variant( 
    array( 'product' => 15 ),

// convert a product price to an item
$Item = shopp_product_variant_to_item ( $Price );

// Add the Item to order 550
$PurchasedItem = shopp_add_order_line( 550, $Item );

// remove the item we just added from order 550
// items are indexed from 0 to n-1
shopp_rmv_order_line ( 550, shopp_order_line_count(550) - 1 )

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.