예제 #1
0
 public function creat()
 {
     $urls = array();
     $this->load->model('tool/seo_url');
     $this->load->model('catalog/sitemap');
     foreach ($this->model_catalog_sitemap->getInformations() as $result) {
         $urls[] = array('url' => $this->model_tool_seo_url->rewrite($this->url('information/information&information_id=' . $result['information_id'])), 'name' => $result['title']);
     }
     $results = $this->model_catalog_sitemap->getCategorieForSitemap(0);
     $current_path = '';
     foreach ($results as $result) {
         if (!$current_path) {
             $new_path = $result['category_id'];
         } else {
             $new_path = $current_path . '_' . $result['category_id'];
         }
         $urls[] = array('url' => $this->model_tool_seo_url->rewrite($this->url('product/category&path=' . $new_path)), 'name' => $result['name']);
     }
     $results1 = $this->model_catalog_sitemap->getAllProducts();
     foreach ($results1 as $result) {
         $urls[] = array('url' => $this->model_tool_seo_url->rewrite($this->url('product/product&product_id=' . $result['product_id'])), 'name' => $result['model']);
     }
     $sitemap = new Sitemaps();
     $sitemap->createSitemap($urls, $this->request->post['priority'], $this->request->post['freq']);
     $this->load_language('catalog/sitemap');
     $this->session->data['success'] = $this->language->get('text_success');
     $this->index();
 }
예제 #2
0
 /**
  * Constructor, load parent constructor and set up caches.
  */
 protected function __construct()
 {
     parent::__construct();
     //* Setup Transient names
     add_action('plugins_loaded', array($this, 'setup_transient_names'), 10);
 }