ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Commerce sends multiple emails after successful cart transaction

April 25, 2012 4:11am

Subscribe [2]
  • #1 / Apr 25, 2012 4:11am

    Pigtail Dencil

    117 posts

    I’m finishing an ecommerce site on EE1.7.2 with SCM, Paypal and Mark Bowen’s Shopping Cart plugin.

    I add more than one item in the shopping cart as an EE logged in member. I hit checkout and am presented with the cart’s contents on Paypal. Everything tallys up: x number of items and one shipping fee for the order. I proceed by logging in with my Paypal Sandbox user account and complete the transaction. Paypal then returns me to the ‘success’ page I set up in EE. The IPN call is intitiated. The purchase is recorded in the SCM’s store and emails are delivered: too many.

    I receive as many emails as there were items in the cart. For example if I complete a transaction for 3 items, both the buyer and seller each receive 3 emails, detailing the cost of each individual item.

    This wouldn’t be such a big deal were it not that I want to list the shipping cost

    {mc_shipping}
    and total value of all the items
    {payment_gross}

    that the user has just bought. However doing so results in 3 confusing emails that seem to imply that shipping was paid three times over for the same order. And the item’s cost plus shipping never tally up to the payment total:

    {quantity} x  "{item_name}"
    
    Item price: ${mc_gross} {mc_currency}
    Shipping:   ${mc_shipping} {mc_currency}
    
    –––––––––––––––––––––––––––––––––––––––––– 
    Payment total: ${payment_gross} {mc_currency} 
    ––––––––––––––––––––––––––––––––––––––––––

    I doubt that Mark’s plugin is causing the problem. His plugin only implements an EE hosted cart functionality. The issue instead seems to be the result of Paypal’s IPN transmission and how SCM passes that information to the store’s email templates. Or am I wrong?

    Thanks.

     

  • #2 / Apr 26, 2012 11:29am

    Shane Eckert

    7174 posts

    Hello Seb,

    I am sorry to hear you are running into this problem.

    Can you tell me what configurations you have in your Store Emails Template?

    I would also check with Mark Bowen’s Shopping Cart plugin support just to cover all the bases. That error might be related.

    Please let me know what your settings look like for email.

    Cheers,

  • #3 / Apr 26, 2012 12:55pm

    Pigtail Dencil

    117 posts

    Hi Shane,

    Thanks for looking into this. I’ll fire a mail over to Mark.

    I’ve got two email templates that get sent to the buyer and to the seller (site owner). Below is the template that the buyer receives as many times as there are cart items:

    Hello {first_name},
    
    Thank you for your recent purchase. 
    Purchase number is: {txn_id}
    
    =====================================
    Date:  {payment_date}
    ––––––––––––––––––––––––––––––––––––––––––
    
    {quantity} x  "{item_name}"
    
    Item price: ${mc_gross} {mc_currency}
    Shipping:   ${mc_shipping} {mc_currency}
    
    No cart items: {num_cart_items}
    
    –––––––––––––––––––––––––––––––––––––––––– 
    Payment total: ${payment_gross} {mc_currency} 
    ––––––––––––––––––––––––––––––––––––––––––
    
    Username:  {screen_name}
    Buyer ID:   {payer_id}
    Email:   {payer_email}
    
    –––––––––––––––––––––––––––––––––––––––––– 
    Shipping address
    –––––––––––––––––––––––––––––––––––––––––– 
    
    {first_name}  {last_name}
    {address_street}
    {address_city}
    {address_state} {address_zip}
    {address_country}

    The final [edited] checkout template looks like this

    <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
     
      <input type="hidden" name="cmd" value="_cart" /> 
      <input type="hidden" name="return" value="{site_url}cart/payment-ipn-success" />  
      <input type="hidden" name="cancel_return" value="{site_url}cart/payment-canceled" />    
      <input type="hidden" name="upload" value="1" />
      
      <input type="hidden" name="business" value="[email protected]" /> 
      <input type="hidden" name="custom" value="{member_id}" /> 
      <input type="hidden" name="lc" value="US" /> 
      <input type="hidden" name="currency_code" value="US" />
      
      {exp:shopping_cart_functions cart_name="shop"} 
       <input type="hidden" name="item_name_{count_offset}" value="{title}" /> 
       {if item_use_sale} 
       <input type="hidden" name="amount_{count_offset}" value="{item_sale_price}" /> 
       {if:else} 
       <input type="hidden" name="amount_{count_offset}" value="{item_regular_price}" /> 
       {/if} 
       <input type="hidden" name="quantity_{count_offset}" value="{qty}" /> 
       <input type="hidden" name="item_number_{count_offset}" value="{item_id}" />
       
       <input type="hidden" name="upload" value="1" />
      {/exp:shopping_cart_functions}
    
      <div class="cart-checkout"><input type="submit" name="buy_now" id="buy_now_{item_id}" class="checkout" value="Checkout with PayPal" /></div>
    
     </form>


    I’ll PM you a link to the dev server where you can see the generated template yourself.

    Thanks

    UPDATE: Your mailbox is full 😊 so I can’t PM you!

     

  • #4 / Apr 27, 2012 4:06pm

    Shane Eckert

    7174 posts

    Hello Seb Neerman,

    Did you hear back from Mark?

    I do not see anything in these emails that would cause any errors. I am hoping Mark had some input.

    Thank you,
    Shane

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases