Jump to content

Edit History

ps8modules

ps8modules

Another option with inserting your own hook.

It's terribly simple. Just understand it.
Open up ./themes/classic/templates/catalog/product.tpl

1. find

{block name='product_add_to_cart'}
	{include file='catalog/_partials/product-add-to-cart.tpl'}
{/block}

 

2. add after your block or hook

{block name='my_module'}
	{hook h='myCustomDisplayButton' id_product=$product.id}
{/block}

obrazek.png.949a37a7504d25562f6127568a7143a6.png

 

3. edit your module and add your hook

a) edit install function

public function install() 
{ 
	$this->registerHook('myCustomDisplayButton');
....
....
....

b) edit uninstall function

public function uninstall() 
{ 
	$this->unregisterHook('myCustomDisplayButton');
....
....
....

c) add your hook function

public function hookMyCustomDisplayButton($params)
{
    $idProduct = $params;
	return '<hr><div style="display:block; width:100%;"><div class="btn  btn-primary" style="my-button">Hello Word !</div></div>';
}

 

4. register your hook

 - admin => design => positions

obrazek.png.83d3126a9b868e9e8541e76882e920b0.png

and click to Transplant a module button

obrazek.png.d0d9aa21bb62c97885562095fa36d257.png

 

5. find your module

obrazek.png.8b250e62bab3705ffcc5cf4af4e3a39d.png

 

6. select your new HOOK

 

Result:

obrazek.png.428c2b62c746c3ffe1ab1457ac823cc5.png

ps8modules

ps8modules

It's terribly simple. Just understand it.
Open up ./themes/classic/templates/catalog/product.tpl

1. find

{block name='product_add_to_cart'}
	{include file='catalog/_partials/product-add-to-cart.tpl'}
{/block}

 

2. add after your block or hook

{block name='my_module'}
	{hook h='myCustomDisplayButton' id_product=$product.id}
{/block}

obrazek.png.949a37a7504d25562f6127568a7143a6.png

 

3. edit your module and add your hook

a) edit install function

public function install() 
{ 
	$this->registerHook('myCustomDisplayButton');
....
....
....

b) edit uninstall function

public function uninstall() 
{ 
	$this->unregisterHook('myCustomDisplayButton');
....
....
....

c) add your hook function

public function hookMyCustomDisplayButton($params)
{
    $idProduct = $params;
	return '<hr><div style="display:block; width:100%;"><div class="btn  btn-primary" style="my-button">Hello Word !</div></div>';
}

 

4. register your hook

 - admin => design => positions

obrazek.png.83d3126a9b868e9e8541e76882e920b0.png

and click to Transplant a module button

obrazek.png.d0d9aa21bb62c97885562095fa36d257.png

 

5. find your module

obrazek.png.8b250e62bab3705ffcc5cf4af4e3a39d.png

 

6. select your new HOOK

 

Result:

obrazek.png.428c2b62c746c3ffe1ab1457ac823cc5.png

×
×
  • Create New...