Template customization and bootstrap.

  • Posts: 61
  • Thank you received: 0
7 years 6 months ago #251112

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6

During template development we met a problem that not all Hikashop files could be overrided in the template html directory. Part of html markup and javascript is mixed with code, besides in the admin files of Joomla.
This applies to files from directory /administrator/components/com_hikashop/helpers/ , for example, cart.php
Also I would like to ask, how we can choose Bootstrap version? Now we can do it only in /administrator/components/com_hikashop/helpers/helper.php:3507 but it will be rewritten after updade. How we can manage it?

Last edit: 7 years 6 months ago by DimLVL.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
7 years 6 months ago #251133

Hi,

The cart.php file stuff can be overridden by the template too. We have documentation explaining that here:
www.hikashop.com/support/documentation/6...tation.html#override
It's also possible to copy/paste the original class somewhere in your template and have it load before the default one or have your class extend the default one.

Regarding the bootstrap choice, as you can see, it bases itself on the setting "bootstrap_design"
So you could force that value yourself in the hikashop_config table.
And you would want to also add the value in the dropdown of the HikaShop configuration with an override of the "display" file of the "config" view that you would put in the default template of the backend.

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

  • Posts: 61
  • Thank you received: 0
7 years 6 months ago #251244

Thanks for reply, nicolas.
Can you tell me, please, if the file and class names are correct in that example?:

Original name/address
/administrator/components/com_hikashop/helpers/cart.php
hikashopCartHelper


Override:
/templates/mytemplate/html/com_hikashop/administrator/helpers.cart.override.php
hikashopCartHelperOverride

File with an override is not loading. Is there any mistake?

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
7 years 6 months ago #251249

Hi,

For more details about class override (and the correct file path), please see :
www.hikashop.com/forum/product-category-...atermark.html#184987

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 61
  • Thank you received: 0
7 years 6 months ago #251393

Thanks for reply, it was useful. Here
www.hikashop.com/support/documentation/6...tation.html#override
is written:
«You can do it by copying the file in administrator/components/com_hikashop/XXXX/yyy.php to templates/YOUR_TEMPLATE/html/com_hikashop/admnistrator/XXXX.yyy.override.php (for the frontend)»

An error was that between XXXX.yyy instead of "." should be slash.

Class methods overriding happens even when it's initialized, and without including to the parent class, just like:

class hikashopImageHelperOverride {

}
That means without «include» and «extends». Is it possible to use that way?

Last edit: 7 years 6 months ago by DimLVL.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
7 years 6 months ago #251396

Hi,

If you don't want to include the original file in order to extend it ; you can.
But in that case you have to copy the full content of the class into your override and you have to be sure that, if the core class is updated (receive new functions) your override also include them.

That's why, I would highly recommend to use the include + extends ; otherwise I am quite sure that you will have some issues with updates.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: DimLVL

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

Time to create page: 0.070 seconds
Powered by Kunena Forum