Help understanding TPL Hooking

Hi, I’ve been trying to modify a bit of the Vendor Panel in CS-Cart.
There is this hook {hook name="index:finance_statistic_balance"} in the vendor panel, which I want to completely override, so I tried the following:
1.-Created a “TPL Hook” in my_changes:
(/design/backend/templates/addons/my_changes/hooks/index/finance_statistic_balance.override.tpl)
2.-Tried to replace the hook with a simple “Hello World”. No changes at all.

So far, I’ve also tried with dashboard/finance_statistic_balance.override.tpl but I got the same result.
Also tried to clear cache, same thing.
As a fun fact, I’ve tried to change the core code with plain HTML and still did not show up in my page.
The hook its located in /design/backend/templates/views/index/components/dashboard.tpl

Thanks in advance for the help!

  • try to delete the var/cache directory manually
  • check new file permissions
  • another module with higher priority can override the same hook
1 Like

Hi, thanks for your reply.
·Already deleted cache.
·What do you mean checking new files permissions?
·I put my module the higher priority I could think of (9999999999) and still nothing.

If it matters, Im trying to override one of the Balance sections in the Vendor Panel.

It is required to examine issue directly on your server in this case

Thanks for the reply, changing permissions on files did not help.
I still dont know what is happening because Im doing what I already did to add a logo to the Login Form and that works fine
The bit of code Im trying to replace is here

<div class="dashboard-card dashboard-card--balance">
                        <div class="dashboard-card-title">{__("vendor_payouts.current_balance_text")}</div>
                        <div class="dashboard-card-content">
                            <h3>
                               <!-- This Hook right here -->
                                {hook name="index:finance_statistic_balance"}
                                    <a href="{"companies.balance"|fn_url}"
                                    >{include file="common/price.tpl" value=$current_balance}</a>
                                {/hook}
                            </h3>
                            &nbsp;
                        </div>
                    </div>

Ok, looks like it wasnt that file the one I wanted to edit, but I wanted to edit a specif div in a component

In: /design/backend/templates/views/index/components/analytics_section/analytics_section.tpl

<div class="analytics-section__column analytics-section__column--tertiary">
                    {foreach $analytics_data.tertiary as $analytics_card}
                        {include file="views/index/components/analytics_section/analytics_card/analytics_card.tpl"}
                    {/foreach}
                </div>

I just want to change the amount of balance to that of the vendor Stripe account.
Im guessing Im going to have to modify the core files then?

So, I’m curious you said * another module with higher priority can override the same hook.

My question is, how do I make sure none of the other modules affect or override the same hook?
How do I block this other module from affecting my hooks?

As I understand, you just have to set a higher priority in the addon.xml file.

2 Likes

But please note that the module should be re-installed after this action since the priority value is stored in the database

2 Likes

Thanks for that, I tried to reload the addon thinking it was the same as uninstalling and reinstalling.
It worked when I did it manually.
Thanks!

2 Likes