- Posts: 12
- Thank you received: 0
Remove light box and adaptive template issue
I have been using hikashop for a while now and realy like it. But I have 2 questions :
1** how can I remove the ligntbox to show image in real size on the product page?
2** how can I remove the width and height set to the main image on the product page?
I explain : I want to set a max-width and max-height on the main image so I need to remove the height and width set in the html, I have already searched the view file show_block_img.php but can't figure out how to get rid of them. My php skills aren't good enough.
could you tell me if I am looking through the right file or even better what code to edit/remove pls?
Thx in advance.
Dan
Please Log in or Create an account to join the conversation.
For your first question, you can simply edit the view addimage/product and remove the onclick code inside (this one):
Lightbox won't appear anymore.
About your second question, I think the different image options available in the main configuration (system>configuration>main>images) can help you do what you want.
I hope this will help you.
Please Log in or Create an account to join the conversation.
I am wondering if I am missing something important :
first :
I have no file called "addimage" in the product views or in any other folder in the views.
I searched for the string
secondly :
I have tried all combinations in system>configuration>main>images but the images on product page still have a with and height specified in html code, to be clear this is what I want to change :
the code I have on my website for main images on product page is :
I want to remove height and width atribute like this :
I can't figure out how to do that in the administration. Isn't there a view file to modify to guet this goal?
Sorry to insist but this is important for me and would realy like to get it working.
Regards,
Dan
Please Log in or Create an account to join the conversation.
1. The view is in the backend template
2. You can probably edit the view "product / show_block_img" and remove $width and $height of the line:
Please Log in or Create an account to join the conversation.
I found the view! Didn't think the backend templates could change the front end.
I deleted the code as you said but it didn't change anything... exept that I have the barcode instead of the clicked image in the lightbox... :S
For the width and height I had already deleted the with and height as you said but it still is atributed in the html...
If you have a bit of time maybe you could have a look at the product page I uploaded on my server here :
www.dm-webmaster.com/bijoux-femme/i-love...n-argent-925-blanchi
Please Log in or Create an account to join the conversation.
According to your two problems you are perhaps editing the wrong view.
Are yous sure the views you customize are related to your template?
PS: I checked your website and the width/height attribute doesn't appear (and the images are really big)
Please Log in or Create an account to join the conversation.
I'll post here if I manage to get it to work.
Please Log in or Create an account to join the conversation.
I finaly found the file I had to edit to remove the lightbox of main image and thumbnail, this one :
administrator\components\com_hikashop\helpers\image.php
To prevent loading lightbox from thumbnails, I replaced this line :
by this :
and to prevent lightbox loading from the main image I replaced this line :
by this :
The problem is that I can't make these modifications through the view manager in backend so I guess it will be overidden when I update hikashop... I'll have to keep track of these modifications to redo them in that case.
Or is there a way to properly overide this file?
I'm still looking for the height and width atribute on main images, I'll edit tis message when I manage.
Please Log in or Create an account to join the conversation.
If you want to keep your modification for future updates, there is a solution.
First you have to create a folder in templates\YOUR_TEMPLATE\html\com_hikashop\administrator\helpers\
Then just create a file named image.override.php and include this inside:
You can now redefine the function you edited inside the tags, including your modification.
Thus, in case of update, this function will still be used. But you have to be aware that if we modify this function, then your code could became unappropriated.
If for example we add a new variable to the fuction or anything else, the function you edited will still be use and could cause errors in a new feature. So you better keep an eye on this file and think about it if you encounter an error message one day
I hope it helped you!
Please Log in or Create an account to join the conversation.
deleted :
and also deleted :
I am now getting comfused with the tip you told me about the override technique, I can't get it to work... My php skills are pretty bad...
this is my final file :
Please log in or register to see it.
what would the file image.override.php look like?
Please Log in or Create an account to join the conversation.
Let's say you did it in the function imageLoad (it's an example), it will looks like
Please Log in or Create an account to join the conversation.
I'll keep in mind these modifications may bug on updates.
Thx for helping me!
Please Log in or Create an account to join the conversation.
if we implement only one function, only this function ll be override ? exact ?
so override file mean re implemented the same function name define in the source file ? exact ?
thank's
Please Log in or Create an account to join the conversation.
This class override is a HikaShop specific system which allow you to extends and override any function in any HikaShop class.
It requires some development/php skills.
As you can see in the override file, the classname is different and it extends from the original HikaShop class.
At this moment, by creating a function in the override class, it will override the original function.
So you can rewrite an HikaShop function.
We uses this technique because you do not require to copy/paste the complete original file.
If we make some improvements in a class/helper, the override class will not remove new function.
It could generates some errors (if we add a parameter in a function that you have overridden and this function is uses by a view) but for most cases, it will work good.
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.
1)i was not aware that we can do this with hikashop .
In joomla php override like for layout view we need to inform the a php file that there is other layout file ...
Is it the same for override php hikashop file ? ( implement a API and use/call an API is not he same )
2) since joomla is all about PHP file , could you confirm we can't do that with joomla ( core & extension)
3) i know java language but not php
in java => class OverrideClassName extends ParentClassName
strange ....PHP5 introduce abstraction class ....
Could you confirm that hikashop don't use abstract class ?
4) does hikashop use an internal framework other than joomla ?
in a way joomla is a framework with GUI for backend and frontEnd !!
( Drupal ll have a wellknow framework symfony )
Regard's
thank's
Please Log in or Create an account to join the conversation.
PHP extends
www.php.net/manual/en/language.oop5.basi...e.oop5.basic.extends
In PHP "extends" is different than "implements". Class abstraction is possible but we don't use it.
HikaShop overrides
It is just something we put in the HikaShop helper because we want to have a huge flexibility.
We do not talk about it because it requires some good development skills.
Creating a good function override is a high level of customization and without the knowledge, it can break HikaShop.
View overrides could solve most of customization needs.
That's why we include the view editing interface in the HikaShop backend. It allow you to override every HikaShop views (front-end and backend).
For these view overrides, we use the Joomla structure/system.
For class/helpers overrides, we made our little structure/system.
Framework
We use the Joomla framework, but we have some internal functions like "hikashop_get" which allow to load a class.
This function have a little bit of code which will check if an override exists or not.
But HikaShop is a Joomla component based on the Joomla framework.
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.