Template overrides for Quantity Inputs and Buttons

  • Posts: 82
  • Thank you received: 1
11 years 3 months ago #113572

Trying to create a template override following the documentation for the Quantity Inputs and Buttons.
Whatever I tried looks like not possible to load the template override.
Documentation:
Create the hikashop_button.php in "templates/template/html/com_hikashop/ folder.
File created.
Then define the Function "hikashop_quantity_render($html,$i,$max_quantity,$min_quantity)". Function defined.
But I can't see anyway that it 's being used.

In administrator/compo.../hika../helpers/cart.php, I even set the if ($this->override && function_exists()) { }
to if($this->override) {$html = "myname" }, to see if it can see the template override but no luck...
Isn't supposed to be able to see the override, since it exists in the template folder ?

What am I missing here ?

Can someone confirm that the documentation is right ? I just created a clean Joomla and Hikashop Install to try and Template Overrides doesn't look to work, at least with the way described in the Documentation.

Last edit: 11 years 3 months ago by jmbgreen. Reason: SOLVED

Please Log in or Create an account to join the conversation.

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
11 years 3 months ago #113616

Hi,

As stated in the developer documentation, the hikashop_button.php file needs to be in the folder templates/YOUR_TEMPLATE/html while you put it in the folder templates/template/html/com_hikashop which is not correct.

If the file is not at the correct place, the system won't find it and won't do any override.

The following user(s) said Thank You: jmbgreen

Please Log in or Create an account to join the conversation.

  • Posts: 82
  • Thank you received: 1
11 years 3 months ago #113648

Hey Nicolas!
Thank you - Thank you - Thank you...

I was blind! I read dozens of times the documentation - and mind wanted to see other than whats is written.
Thank you that pointed out my obvious mistake...

Please Log in or Create an account to join the conversation.

  • Posts: 82
  • Thank you received: 1
11 years 3 months ago #113685

Hello again,

following the previous post, I have came across this situation:

I see that the "Add to Cart" and the "Product Contact Us" links are rendering from the same function: hikashop_button_render.

I want to customize each of these links. Actually, wanted to add a title and an extra text for the add to cart link. I did that on the "hikashop_button_render" function, but it applies to both the links.

So the question is, how can I modify only the Add to Cart link, without affecting the Contact Us link ? Which is the file that generates the parameters of the buttons function for each of these items ?

*let me know if this should be a different thread ...
Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82
  • Thank you received: 1
11 years 3 months ago #113697

do bot bother...
I found my way around...

Just to help anyone else, I wrote an if statement for one of the parameters of the function and created a different html output based on the if result.

**Very new to hikashop... but think this relationship will last for long time!

Last edit: 11 years 3 months ago by jmbgreen. Reason: Solution
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum