VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: deisa on August 20, 2012, 18:10:16 PM

Title: Modify modal form "ask a question about this product".
Post by: deisa on August 20, 2012, 18:10:16 PM
Hi,

How I can modify  the  size of the modal form "ask a question about this product" ?

Thanks in advance.
Title: Re: Modify modal form "ask a question about this product".
Post by: ivus on August 20, 2012, 20:29:50 PM
Hi deisa,

It's quite simple. Change the following:

/components/com_virtuemart/views/productdetails/tmpl/default.php @ line 33



$document->addScriptDeclaration("
jQuery(document).ready(function($) {
$('a.ask-a-question').click( function(){
$.facebox({
iframe: '" . $url . "',
rev: 'iframe|550|550'
});
return false ;
});
/* $('.additional-images a').mouseover(function() {
var himg = this.href ;
var extension=himg.substring(himg.lastIndexOf('.')+1);
if (extension =='png' || extension =='jpg' || extension =='gif') {
$('.main-image img').attr('src',himg );
}
console.log(extension)
});*/
});
");



Specifically:



   rev: 'iframe|550|550'



First number is height, second number is width.

Good luck. I hope this helps.
Title: Re: Modify modal form "ask a question about this product".
Post by: deisa on August 20, 2012, 21:18:41 PM
Dear Ivus,

Thank you very much for your help.
I have changed line 33 to rev: 'iframe|550|950' but the modal form "ask a question about this product" don“t changed the width.
Which can be the reason of this?

Thanks in advance.
Title: Re: Modify modal form "ask a question about this product".
Post by: ivus on August 20, 2012, 21:35:32 PM
Hi deisa,

You failed to indicate which versions you're using and also on which page you want the changes to apply. I assumed you wanted it on the PRODUCT DETAILS page...?

If that doesn't work for you then I'm not sure what you've done? Do you have template overrides?
Title: Re: Modify modal form "ask a question about this product".
Post by: bytelord on August 20, 2012, 23:01:04 PM
Hi,

If you done it as ivus suggest and that changes concern products details you should look inside your productdetails\default.php template around line 233. May you have an old part o template source. The right one is this

<div class="ask-a-question">
        <a class="ask-a-question" href="<?php echo $url ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>
        <!--<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>-->


As you can see there is a part that have been commented, may be you use that one. Last clean your browser cache (just in case).

Check it.
Title: Re: Modify modal form "ask a question about this product".
Post by: deisa on August 22, 2012, 01:26:47 AM
Dear ivus &  bytelord,

Ivus has the reason... I have template overrides. :-[

Correct path: \templates\mytemplatename\html\com_virtuemart\productdetails\tmpl\default.php

I have changed the width without problems now

Many thanks for the effective support.