Jump to content

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

How To Override Tpl That Already Overridden Rate Topic   - - - - -

 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 08 July 2020 - 04:23 PM #1

Dear All,

 

The following file is the origin location;

 

/design/themes/responsive/templates/addons/step_by_step_checkout/overrides/views/checkout/components/steps/step_two.tpl

 

Now, I want to override the step_two file again in the following location;

/design/themes/responsive/templates/addons/my_changes/overrides/views/checkout/components/steps/step_two.tpl

 

How to achieve on this.

 

Can you kindly advise.

 

Thanks a lot.

 

 



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1204 posts

Posted 08 July 2020 - 11:10 PM #2

Hello

 

Please try in your addon file addon.xml set <priority>4294967295</priority>

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 09 July 2020 - 02:23 AM #3

Dear Robert,

 

Thanks a lot for your reply.

 

I have modified the priority value in addon.xml under my_changes folder. But the website still doesn't take the file from my_changes add on.

 

Kindly advise. Thanks.

 

https://prnt.sc/tefx7w\

 

Regards,

Ram



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

Posted 09 July 2020 - 06:05 AM #4

After priority is changed, you should re-install the module. As alternative, find priority in the database and change it there. Then clear cache


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    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 09 July 2020 - 07:14 AM #5

Hi eComLabs,

 

Thanks for the reply.

 

Have re-installed the My_changes addon, but still doesn't reflect the step_two file from My_changes addon.

 

I guess, I have missed some steps. Since am new to a CS cart, Could you please explain in detail;

 

Step_by_step_checkout addon from app detail:

public_html/app/addons/step_by_step_checkout/addon.xml       

screenshot: https://prnt.sc/tejaze

 

My_changes addon from app details:

/public_html/app/addons/my_changes/addon.xml     

screenshot: https://prnt.sc/tejcdj

https://prnt.sc/tejd57

 

Kindly help. Thanks much.



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1204 posts

Posted 09 July 2020 - 07:53 AM #6

Hello

 

Please check in table cscart_addons what priority my_changes addon has. Maybe some other addon overwrites the template ? Try to delete the /var/cache directory directly on the server.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 09 July 2020 - 08:13 AM #7

Hi Robert,

 

Please refer to the screenshot of cscart_addons table https://prnt.sc/tekdab

 

Yes, I always delete the cache directly on the server.

 

The following file only is always reflect on the page.

/design/themes/responsive/templates/addons/step_by_step_checkout/overrides/views/checkout/components/steps/step_two.tpl

 

But expected file is from the following path;

/design/themes/responsive/templates/addons/my_changes/overrides/views/checkout/components/steps/step_two.tpl

 

 

Kindly note: I have another tpl under my_changes which is working fine, but this is overriding once only under my_changes.

 

Please help.

 

Thanks.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11660 posts

Posted 09 July 2020 - 07:00 PM #8

What is the priority of the my_changes addon in your cscart_addons DB table?  It should be the largest number in there.  I.e. highest priority.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 10 July 2020 - 12:12 AM #9

Good morning All,

 

Hi EZ,

 

Thank you for helping on this.

 

Confirmed that my_changes contains the highest value in the priority among others.

 

Pls refer the screenshot below;

https://prnt.sc/tekdab

 

 

Thanks



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1204 posts

Posted 10 July 2020 - 08:12 AM #10

Hello

 

Please sort the addons by priority from the highest and show this list.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 10 July 2020 - 08:47 AM #11

 Hi Robert,

 

Appreciate your help.

 

Have been trying to sort out the issue over 1 and half days. :) but no luck.

 

Please refer to the attached file as requested.

 

Kindly advise. Thanks a lot for the help.

Attached Files



 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 10 July 2020 - 10:40 AM #12

Hi,

 

Have confirmed that my_changes addon contains the highest priority value in cscart_addons table and cleared the browser cache, server's cache, but no luck.

 

My expected changes appear properly, when I manually highlighted for the my_changes' folder path on the template file of step_by_step_checkout addon, but it is a bad practice for modifying on the original file.

 

Noticed that since this file is already overridden from other add on, I can't override again on the my_changes addon. Alternatively, how to override a template file on my_changes addon which is already an overridden template file from other addon?

 

Can I achieve this using hooks since I am unable to fix it by using override mechanism.

 

 

Kindly advise. Thanks



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1204 posts

Posted 10 July 2020 - 12:35 PM #13

Hello

 

It depends what you want to do. If the hook includes the code you want to change then you can use it.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11660 posts

Posted 11 July 2020 - 07:01 PM #14

Are you using an "override hook" or a tempalte override?

An override hook is applied in a cascading fashion.  Hence the coder of the hook needs to include the hook for other addons to utilize it.  Note that when an override hook is used, any 'pre' hooks of the same name are preserved but any 'post' hooks are discarded.

 

If you are using a template override file then the file is determined by the addon priority.

 

So if core file named views/ugh/cart_file.tpl code contains:

{hook name="foo:bar"}
this is original code
{/hook}

then using my_changes/hooks/foo/bar.override.tpl with code of\:

{hook name="foo:bar"}
this is my code
{/hook}

should produce output of "this is my code".

 

If you are overriding the template by using my_changes/overrides/ugh/cart_file.tpl

then it will have whatever content the priority of the my_changes addon provides in relation to other addons.

If it contains a 

{hook name="foo:bar"}
my override code
{/hook}

Then another addon can pre, post or override that hook like the first examle.

 

Suggest you add some comments to your code to see what's going on.  I.e.

<!-- In file bar.override.tpl --
or
<!-- in override file cart_file.tpl -->

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 13 July 2020 - 05:39 AM #15

Hi EZ,

 

Thanks so much for your valuable timing. I want to override a template only.

 

Understand from other thread that I can't override template file again which is already overridden by other addon. So, I will change to single checkout page instead of multiple checkout page, since I have encountered more issues.

 

https://forum.cs-car...n/?fromsearch=1

 

 

Thanks a lot for all of your help.



 
  • muthu.amr
  • Member
  • Members
  • Join Date: 05-Jul 20
  • 16 posts

Posted 16 July 2020 - 08:50 AM #16

Thanks a lot to SoftSolid team for personally supported to fix on the override issue. Really very thankful for your support.

 

Understood my issue that I need to keep the priority value is 0 for the "my_changes" addon in the cscart_addons table. Then, it solves my override problem.

 

Thank you all for your valuable timing to help on this and thanks to SoftSolid team as well.



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1204 posts

Posted 16 July 2020 - 01:07 PM #17

Hello

 

You are welcome :)

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11660 posts

Posted 16 July 2020 - 06:37 PM #18

Note that priorities have different results for php hooks and template hooks.  Higher priority values have your php hook go first in the chain.  And for templates, the higher priorites go first (which means they can be overwritten).  So if you want my_changes hooks to always be dominant, use fn_register_hooks(array('place_order', [high priority number]) ) and have the priority in cscart_addons be zero.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.