• Resolved lucatartarini

    (@lucatartarini)


    Hi, I would like to use this plugin to create a mechanism that displays the stores in the user’s area and sends mail to the map stores. To do this I would need to collect the email addresses of the stores displayed inside a variable. it’s possible?

    What should happen is that the button at the bottom of the page sends the user’s cart to all the email addresses of the stores collected on the page.

    To do this I should collect the email addresses in a variable to be used in the to field of the send mail function.

    I started working with a plugin that doesn’t allow this.

    I would like to know if it would be possible with your plugin.

    Below is the page template code (modified woocommerce cart.php ) where you can find how I’m trying to address the problem.

    A thousand thanks

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Agile Logix

    (@agilelogix)

    Hi @lucatartarini , thank you for considering our plugin, yes our plugin can display the stores in the user’s area, but not sure what you mean by sending emails to the stores.

    Email address can be accessed via PHP or with the template through our customizer, but there is no send mail functionality and that needs implemntation, if you can elaborate it further we can help in the regard.

    Thank you

    Thread Starter lucatartarini

    (@lucatartarini)

    Good morning, thank you so much for your reply.
    Let me explain my problem better, as you can see from the attached code, on the cart page I have inserted a mail function that collects the user’s order. What I should do is insert in the “to” field a variable that collects the email addresses of the stores displayed in the map above, so that the customer’s order can be sent to all these stores. Is it possible to get this variable?

    <div id="sendlistform-wrapper">
    	
    	<h2>Invia la tua lista</h2>
    	<p>Compila il form sottostante e invia la tua lista ai gommisti individuati nella mappa. Da loro riceverai in risposta un preventivo.</p>
    
    
    <?php
    global $woocommerce;
    foreach ($woocommerce->cart->get_cart() as $item_id => $values) 
    {$string .= $values['quantity'].$values['data']->get_name().',';}
    
     
    
    
    
    ?>
    <form action="#" id="form" class="sendlistform"  method="post" name="form">
    <input type="text" name="nome" placeholder="Nome"><input type="text" name="email" placeholder="Email">
    <textarea name="message" placeholder="Il tuo messaggio..."></textarea>	
    <button type="submit" name="send_message_btn">Send</button>
    </form>
    <?php 
    	
    if(isset($_POST['send_message_btn']))
    {
    $from = $_POST['email'];
    $to = here the variable i should generate
    $subject = "Checking PHP mail";
    
    $headers = "From:" . $from;
    
    mail($to, $subject,$_POST['nome'].$_POST['message'].$string, $headers);
    
     echo '<div id="sent" class=" align-items-center">La tua lista è stata inviata.<br>Sarai presto ricontattato.<br><a href="https://www.lucatartarini.net/area-test/mastro-new-site">Torna alla Homepage</a></div>';
    }
    
    ?>
    
    </div>
    
    Plugin Author Agile Logix

    (@agilelogix)

    Hi @lucatartarini , sorry for the delay, totally missed this thread, I would suggest you use our Multi-Store Addons that have the functionality to choose and send email notifications to the store owners.

    https://wc.agilestorelocator.com/

    For more, please create a support ticket by emailing us support@agilelogix.com we will get back to you in lesser time.

    Thank you

    • This reply was modified 3 years, 3 months ago by Agile Logix.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Collect mail data in a variable’ is closed to new replies.