Hello everyone,
I am a little stuck with my issue and need some guidance on how to resolve it.
Joomla Version is 3.8.6
VirtueMart Version is 3.2.14
Template is JSN Force 2
Website is http://rentforyourevent.com
When I go to the Product Page (http://rentforyourevent.com/index.php/audio/speakers/15-powered-speaker-detail) and I click on the "Call for price" button, I get a popup window, which is exactly what I want.
When I do that from Category Page (http://rentforyourevent.com/index.php/audio/speakers) and I click on the "Call for price" button, I get routed to another a webpage with the same information as the popup window.
How I can get the Category Page to get the same popup as the Product Page when clicking on the "Call for price" button?
Thanks in advance for all your help!
ask-a-question button need javascript to display the modal. See your productdetails view file and copy the script to your category view
Thank you for your quick reply Studio 42. I am assuming you are talking about copying the script from file "/components/com_virtuemart/views/productdetails/view.html.php" to "/components/com_virtuemart/views/category/view.html.php". What specific script or line of code should I be copying? I apologize for my lack of knowledge.
Search for "ask-question" in /components/com_virtuemart/views/productdetails/tmpl/default.php or check your template if you have some overrides
It seems I have this...
// Ask a question about this product
if (VmConfig::get('ask_question', 0) == 1) {
$askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component', FALSE);
?>
<div class="ask-a-question">
<a class="ask-a-question" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL') ?></a>
</div>
<?php
}
?>
<?php
I spoke about the javascript, not the HTML code.
Studio 42, I found this in the source code of the webpage for Product Details...
<script id="popups_js" type="text/javascript">//<![CDATA[
jQuery(document).ready(function($) {
$('a.ask-a-question, a.printModal, a.recommened-to-friend, a.manuModal').click(function(event){
event.preventDefault();
$.fancybox({
href: $(this).attr('href'),
type: 'iframe',
height: 550
});
});
}); //]]>
</script>
I did find the PHP file that loads the script according to the notes...
"/components/com_virtuemart/sublayouts/askrecomjs.php"
I just don't know what to do or where to add the code in the backend in order for it to reflect in the webpage on the Category page.
Copy and paste ti in your category/tmpl/default.php file.
You can remove
, a.printModal, a.recommened-to-friend, a.manuModal
That didn't work, but I figured out how to fix it.
I went to the following file, which is very similar to what you asked me to do:
/templates/jsn_force2_pro/html/com_virtuemart/category/default.php
I added the following code to point to the askrecomjs.php file.
echo shopFunctionsF::renderVmSubLayout('askrecomjs',array('product'=>$this->product));
I would like to thank you for all your help and not giving up on me. If you wouldn't have made all the recommendations you did, I would have never figured it out. Thank you!
Quote from: Studio 42 on April 13, 2018, 17:20:53 PM
or check your template if you have some overrides
/templates/jsn_force2_pro/html/com_virtuemart/category/default.php is the override in your template.
But using this code is not optimal, you should simply include the javascript