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".

Select Joomla Form Parameters

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.

Article Manager article ID number

7) Open shop.product_details.php which is located in administrator/componets/com_virtuemart/html/

8) Find this code:

/** Ask seller a question **/
$ask_seller_href = $sess->url( $_SERVER ['PHP_SELF'].'?page=shop.ask&flypage='.@$_REQUEST['flypage']."&product_id=$product_id&category_id=$category_id" );
$ask_seller_text = $VM_LANG->_('VM_PRODUCT_ENQUIRY_LBL');
$ask_seller = '<a class="button" href="'. $ask_seller_href .'">'. $ask_seller_text .'</a>';

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',
function(){ var

JTooltips = new Tips($$('.hasTip'), {
maxTitleChars: 50, fixed: false}); });

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
;
/**In the above code, replace YOURARTICLEID with the ID number in step 6. In our case the ID would be 1132.**/

$ask_seller_text =
$VM_LANG->_('VM_PRODUCT_ENQUIRY_LBL');

$ask_seller = "<strong><a class='modal'
href='$ask_seller_href' rel='{handler:

\"iframe\", size: {x: 450, y:
450}}'>". $ask_seller_text .'</a></strong>';

/** 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.

Ask Question Light Box Virtuemart

Virtuemart Ask Question Lite Box

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.
First log into the front end, once logged in you will see the "My Questions" link, click that.



You will then be presented with a list of all qustions submitted. You can select which question you would like to respond or view.
Click the Details button to the right of the question to view the details of the question and to respond.



Once you have entered into the question's area, you are now presented with a plenthroa of information. You have access to the customer information aswell as the product in which the customer has asked the question on.




 







Forms LT Module

 
First Name
Last Name
E-mail
Phone
Subscribe
Note
Joomla Version
  
Official PayPal Seal


+ Suggested tags