Overrides For Tpl

Hi all,

I have been trying to modify Vendor panel, I am a bit lost how it should be done. As per the documentation here : https://docs.cs-cart.com/latest/developer_guide/addons/hooking/tpl_hooks.html

  • Administration panel: design/backend/templates/addons/[addon id]/hooks/[template name]/[hook name].[pre|post|override].tpl
  • Customer area: design/themes/[theme name]/templates/addons/[addon id]/hooks/[template name]/[hook name].[pre|post|override].tpl

We should use above paths but in my case it worked with path "overrides".

I can't say it fully worked tho. I was able to display on UI some fields like maximum quantity conditionally but fields like promo text , search words are still visible even though when I remove from overrides tpl file.

Can somebody help me to understand what is the logic for override files and why it works randomly.

Thank you in advance!

Do you modify new or old vendor panel? It depends on Multi-Vendor version you use

Hi ,

I use 4.13.3 version.

Thank you for help in advance

In your version the design/backend/ path is used both for admin and vendor panel. But if your addon overrides template or hook, other addon with higher priority can do the same action

Thank you for the answer. Just to double check if I am on the right track;

In order to change (like removing some fields as like as Maximum Quantity , Availability Search Words , Promo Text etc. on Vendor panel on Product Add page) I should create such a file as below :

design/backend/templates/addons/my_changes/overrides/views/products/update.tpl

Could you please confirm if this will do the trick because it didn't work for me.

Thank you for the answer. Just to double check if I am on the right track;

In order to change (like removing some fields as like as Maximum Quantity , Availability Search Words , Promo Text etc. on Vendor panel on Product Add page) I should create such a file as below :

design/backend/templates/addons/my_changes/overrides/views/products/update.tpl

Could you please confirm if this will do the trick because it didn't work for me.

Yes, you are on the right path. Do not forget to clear cache (both cc and ctpl) after new template is added

Thank you so much ! That worked partially! I was able to hide some pieces like Extra section , max qty etc. but it didn't work for Zero Price Action and fields of Availability . do you know why is this random behaviour?

Another question if I can kindly ask:

1) How do I disable some of the menu tabs like SEO etc from Vendor menu only?

2) If I hide some fields on product add page like VAT and would like to set this by default to Selected under the hood , what is the best practice here recommended?

Thank you so much ! That worked partially! I was able to hide some pieces like Extra section , max qty etc. but it didn't work for Zero Price Action and fields of Availability . do you know why is this random behaviour?

It is hard to say without examination

1) How do I disable some of the menu tabs like SEO etc from Vendor menu only?

It cannot be done just in templates, php changes are also required

2) If I hide some fields on product add page like VAT and would like to set this by default to Selected under the hood , what is the best practice here recommended?

The easiest way is not to remove this part of template, but hide with styles

This part doesn't work for instance on my tpl , whereas other hooks with same logic could be hidden on same file:

                {if $smarty.const.ACCOUNT_TYPE != 'vendor'}
                {hook name="products:update_product_avail_since"}
                
{include file="common/calendar.tpl" date_id="elm_date_avail_holder" date_name="product_data[avail_since]" date_val=$product_data.avail_since|default:"" start_year=$settings.Company.company_start_year}
{/hook} {/if}