Jump to content

版主, 你知道如何做这吗?


Recommended Posts

1. 首先在你的DB里,加入你自定义的hook,比如(你所用的)"productHeader"

2. 在blockpnav.php里,大概57行后,加入:

   function hookProductHeader($params)
   {
       return $this->hookExtraLeft($params);
   }



3. 在Back Office >> Modules >> Positions里,移除原来的productFooter的hook。

4. Transplant到blockpnav到ProductHeader。这时,你应该在Back Office >> Modules >> Positions >> Product Header里看到它。

5. 在你的模板文件product.tpl里,适当的位置加入:

{if $HOOK_PRODUCT_HEADER}{$HOOK_PRODUCT_HEADER}{/if}



6. 清楚cache后,测试。

Share this post


Link to post
Share on other sites
1. 首先在你的DB里,加入你自定义的hook,比如(你所用的)"productHeader"

2. 在blockpnav.php里,大概57行后,加入:
   function hookProductHeader($params)
   {
       return $this->hookExtraLeft($params);
   }



3. 在Back Office >> Modules >> Positions里,移除原来的productFooter的hook。

4. Transplant到blockpnav到ProductHeader。这时,你应该在Back Office >> Modules >> Positions >> Product Header里看到它。

5. 在你的模板文件product.tpl里,适当的位置加入:

{if $HOOK_PRODUCT_HEADER}{$HOOK_PRODUCT_HEADER}{/if}



6. 清楚cache后,测试。





After I added the
   function hookProductHeader($params)
   {
       return $this->hookExtraLeft($params);
   }

it gave me error.

Fatal error: Cannot redeclare BlockPNav::hookProductHeader() in /home/content/momain/modules/blockpnav/blockpnav.php on line 60


My line 60 is function hookProductHeader($params).


Do you know what is wrong?

Share this post


Link to post
Share on other sites

3. 在Back Office >> Modules >> Positions里(选择Display non-positionnable hook 后),移除之前的hook。

你的应该是在“Extra actions on the product page (left column). - 1 module”里。

Share this post


Link to post
Share on other sites

Okay. I deleted it. And where can I put the codes so that it will show as the image.

{if $HOOK_PRODUCT_HEADER}{$HOOK_PRODUCT_HEADER}{/if} 



I put it in the line 97, and it doesn't show at all.

{include file=$tpl_dir./breadcrumb.tpl}



{$product->name|escape:'htmlall':'UTF-8'}

   {if $confirmation}


       {$confirmation}

   {/if}
 {if $HOOK_PRODUCT_HEADER}{$HOOK_PRODUCT_HEADER}{/if} 
   <!-- right infos-->

       <!-- product img-->

       {if $have_image}
getImageLink($product->link_rewrite, $cover.id_image, 'large')}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic"/>
       {else}
name|escape:'htmlall':'UTF-8'}" />
       {/if}

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
×
×
  • Create New...

Important Information

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