News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart budget send email

Started by rubensantos, July 16, 2014, 18:26:47 PM

Previous topic - Next topic

rubensantos

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

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rubensantos

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?

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rubensantos

I need the client to provide the Name and Email to send because it is not registered

rubensantos

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?

GJC Web Design

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

rubensantos

None of the links helps me because it does not meet what I need: c

rubensantos

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; }
$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 ?>