"Ask a Question" Opens Window Instead of Popup - Problem Found! Thankyou!

Started by Bel, June 05, 2014, 15:28:09 PM

Previous topic - Next topic

Bel

My site is running Joomla 2.5.20 and Virtuemart 2.6.6.  I recently upgraded to the latest version of Joomla from an earlier 2.5 version, and I seem to have broken the "ask a question" button.  Instead of opening a little popup box like it's supposed to, it's now opening a whole new page over the top of the old one.  The page works exactly as the popup did and sends email correctly.   I'm not a web developer but I would like to be able to maintain this site myself, so I'm trying to learn as much as I can.

Here's a link to a page on the site where you can see this:
[link removed as the issue is now fixed, thank you all so much!]

I would greatly appreciate any help anyone could give me. I'm trying to work through possible solutions logically, but I'm quite new to this so there could easily be something very obvious that I'm missing.  I can usually find and follow instructions on how to fix problems with the site, but at the moment I'm not sure where to start.

So far, based on other similar threads I've read on here, I have tried:
-switching from our custom template to the beez template for virtuemart - this had no effect on the problem that I could see
-using jQuery to run 1.8 library (no effect)
-switching off k2 jquery (no effect)
-switching off virtuemart jquery (no effect)
-switching off virtuemart css (made product pages look odd)
-disabled K2 (made everything else look odd!)
-looking at FireBug script tab... I didn't see any errors but I'm not entirely sure what I was looking for, so that doesn't mean there weren't any.

After each thing I tried, I put the settings back the way they were beforehand.

I'm currently reading up on how to use Firebug properly, although I'm still not certain what I'm looking for in the script.
Has anybody got any suggestions on what to do next? Or, even better, is the problem something daft and obvious that you can point out to me?
If anyone can tell me what the code to make the popup open looks like, I think that would be helpful too. Assuming I could search for that code and maybe figure out what's breaking it.

EDIT: Problem solved, thank you very much for your help!

eyesofkids

The ask-a-question javascript code is obviously different from the one of VM 2.6.6.

Template always uses template override technology for style designed.
You can compare the templates file below(use diff tool like WinMerge):

***Product detail page****
components/com_virtuemart/views/productdetails/tmpl/default.php
your_template/html/com_virtuemart/productdetails/default.php
after line 41~107  (ask-a-question section line 82~87)

Find the difference and try to update your template override file.

Good luck
Eddy

GJC Web Design

the JS snippet in the head is coded for facebox

jQuery(document).ready(function($) {
$('a.ask-a-question').click( function(){
$.facebox({
iframe: '/index.php/living/armchairs/set%20of%20two%20leather%20swivel%20chairs-detail/askquestion?tmpl=component',
rev: 'iframe|550|550'
});
return false ;
});

but your loading /components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js

there should be code in your over ride/default product template to chose the correct one - have a look at the latest versions

assume your template is old?



GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Bel

Thank you very much, Eddy and GJC! Yes, the template is an old one, I think you've nailed the problem right there. I'm going to investigate the template and try replacing the old code on my custom template with the new code from the default, fingers crossed that does it. I'll let you know how I get on.
Thanks again!

Bel

I tried comparing my custom template with the default, but the custom one is about 3 times the size and looks completely different. No matter how I cut and pasted the bit about fancybox, I couldn't get it to work.  Pretty sure I need a better understanding of the syntax used before I try that again, every time I tried it resulted in the page not loading at all.  Then I realised I could download the updated version of the template (from Gavick, as it turns out) to get an updated version of the product details default.php
I used winmerge (amazing program!) and copied a few customised bits over from the old version, and hey presto! It works, and it looks almost the same as the old version did before I broke it.
Thank you very much for all your help! Without it I would have had no idea what was causing the problem.

GJC Web Design

Well  done :  there is a bit of a problem here in that some template makers tend to over-write everything - i.e. make a copy of the complete views in their template html...

As Milbo says .. best practice is to ONLY over write what needs to be over written - means on VM updates if there is significant code changes within the views there is far less places to break them..
or a good templater will have his updated template ready to download...
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation