dongqun9403 2013-05-18 07:04
浏览 57

Prestashop模块挂钩到产品页面

I am developing a module in prestashop. The module has been hooked into left column and right column and its working fine with that. Now I want to show the module output in product footer page. So for that can someone tell me how to hook my module to the product details page? Any help and suggestions will be really appreciable.

My code for leftColumn and rightColumn is like this

 function hookLeftColumn()
  {
    $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
    global $cookie, $smarty;
    $value=array();
    $result="SELECT status,app_id from "._DB_PREFIX_."storeblocks";
    $value=Db::getInstance()->ExecuteS($result);
    $smarty->assign('array',$value);
    $smarty->assign('default',$defaultLanguage);
    return $this->display(__FILE__, 'stores.tpl');
  }

  function hookRightColumn()
  {
    return $this->hookLeftColumn();
  }
  • 写回答

2条回答 默认 最新

  • doudao0660 2013-05-18 11:38
    关注

    For product page, there are several hooks available in PS.

    You can use displayLeftColumnProduct hook, which hooks modules just below the image of the product. You can also use displayRightColumnProduct which is for the right side section.

    Another set of hooks is displayProductTab and displayProductTabContent , which are used for the tabs on the product page.

    If these hooks don't help you, simply, then there are several other ways you can get your results. You can hook your module to any of that hooks which is more suitable for your needs, and then using css position and lft , top etc to move that hook to the required place.

    If that is not a choice, then you will need to create your own hook and then using that hook on the product page. Please read this for creating your own hook

    http://www.programmingtunes.com/creating-new-prestashop-hook/

    Also for a complete list of the hooks in PS, please read this article in PS docs

    http://doc.prestashop.com/display/PS15/Hooks+in+PrestaShop+1.5

    Let me know if you still need any other details.

    Thank you

    评论

报告相同问题?

悬赏问题

  • ¥15 用三极管设计—个共射极放大电路
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示