| Use Forms LT with Virtuemart |
| Tutorials | |||
|
Question: How do I implement Forms LT with Virtuemart - Ask A Question? Answer: This is fairly simple, but does require a core Virtuemart modification. Be sure to make a back up the orginal files referenced below before making changes. Now, just follow these steps. 1) We assume you have installed the latest version of Forms LT with Lite CRM and VM integration. If not, please do so. 2) In the back end create a form specially for Virtuemart. Title it whatever you like. We like to call it Ask Question. 3) Set The parameters you want in addition to USE LITE CRM, Use VM and ADD tthe available custom fields "Product URL" and "Product ID".
Save when done. 4) Via the TRACKING CODE control panel, grab the MOSBOT code. In our case it is mossbflt 54. Your ID will be different. 5) Make a new article and insert the mosbot. 6) When saved, notate the article ID number which can be foud in the Article Manager control panel.
7) Open shop.product_details.php which is located in administrator/componets/com_virtuemart/html/ 8) Find this code: /** Ask seller a question **/ Replace with this: /** Ask seller a question **/ JHTML::script('modal.js'); JHTML::script('tabs.js'); JHTML::stylesheet('modal.css'); $document =&JFactory::getDocument(); $document->addScriptDeclaration("window.addEvent('domready', JTooltips = new Tips($$('.hasTip'), { window.addEvent('domready', function() SqueezeBox.initialize({}); $$('a.modal').each(function(el) { el.addEvent('click', function(e) { new Event(e).stop(); SqueezeBox.fromElement(el); }); }); }); "); $ask_seller_href = $_SERVER ['PHP_SELF'].'?option=com_content&view=article&id=YOURARTICLEID&Itemid='.$Itemid.'&tmpl=component&product_id='.$product_id $ask_seller_text = $ask_seller = "<strong><a class='modal' \"iframe\", size: {x: 450, y: /** End Replacemen Code **/ 9) In the replacement code above, find this line: ['PHP_SELF'].'?option=com_content&view=article&id=YOURARTICLEID&Itemid='.$Itemid.'&tmpl=component&product_id='.$product_id
See the variable called "YOURARTICLEID" without the quotes? Change YOURARTICLEID with the YOUR id number from STEP 6. 10) Upload the file. 11) In whatever product detail template you are using find this code: <a class="button" onclick="protoPop( this.href.replace(/index.php/, 'index2.php' ) + '&only_page=1', { modal: true,width:640,height:480 } );return false;" href="<?php echo $ask_seller_href ?>"><?php echo $ask_seller_text ?></a> Replace with: <?php echo $ask_seller; ?>
12) Upload the modified product detail template. Now, when the ASK A QUESTION link is clicked, a light box will open on the same page, and allow the user to ask their question.
If you feel the lightbox is to WIDE or NARROW, you can adjust the width and height by modifying this code from the step 8. \"iframe\", size: {x: 450, y:
450}}'>". $ask_seller_text .'</a></strong>'; Change the x and y variables to whatever you like. Once a question has been placed, you can view the comment from the front end by taking the following steps.
|