Jump to content

[Sloved]如何将 right column 的模块植入 center column


Guest Steven_king
 Share

Recommended Posts

请教:

我想将top seller ,new products modules 移致首页的 center column.

请教怎么操作,在哪里改?

Share this post


Link to post
Share on other sites

1. BO >> Modules >> Positions >> Remove the original positions and transplant the modules to the hook of Homepage content

2. Alter CSS and smarty templates of the modules if necessary, on a basis of the layout of center column at homepage

ps. Sorry that Im not able to type Chinese until I get the full access to my laptop.

Share this post


Link to post
Share on other sites

谢谢,
第一步已经尝试过了,无法直接达到想要的效果。

问题估计在第二步,在install这两模块时就需指定植入首页的那个column了,

参考相关代码如下,

以"\modules\blockbestsellers\blockbestsellers.php"为例

    public function install()
   {
       if (!parent::install() OR
           !$this->registerHook('rightColumn') OR
           !$this->registerHook('updateOrderStatus') OR
           !ProductSale::fillProductSales())
               return false;
           return true;
   }



   function hookRightColumn($params)
   {
       global $smarty;
       $currency = new Currency(intval($params['cookie']->id_currency));
       $bestsellers = ProductSale::getBestSalesLight(intval($params['cookie']->id_lang), 0, 5);

       $best_sellers = array();
       foreach ($bestsellers AS $bestseller)
       {
           $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product'])), $currency);
           $best_sellers[] = $bestseller;
       }
       $smarty->assign(array(
           'best_sellers' => $best_sellers,
           'mediumSize' => Image::getSize('medium')));
       return $this->display(__FILE__, 'blockbestsellers.tpl');
   }




   function hookLeftColumn($params)
   {
       return $this->hookRightColumn($params);
   }



但不知道怎么修改,请指教

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More