/** * Generates a ShopgateCartItem for the checkCart Response * * @param Mage_Catalog_Model_Product $product * @param boolean $isBuyable * @param int $qtyBuyable * @param int|float $priceExclTax * @param int|float $priceInclTax * @param array $errors * @param bool $stockQuantity * * @return ShopgateCartItem */ public function generateShopgateCartItem($product, $isBuyable = false, $qtyBuyable = 0, $priceInclTax = 0, $priceExclTax = 0, $errors = array(), $stockQuantity = false) { $item = new ShopgateCartItem(); $item->setItemNumber($product->getShopgateItemNumber()); $item->setOptions($product->getShopgateOptions()); $item->setInputs($product->getShopgateInputs()); $item->setAttributes($product->getShhopgateAttributes()); $item->setIsBuyable((int) $isBuyable); $item->setQtyBuyable($qtyBuyable); $item->setStockQuantity($stockQuantity); $item->setUnitAmount($priceExclTax); $item->setUnitAmountWithTax($priceInclTax); foreach ($errors as $error) { $item->setError($error['type']); $item->setErrorText($error['message']); } return $item; }