Skip to main content

Shadowbox: change handleOversize to drag

More
12 years 2 months ago #165272 by nre
Hi, this is my first post here so ... ciao!
I need, please, to change the parameter in subject so I can have my product images at original size in popup but with drag feature to show all the image detail.
How can I change/pass this param to shadowbox?
Thank you.

PS: I've deleted all joomla/hikashop/php informations on top of the message because this is not a real error/problem.

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

More
12 years 2 months ago #165283 by Xavier
Hi,

Sorry but I don't really understand your needs.
Could you please give more informations, and potentially screenshots to describe what you want ?

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

More
12 years 2 months ago #165382 by nre
Hi, thank you for your replay.
I want pass parameter "handleOversize" (and set it to 'drag') to my pop image product (so I can have image in full size with drag features).
I've read about this parameter here www.shadowbox-js.com/options.html
How can I do it?
Thank you.

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

More
12 years 2 months ago #165387 by Xavier
Hi,

This will require an override as you can read it here:
hikashop.com/support/support/documentati...tation.html#override

You can use such code in the override:
Code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); function hikashop_image_link_render(&$obj,$path,$addpopup,$optionslink,$html,$alt=''){ $group = hikashop_get_current_group_name(true); return '<a title="'.$alt.'" rel="shadowbox['.$group.']" href="'.$obj->uploadFolder_url.$path.'" '.$optionslink.' onclick="Shadowbox.init({ skipSetup: true }); Shadowbox.setup(); return false;">'.$html.'</a>'; } function hikashop_small_image_link_render(&$obj,$path,$addpopup,$optionslink,$html,$alt=''){ $group = hikashop_get_current_group_name(); return '<a title="'.$alt.'" onclick="Shadowbox.init({ skipSetup: true }); Shadowbox.setup(); return false;" class="hikashop_image_small_link" rel="shadowbox['.$group.']" href="'.$obj->uploadFolder_url.$path.'" onmouseover="return hikashopChangeImage(\''.$addpopup.'\',\''.$obj->uploadFolder_url_thumb.'\',\''.$obj->thumbnail_x.'\',\''.$obj->thumbnail_y.'\',this);" '.$optionslink.'>'.$html.'</a>'; } ?>

It require PHP knowledges.

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

More
12 years 2 months ago - 12 years 2 months ago #165852 by nre
Thank you for replay.
I've tryed by inserting this code in a custom page hikashop_image.php placed in html folder on my template folder (why not in the html/hikashop folder?) but product detail page is not rendered and I get only a blank page with product title only :(
This is the code I've placed just to made a test (is part of your code sent to me):
Code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); function hikashop_image_link_render(&$obj,$path,$addpopup,$optionslink,$html,$alt=''){ $group = hikashop_get_current_group_name(true); return '<a title="'.$alt.'" rel="shadowbox['.$group.']" href="'.$obj->uploadFolder_url.$path.'" '.$optionslink.' onclick="Shadowbox.init({ skipSetup: true }); Shadowbox.setup(); return false;">'.$html.'</a>'; } ?>

Where I'm wrong?
Thank you.
Last edit: 12 years 2 months ago by nre.

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

More
12 years 2 months ago #165880 by Xavier
Hi,

Thanks to set the error reporting level of the Joomla configuration to "Maximum" in order to display the error messages.
That should help us to see from where the problem is coming.

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

More
12 years 2 months ago #165983 by nre
Thanks, I get this:

Fatal error: Call to undefined function hikashop_get_current_group_name() in /var/www/mysite.com/templates/newlifestyle/html/hikashop_image.php on line 5

Note: I've done a simple cut and past of your code to made a test ...

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

More
12 years 2 months ago #166013 by Xavier
Hi,

Could you try with that code instead:
Code:
function hikashop_image_link_render(&$obj,$path,$addpopup,$optionslink,$html,$alt=''){ return '<a title="'.$alt.'" rel="shadowbox" href="'.$obj->uploadFolder_url.$path.'" '.$optionslink.' onclick="Shadowbox.init({ skipSetup: true }); Shadowbox.setup(); return false;">'.$html.'</a>'; }

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

More
12 years 3 weeks ago #170477 by nre
Hi, sorry if I re-open the post but I need to understand how to customize gellery too.
I've edited core file "popup.php" under /administrator/components/com_hikashop/helpers by inserting this script declaration on inageShadowbox function:

$doc->addScriptDeclaration("\r\n".'Shadowbox.init({
handleOversize: "drag",
modal: true
});'."\r\n");

I know, this is not a portable solution and I've to care about updates, but it's the only one that works (for me) and my image open with drag feature.
This not work if I've more than 1 images (gallery) and images open without drag feature.
You can see:
1) www.montinibags.it/hikashop-menu-for-mod...59/prodotto/80-.html (this works, with one image only)
2) www.montinibags.it/hikashop-menu-for-mod...9/prodotto/105-.html (this doesn't work and images are open without drag feature)

Any solution/advice ?
thank you.

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

More
12 years 3 weeks ago #170586 by Jerome
Hi,

I think you're wrong in the way that your code is working perfectly.
It's just that your images in the second page are too small to require a drag. If you reduce the size of your browser window, you will see that the drag is activated and works good.

Regards,

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

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

Time to create page: 0.227 seconds
Powered by Kunena Forum