Good afternoon everyone,
I am currently finding a difficulty that is leaving me with the head in water, am no expert in Virtuemart or Joomla, I have only PHP and Mysql databases.
I would like someone to help solve the following problem:
Starting from the beginning that I am a customer and I do not login to the site or,
then I turn ah "Products" where the Virtuemart and after selecting 3 or 4 products go to the shopping cart section.
If you are logged in it let me finish the purchase, otherwise I need to register.
My problem starts here. Knowing that the shopping cart there is only the option to "Buy Finish" that only works for registered I would like to add a button with the purpose of the visitors to click that button labeled "budget", the website administrator receives an email with the products that are in the shopping cart and the visitor's email so you can respond.
Does anyone can help me please?
Already a big thank you to all
Use purchase order system. http://forum.virtuemart.net/index.php?topic=104494 http://forum.virtuemart.net/index.php?topic=110747.msg371493#msg371493
I prefer it to be free than my boss will kill me. xD
Once inside the basket, I can insert a button using the email joomla and enjoying the products of the cart and send an email?
FFS it is called a "Purchase Order System" or an "Invoicing System" - it costs nothing to set up unless you need to pay a developer. Read the links for ideas of how to do it.
I need the client to provide the Name and Email to send because it is not registered
I need a button to send email and ask user to the visitor and to send an email with the products from cart, can someone help me please?
Jenks has given you 2 links to full cost free solutions to your question - read them and experiment because I really don't think your going to get another answer
None of the links helps me because it does not meet what I need: c
I found the solution to send a budget via the shopping cart, for those who need to leave here the solution I used. If anyone has any idea how to improve it, please give me your opinion.
This code works only for visitors
For me is working fine, just can not validate the Name and E-mail
<?php
$verifica =& JFactory::getUser();
if($verifica->id!=0){
}
else
{
vmJsApi::JvalideForm();
$document = JFactory::getDocument();
// $document->addScript(JURI::root(true).'/components/com_virtuemart/assets/js/jquery.validation.js');
$document->addScriptDeclaration('
jQuery(function($){
$("#askform").validationEngine("attach");
$("#comment").keyup( function () {
var result = $(this).val();
$("#counter").val( result.length );
});
});
');
?>
<div class="form-field">
<br/><br/><br/>
<form method="post" class="form-validate" action="" name="budget" id="budget">
<label>
<span><?php echo JText::_('COM_VIRTUEMART_USER_FORM_NAME') ?> :</span>
<input type="text" class="inputbox validate[required,minSize[4],maxSize[64]]" name="name" id="name" size="30" validation="required name"/>
</label>
<label>
<span><?php echo JText::_('COM_VIRTUEMART_USER_FORM_EMAIL') ?> : </span>
<input type="text" class="inputbox validate[required,custom[email]]" name="email" id="email" size="30" validation="required email"/>
</label>
<div class="clear"></div>
<div class="submit" style="margin-left:10px">
<input class="button" type="submit" name="enviar_orcamento" id="enviar_orcamento" title="<?php echo JText::_('COM_VIRTUEMART_ENVIAR_ORCAMENTO') ?>" value="<?php echo JText::_('COM_VIRTUEMART_ENVIAR_ORCAMENTO') ?>" />
</div>
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
$visitanteuser=$_POST['name'];
$visitantemail=$_POST['email'];
if (isset($_POST['enviar_orcamento'])) {
if (empty($visitanteuser)or empty($visitantemail)) {
JFactory::getApplication()->enqueueMessage('Error sending budget', 'Error');
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
$cima=('IP Visitante: '.$ip.'<br/>Nome: '.$visitanteuser.'<br/>E-mail: '.$visitantemail.'<br/><table class="cart-summary" cellspacing="0" cellpadding="0" border="0" width="30%">
<tr align="center" valign="middle">
<th align="center" valign="middle" style="color:#d48728" bgcolor="#373737">'.JText::_('COM_VIRTUEMART_CART_NAME').'</th>
<th align="center" valign="middle" style="color:#d48728" bgcolor="#373737">'.JText::_('COM_VIRTUEMART_CART_SKU').'</th>
<th align="center" valign="middle" style="color:#d48728" bgcolor="#373737">'.JText::_('COM_VIRTUEMART_CART_QUANTITY').'</th>
</tr>');
$i=1; foreach( $this->cart->products as $pkey =>$prow ) {
$body.=('<tr bgcolor="#b9298b" valign="top" class="sectiontableentry'.$i.'">
<td align="center" valign="middle">
<span class="cart-images">
<a href="http://www.website.com/'.$prow->url.'" ><img width="110" height="156" src="http://www.website.com/'.$prow->image->file_url_thumb.'"></a>
</span><br/>
<span class="cart-title"><a href="http://www.website.com/'.$prow->url.'">'.$prow->product_name.'</a></span>
'.$prow->customfields.'
</td>
<td align="center" valign="middle">'.$prow->product_sku.'</td>
<td align="center" valign="middle">'.$prow->quantity.'</td>');
$i = 1 ? 2 : 1; }
$corpo=(''.$cima.''.$body.'</tr></table>');
$mail =& JFactory::getMailer();
$config =& JFactory::getConfig();
$mail->addRecipient( $config->getValue( 'config.mailfrom' ) );
$mail->setSubject( 'Pedido de Orçamento', $visitanteuser, $visitantemail);
$mail->isHTML(1);
$mail->setBody($corpo);
$mail->Send();
JFactory::getApplication()->enqueueMessage('Budget submitted successfully', 'Message');
}
}
?>
</div>
<?php } ?>