Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Banners Addon Tpl Hooks Rate Topic   - - - - -

 
  • siarlis
  • Junior Member
  • Members
  • Join Date: 26-Feb 10
  • 6 posts

Posted 25 June 2019 - 02:50 PM #1

Does anyone have successfully used the TPL hooks from banners addons ?

 

I am trying to use the banners:general_content hook that exists inside (design/backend/templates/addons/banners/views/banners/update.tpl) but without any luck.

 

I have tried to place the hook inside

design/backend/templates/my_changes/hooks/banners/general_content.tpl but it returns a blank page …  - No errors in logs

 

I have successfully created a PHP hook for get_banner_data function but template hooks refuses to work .

 

Any idea ?

 



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 855 posts

Posted 25 June 2019 - 04:18 PM #2

Hello

 

1 . Have you created your own addon or are you using my_changes ?

2. Are you sure you've put the files in addon that you want to handle hooka tpl? Check the path.

3. Clear cache

4. Remove from the server directly catalog /var/cache

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19698 posts

Posted 26 June 2019 - 05:31 AM #3

The correct path and file name should be

design/backend/templates/addons/my_changes/hooks/banners/general_content.post.tpl


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • siarlis
  • Junior Member
  • Members
  • Join Date: 26-Feb 10
  • 6 posts

Posted 26 June 2019 - 06:41 AM #4

Hello Again,

 

Thank you for your responses Ecomlabs , Soft Solid ,

 

The path was correct just forgot to write down the addon directory.

 

The general_content.post.tpl and general_content.pre.tpl Hooks not work for some reason ! Just return a blank template.

 

The solution was to use the general_content.override.tpl and Refresh the Banner Addon from Manage-addons section.

 

Without refreshing the addon – Clearing the cache from admin panel or deleting the /var/cache folder doesn’t have any result.

 

Thank you !



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19698 posts

Posted 26 June 2019 - 12:15 PM #5

It means that some 3rd party addon overrides this hook earlier. Try to temporary disable 3rd party addon and check the result


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • arnas00
  • Newbie
  • Members
  • Join Date: 25-Jun 19
  • 9 posts

Posted 26 June 2019 - 03:32 PM #6

I had a similar issue with a `scripts.post.tpl` template hook in my own addon, for the addons management section of the backend. I will try the last solution from eComLabs because it sounds to me that that's the problem.



 
  • arnas00
  • Newbie
  • Members
  • Join Date: 25-Jun 19
  • 9 posts

Posted 26 June 2019 - 03:45 PM #7

It means that some 3rd party addon overrides this hook earlier. Try to temporary disable 3rd party addon and check the result

 

If that's the case, how can you deal with another addon competting for the same hook than my addon?



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 855 posts

Posted 27 June 2019 - 06:30 PM #8

Hello

 

In you addon.xml set  <priority>4294967295</priority>

You will be sure that your addon will be loaded last

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19698 posts

Posted 28 June 2019 - 05:33 AM #9

If that's the case, how can you deal with another addon competting for the same hook than my addon?

 

Yes, you can add solution from post #8. But do not forget to add template from that addon to your template. E.g.

{if $addons.my_changes.status == 'A'}
    {include file="addons/my_changes/hooks/pages/detailed_description.override.tpl"}
{/if}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.