/** * process images */ function processImages($product) { /** * product image conf */ require_once 'models/ecommerce/ecommerce_product_image.php'; $ecommerce_product_image_conf = ecommerce_product_image::initConfiguration(); /** * image width */ if (is_numeric($this->GET['image_width'])) { $image_width = $this->GET['image_width']; } else { $image_width = $GLOBALS['onxshop_conf']['global']['product_detail_image_width']; } $this->tpl->assign("IMAGE_WIDTH", $image_width); //for full product detail (product_radio), use image_gallery if ($template_block == 'product_radio') { switch ($GLOBALS['onxshop_conf']['global']['product_image_gallery']) { case 'simple_list': $image_controller = 'component/image'; break; case 'gallery': $image_controller = 'component/image_gallery'; break; case 'gallery_smooth': default: $image_controller = 'component/image_gallery_smooth'; break; } $image_limit = '0,1'; } else { $image_controller = 'component/image'; $image_limit = '0,1'; } $cycle = array(); $cycle['fx'] = $ecommerce_product_image_conf['cycle_fx']; $cycle['easing'] = $ecommerce_product_image_conf['cycle_easing']; $cycle['timeout'] = $ecommerce_product_image_conf['cycle_timeout']; $cycle['speed'] = $ecommerce_product_image_conf['cycle_speed']; $Image = new Onxshop_Request("{$image_controller}&relation=product&role=main&width={$image_width}&node_id={$product['id']}&limit={$image_limit}&cycle_fx={$cycle['fx']}&cycle_easing={$cycle['easing']}&cycle_timeout={$cycle['timeout']}&cycle_speed={$cycle['speed']}"); $this->tpl->assign('PRODUCT_IMAGE', $Image->getContent()); /** * variety image */ //$Image = new Onxshop_Request("image&relation=product_variety&role=main&node_id={$product['variety'][0]['id']}&limit=0,1"); //$this->tpl->assign('IMAGE_VARIETY', $Image->getContent()); }
/** * hook before parsing */ public function parseContentTagsBeforeHook() { /** * set active pages */ $this->setActivePages(); /** * pass GET.product_id into template */ require_once 'models/common/common_node.php'; $Node = new common_node(); $node_data = $Node->nodeDetail($this->GET['id']); $this->GET['product_id'] = $node_data['content']; /** * pass GET.image_width into template */ //include product image conf require_once 'models/ecommerce/ecommerce_product_image.php'; $ecommerce_product_image_conf = ecommerce_product_image::initConfiguration(); if (is_numeric($this->GET['image_width'])) { $image_width = $this->GET['image_width']; } else { $image_width = $GLOBALS['onxshop_conf']['global']['product_detail_image_width']; } $this->GET['image_width'] = $image_width; return true; }