/**
  * main action
  */
 public function mainAction()
 {
     /**
      * include variety confg
      */
     require_once 'models/ecommerce/ecommerce_product_variety.php';
     $variety_conf = ecommerce_product_variety::initConfiguration();
     $this->tpl->assign('VARIETY_CONF', $variety_conf);
     /**
      * product
      */
     require_once 'models/ecommerce/ecommerce_product.php';
     $Product = new ecommerce_product();
     $product = $Product->getProductDetail($this->GET['id']);
     if (is_array($product['variety'])) {
         foreach ($product['variety'] as $variety) {
             if ($variety['publish'] == 0) {
                 $this->tpl->assign('DISABLED', 'disabled');
             } else {
                 $this->tpl->assign('DISABLED', '');
             }
             $Image = new Onxshop_Request("component/image&relation=product_variety&node_id={$variety['id']}");
             $this->tpl->assign('IMAGE', $Image->getContent());
             $this->tpl->assign('VARIETY', $variety);
             $this->tpl->parse('content.variety');
         }
     } else {
         msg('This product has no variety.');
     }
     return true;
 }
Beispiel #2
0
 /**
  * get gift voucher product detail
  */
 public function getGiftVoucherProductDetail($gift_voucher_product_id)
 {
     $Product = new ecommerce_product();
     $Product->setCacheable(false);
     $gift_voucher_product_detail = $Product->getProductDetail($gift_voucher_product_id);
     return $gift_voucher_product_detail;
 }
 /**
  * formatItem
  */
 public function formatItem($original_item)
 {
     if (!is_array($original_item)) {
         return false;
     }
     $original_item['price_formatted'] = $this->formatPrice($original_item['price'], $original_item['currency_code']);
     require_once 'models/ecommerce/ecommerce_product.php';
     $Product = new ecommerce_product();
     $product_detail = $Product->getProductDetail($original_item['product_id']);
     //print_r($product_detail); exit;
     if ($_SERVER['SSL_PROTOCOL'] || $_SERVER['HTTPS']) {
         $protocol = 'https';
     } else {
         $protocol = 'http';
     }
     $item['id'] = (string) $original_item['offer_id'];
     // from historic reason we need to make this string
     $item['title'] = $product_detail['name'];
     $item['content'] = strip_tags($product_detail['description']);
     $item['url'] = "{$protocol}://{$_SERVER['HTTP_HOST']}/product/{$original_item['product_id']}";
     $item['priority'] = $product_detail['priority'];
     $item['created'] = $product_detail['modified'];
     $item['modified'] = $product_detail['modified'];
     $item['images'] = array("{$protocol}://{$_SERVER['HTTP_HOST']}/thumbnail/180x180/" . $Product->getProductMainImageSrc($original_item['product_id']));
     $item['rondel'] = $this->getRoundelText($original_item);
     $item['rondel_image_url'] = $this->getRoundelImageSource($original_item);
     if ($original_item['price'] > 0) {
         $item['price'] = money_format('%n', $original_item['price']);
     } else {
         $item['price'] = '';
     }
     $item['expiry_date'] = $original_item['group_schedule_end'];
     $item['taxonomy'] = $this->getTaxonomy($original_item['product_id'], $Product);
     $item['product_id'] = $product_detail['variety'][0]['sku'];
     //TODO this is showing only first ones
     //special offer group
     $item['group_id'] = $original_item['group_id'];
     $item['group_title'] = $original_item['group_title'];
     return $item;
 }
 /**
  * get gift wrap product detail
  */
 public function getGiftWrapProductDetail($gift_wrap_product_id)
 {
     $Product = new ecommerce_product();
     $gift_wrap_product_detail = $Product->getProductDetail($gift_wrap_product_id);
     return $gift_wrap_product_detail;
 }