Support » Plugin: Simple Cart & Buy Now » [Plugin: Simple Cart & Buy Now] Email a Cart

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author bluey80


    Take a look at


    you’ll want to copy that file (and edit the copied file) into templates/yourtemplate/process.php and configure SCABN to use the template yourtemplate.

    Instead of running at the of the process.php

    $output .= scabn_make_paypal_button($options,$holditems);
    $output .= scabn_make_google_button($options,getShippingOptions($holditems),$holditems);

    you’ll want something like

    $output .= scabn_send_email($options,$holditems);

    where scabn_send_email is a function you will write. You can look at the scabn_make_paypal_button function as a reference. It is located in includes/functions.php

    You’ll have to lookup using php to send email as SCABN doesn’t current do that.

    Hello I’m having the same issues, I’ve managed to make a function and lead it to a a send-cart.php to send the email but I can’t seem to include the cart information into the email.

    Could you kindly guide me?

    I tried storing the orderlist into a session in functions.php and then calling it at shoppingcart.php and send-cart.php but the data won’t load.

    I can’t seem to find the answers on the internet so if you could kindly guide me. thank you so much

    Plugin Author bluey80


    The variable $holditems is an array with the contents of the shopping cart. Each items in the array is a dictionary using the keys ‘options’, ‘name’, ‘currency’,’qty’ and ‘price’. If you look at functions.php

    you can look at the function scabn_make_google_button($options,$shipoptions,$items) In it, it iterates over the items in the cart and gets their content:

    foreach($items as $item) {
    		$gc .= "\n\t\t<item>";
    		if ( $item['options']  ) {
    			$gc .= "\n\t\t\t<item-name>".$item['name']." (".scabn_item_options($item['options'],'--').")</item-name>";
    		} else {
    			$gc .= "\n\t\t\t<item-name>".$item['name']."</item-name>";
    		$gc .= "\n\t\t\t<item-description>".$item['name']."</item-description>";
    		$gc .= "\n\t\t\t<unit-price currency=\"".$options['currency']."\">".$item['price']."</unit-price>";
    		$gc .= "\n\t\t\t<quantity>".$item['qty']."</quantity>";
    		$gc .= "\n\t\t</item>";

    You can also look at the paypal function as well — it does basically the same thing.

    Hello again! I did base my function on the googlecheckout function and I can call it the cart on the shopping-cart.php page but I can’t find a way to add it to the email php form where I also grab the rest of the data (like name, email etc) on the form that I added on the shopping-cart.php

    Is it possible to call the $holditems array into the send-cart.php form like in a session? Or am I getting the logic wrong / doing everything wrong? I’m sorry I’m kind of new to this

    thank you for responding so quickly!

    this is the function by the way, should I have added more here?

    function email_cart_button($options,$items) {
    	$currency = $options['currency'];
    	$ppo="<form method=\"post\" action=\"http://localhost/wordpress/wp-content/themes/client/send-cart.php\">\n";
    	foreach($items as $item) {
    		$orderlist .= "<p id=\"orderlist\">";
    		$orderlist .= $item['qty']." - ";
    		if ( $item['options']  ) {
    			$orderlist .= $item['name']." (".scabn_item_options($item['options'],'--').")";
    		} else {
    			$orderlist .= $item['name']." - ";
    		$orderlist .= $options['currency']." ".$item['price']." ";
    		$orderlist .= "</p></br>";
    	$ppo .= $orderlist."
    	<input type=\"submit\" name=\"submit\"
             value=\"Submit\" id=\"send-cart\" alt=\"Submit\"></form>";

    I tried using sessions to call $orderlist to send-cart.php but it didn’t work.

    I think I just need a way to call the variables via $_POST? I can’t seem to determine which name to call them as because they’re dynamic. for example, i tried, $itemqty= $_POST[‘qty_’.$i]; but I can’t grab the variable.

    Plugin Author bluey80


    You can’t grab name / email information because we don’t collect it. SCABN just builds a list of items to buy and then hands it off the Google Wallet / Paypal to get name, address, shipping method, payment, etc. There is no session, etc, as SCABN never handles any remotely sensitive information so the client (browser) can store the contents of the shopping cart and pass it SCABN to build a ‘buy now’ button when ready.

    I want to add cart to email but i can’t find the files that is mentioned

    Using Ver 2.0.1

    Plugin Author bluey80


    That is feature I’m hoping to add soon, but currently SCABN does not have the capability.

    Hi, i’m interested in the same feature so i’ll be reading and waiting for news.
    By now i’m using the plugin WP-email to let the customers send me the Checkout post via mail, so i receive an email with the prodducts he want and i can contact them (but they have to write down my email also :/).

    My site is, and the Checkout page is “Pedidos” (shows nothing if the cart is empty).

    This is a post I wrote asking about this feature:

    Thanks for your time bluey80

    Plugin Author bluey80


    Compvictor — I think you will need to WP-email to include in the email the cart session data. My code accesses that data with lines like

    $cart =& $_SESSION['wfcart']; // load the cart from the session

    Then some $cart -> string / formatting function and append that to the email.

    I think somehow WP-email is including the cart session, because i made several tests and i always receive the complete cart order.
    I’m new in php and coding so idon’t know where or what functions add, for example, to clear the cart after sending the order, or don’t ask the customer to fill in the recipient email.

    Remember this is a temporary solution for me until you can add the email feature to SCABN. I tried many complex shopping carts but all i want is to add a buy now button to the posts, a cart and a mail order, and your plugin served me well.


    This option would be really useful. Could you guide/make an example for us non-programmers what to do and change to make this work?

    We are trying to implement funcionality like this on ClassiPress. It would be most useful.


    Plugin Author bluey80


    Unfortunately, adding this feature is a real coding job, which is why it hasn’t been implemented yet / there isn’t a simple example for how to do it. I’m hoping to get around to it in the next few weeks, but we’ll see. If anyone wants to help me code this (particularly some AJAX for the form) that would be great.

    Thank you for your response. Thumbs up for the work.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: Simple Cart & Buy Now] Email a Cart’ is closed to new replies.