/** * Find homepage of product */ function getProductNodeHomepage($product_id) { if (!is_numeric($product_id)) { msg("Node->getProductNodeHomepage({$product_id}) is not numeric", 'error'); return false; } else { require_once "models/ecommerce/ecommerce_product.php"; $Product = new ecommerce_product(); $homepage = $Product->getProductHomepage($product_id); return $homepage; } }
protected function getProductInfo($product_variety_id) { // cache_local product info $key = "product_variety_id_{$product_variety_id}"; if (isset($this->cache_local[$key])) { return $this->cache_local[$key]; } require_once 'models/ecommerce/ecommerce_product.php'; $Product = new ecommerce_product(); $variety = $Product->getProductVarietyDetail($product_variety_id); $product = $Product->productDetail($variety['product_id']); $homepage = $Product->getProductHomepage($variety['product_id']); $product['url'] = translateURL('page/' . $homepage['id']); $Image = new Onxshop_Request("component/image&relation=product&role=main&width=120&node_id={$product['id']}&limit=0,1"); $product['variety'] = $variety; $product['image'] = $Image->getContent(); $this->cache_local[$key] = $product; return $product; }