Hook: storeCartItemInOrder

Wenn beim Bestellabschluss die Warenkorbpositionen zur Speicherung im Bestelldatensatz vorbereitet werden

/*
 * -- Registration: --
 * $GLOBALS['MERCONIS_HOOKS']['storeCartItemInOrder'][] = array('myMerconisHookClass', 'myStoreCartItemInOrder');
 *
 * -- Invocation: --
 * When the order is being created during checkout and a cart item is written
 * to the order record.
 *
 * -- Parameters: --
 *	1. $arr_item - an array holding the cart item data that has been processed so far
 *	2. $obj_product - the product object which holds product information that can be used to extend the data stored in $arr_item
 *
 * -- Return value: --
 * $arr_item
 *
 * -- Objective: --
 * e.g. extending the cart item data that is stored in an order record
 *  
 */

public function myStoreCartItemInOrder($arr_item, $obj_product) {

	/*
	 * In this example, we assume that we created a custom extension that
	 * extended the product's mainData by adding an "isUsed" flag and an
	 * "isSinglePiece" flag. We want both flags to be accessible in a finished
	 * order.
	 *
	 * We use the "extendedInfo" key of $arr_item to store the data because
	 * this key is already provided for exactly this reason.
	 */
	
	$arr_item['extendedInfo']['_isUsed'] = $obj_product->mainData['customMerconisExtension_isUsed'] ? true : false;
	$arr_item['extendedInfo']['_isSinglePiece'] = $obj_product->mainData['customMerconisExtension_isSinglePiece'] ? true : false;
	
	return $arr_item;
}