当前位置: 首页>>代码示例>>PHP>>正文


PHP common_node::getProductNodeHomepage方法代码示例

本文整理汇总了PHP中common_node::getProductNodeHomepage方法的典型用法代码示例。如果您正苦于以下问题:PHP common_node::getProductNodeHomepage方法的具体用法?PHP common_node::getProductNodeHomepage怎么用?PHP common_node::getProductNodeHomepage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common_node的用法示例。


在下文中一共展示了common_node::getProductNodeHomepage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     if ($this->GET['to']) {
         header("HTTP/1.1 301 Moved Permanently");
         onxshopGoTo($this->GET['to']);
     } else {
         if (is_numeric($this->GET['product_id'])) {
             header("HTTP/1.1 301 Moved Permanently");
             require_once 'models/common/common_node.php';
             $Node = new common_node();
             $product_homepage = $Node->getProductNodeHomepage($this->GET['product_id']);
             if (is_array($product_homepage)) {
                 onxshopGoTo("/page/{$product_homepage['id']}");
             } else {
                 msg("Product no longer available");
                 onxshopGoTo("/");
             }
         } else {
             if (is_numeric($this->GET['recipe_id'])) {
                 header("HTTP/1.1 301 Moved Permanently");
                 require_once 'models/common/common_node.php';
                 $Node = new common_node();
                 $recipe_homepage = $Node->getRecipeNodeHomepage($this->GET['recipe_id']);
                 if (is_array($recipe_homepage)) {
                     onxshopGoTo("/page/{$recipe_homepage['id']}");
                 } else {
                     msg("Recipe no longer available");
                     onxshopGoTo("/");
                 }
             } else {
                 if (is_numeric($this->GET['store_id'])) {
                     header("HTTP/1.1 301 Moved Permanently");
                     require_once 'models/ecommerce/ecommerce_store.php';
                     $Store = new ecommerce_store();
                     $store_homepage = $Store->getStoreHomepage($this->GET['store_id']);
                     if (is_array($store_homepage)) {
                         onxshopGoTo("/page/{$store_homepage['id']}");
                     } else {
                         msg("Store no longer available");
                         onxshopGoTo("/");
                     }
                 }
             }
         }
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:50,代码来源:forward.php

示例2: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * initialize
      */
     require_once 'models/ecommerce/ecommerce_product.php';
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $Product = new ecommerce_product();
     /**
      * get node detail
      */
     $node_data = $Node->nodeDetail($this->GET['id']);
     $product_id = $node_data['content'];
     /**
      * Check if this is a product homepage
      */
     $product_node_homepage = $Node->getProductNodeHomepage($product_id);
     if ($node_data['id'] != $product_node_homepage['id']) {
         //forward to homepage
         $link = $Node->getSeoURL($product_node_homepage['id']);
         header("HTTP/1.1 301 Moved Permanently");
         header("Location: http://{$_SERVER['SERVER_NAME']}{$link}");
         exit;
     }
     /**
      * get simple product detail (just for basic product attributes)
      */
     $simple_product_detail = $Product->detail($product_id);
     /**
      * get taxonomy_class
      */
     $related_taxonomy = $Product->getRelatedTaxonomy($product_id);
     $simple_product_detail['taxonomy_class'] = $this->createTaxonomyClass($related_taxonomy);
     /**
      * save product taxonomy_class to registry
      */
     $this->saveBodyCssClass($simple_product_detail['taxonomy_class']);
     /**
      * assign simple product data to template
      */
     $this->tpl->assign("PRODUCT", $simple_product_detail);
     /**
      * varieties
      */
     //$Variety_list = new Onxshop_Request("component/ecommerce/variety_list_ajax~product_id={$product_id}~");
     //$this->tpl->assign('VARIETY_LIST', $Variety_list->getContent());
     /**
      * taxonomy
      */
     $_Onxshop_Request = new Onxshop_Request("component/taxonomy~relation=product:id={$product_id}:hide_root=1~");
     $this->tpl->assign('TAXONOMY', $_Onxshop_Request->getContent());
     /**
      * other product attributes
      */
     $_Onxshop_Request = new Onxshop_Request("component/ecommerce/product_other_data~id={$product_id}~");
     $this->tpl->assign('OTHER_DATA', $_Onxshop_Request->getContent());
     /**
      * product reviews
      */
     $_Onxshop_Request = new Onxshop_Request("component/ecommerce/product_review~node_id={$product_id}:allow_anonymouse_submit=0~");
     $this->tpl->assign('PRODUCT_REVIEW', $_Onxshop_Request->getContent());
     /**
      * standard page actions
      */
     $this->processContainers();
     $this->processPage();
     if (strlen($simple_product_detail['name_aka']) > 0) {
         $this->tpl->parse('content.name_aka');
     }
     /**
      * everything went well
      */
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:78,代码来源:product.php


注:本文中的common_node::getProductNodeHomepage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。