예제 #1
0
파일: Cart.php 프로젝트: jeffhorus/sepatuku
 function getItemTitle($item, $withHtml = FALSE, $options = array(), $renderer = NULL)
 {
     return Helper_Cart::getItemTitle($item, $withHtml, $options, $renderer, $this);
 }
예제 #2
0
파일: Cart.php 프로젝트: jeffhorus/sepatuku
 static function _cartItemToSoldProduct($controller, $item, $soldProductType)
 {
     $quantity = $item['quantity'];
     $item_name = Helper_Cart::getItemTitle($item);
     $orderedId = Helper_Structure::getArrayValue($item, 'ordered_id');
     $sold = NULL;
     if ($controller) {
         $sold = $controller->getSingleObject('orders', 'getOrderedProductById', array($orderedId));
     }
     if (!$sold) {
         $sold = new $soldProductType();
     }
     $sold->setTitle($item_name);
     $sold->setQuantity($quantity);
     $sold->setPrice($item['price']);
     $sold->setProductFid($item['fid']);
     if (method_exists($sold, 'setImageUrl')) {
         $imageUrl = Helper_Structure::getArrayValue($item, 'image');
         if (!empty($item['options']['_image_url'])) {
             $imageUrl = $item['options']['_image_url'];
         }
         $sold->setImageUrl($imageUrl);
     }
     for ($i = 1; $i <= 5; $i++) {
         if (!empty($item['options']["_attribute{$i}"])) {
             $setMethod = "setAttribute{$i}";
             $sold->{$setMethod}($item['options']["_attribute{$i}"]);
         }
     }
     if (method_exists($sold, 'setProductCode') && isset($item['product_code'])) {
         $sold->setProductCode($item['product_code']);
     }
     return $sold;
 }