WooCommerce and AWeber

I’ve recently worked with a client who has a couple of online stores powered by WooCommerce. I’ve done a little work here and there with customizing WooCommerce, but this client is my first to want AWeber lists integrated.

The good news is that many WooCommerce plugins integrate nicely with AWeber, and she’s also using Gravity Forms, which make AWeber integration even more easy. For the most part, hooking up AWeber to whatever other feature we need is as easy as installing a plugin and setting it up.

However, we have a very specific need that was not satisfied by any plugins I found: there are certain products for which we would like to send out updates. The price of these products includes free updates to new versions and access to alternative formats. So we wanted to be able to sign someone up to an AWeber list for a specific product.

The AWeber API is actually very straightforward, and their cookbook code samples are great. WooCommerce is not always as clear, but debugging any issues is typically pretty easy. The gist of my solution, which hooks into the ‘woocommerce_order_status_completed’¬†action, is below:

1
2
3
4
5
6
7
8
9
10
11
12
13
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach($items as $product){
    if(array_key_exists($product['id'], $product_lists)){
        $app = new THCGaweberApp();
        $list = $app->findList($name=$product_lists[$product['id']]);
        $subscriber = array(
            'email' => $order->billing_email,
            'name'  => $order->billing_first_name.' '.$order->billing_last_name
        );
        $app->addSubscriber($subscriber, $list);
    }
}
Posted in Code for Fun
3 comments on “WooCommerce and AWeber
  1. alexandreventurin@gmail.com says:

    Hi!

    I looked all over the internet to find a solution to it.
    Just add the buyer to my list on Aweber, without any user interaction, checkboxes or anything.

    Looks like that your code does it.
    I don’t knwo exacly howo to implement it (used to code in C++, so coding is not a monster to me… but I’m not as skillful as I would like!).

    Can you help me? Thanks!

  2. gravitymktg@gmail.com says:

    Thank you for sharing this solution. It solves a very common issue.

    Will an Aweber list need to have the exact name as the product for this to work? How are you connecting the product and the list?

    Thank you!

  3. Abby Langner says:

    Thanks for the post, gravitymktg! I normally response directly by email but I thought this might be a helpful clarification for everyone :)

    My product_lists array is uses prod_id=>name as key=>value pairs where prod_id is the WooCommerce product ID and name is the AWeber list name.

    There’s a lot of room for flexibility there, since you can set up product_lists to use any one of the WooCommerce product attributes as the keys. You can even adjust line 4 — instead of the PHP built-in array_key_exists function, you could do any test you like to match a product to a list, for example if the product title contains a particular word.

    Very exciting to see that my solutions are useful. Thanks again for asking a great question!

39 Pings/Trackbacks for "WooCommerce and AWeber"
  1. dofollow backlinks software…

    nwmfibvbh khdad dsehrlz ustz hawzmtblpbjekuu…

  2. … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  3. … [Trackback]…

    […] Find More Informations here: abbysdoor.com/woocommerce-and-aweber/ […]…

  4. … [Trackback]…

    […] There you will find 89755 more Infos: abbysdoor.com/woocommerce-and-aweber/ […]…

  5. … [Trackback]…

    […] There you will find 95844 more Infos: abbysdoor.com/woocommerce-and-aweber/ […]…

  6. … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  7. golf says:

    … [Trackback]…

    […] Read More: abbysdoor.com/woocommerce-and-aweber/ […]…

  8. attorney says:

    … [Trackback]…

    […] Read More: abbysdoor.com/woocommerce-and-aweber/ […]…

  9. … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  10. … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  11. crazy says:

    … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  12. … [Trackback]…

    […] Find More Informations here: abbysdoor.com/woocommerce-and-aweber/ […]…

  13. … [Trackback]…

    […] Read More: abbysdoor.com/woocommerce-and-aweber/ […]…

  14. … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  15. a lot of useful information can be…

    obtained regarding the best weight loss plan for new moms. however, while implementing such diet plan, the woman should be careful and ensure that she can follow the plan for a period of time. this is important because giving it up…

  16. more says:

    that as an opportunity that is why…

    internet marketing was born.internet marketing is anything that is related to promoting products, businesses and services using the world wide web. if you have a blog that promotes products like for example you want to tell the world what iphone 4…

  17. a time deadline and teachers generally give…

    some leeway in this situation. but with other writing there is no excuse and often it’s this last effort – the editing – that makes your work impress.when editing, you need to be your own critic because if you’re not, someone…

  18. … [Trackback]…

    […] Read More: abbysdoor.com/woocommerce-and-aweber/ […]…

  19. the most exposure and the most traffic…

    is to publish what you have to say on someone else’s high traffic website, and it’s easy to write an article.if you think of your writing as an article, but then published it as a blog post, it’s easier to write…

  20. will remain a silent whisper with no…

    listeners, no readers. in fact, there are thousands upon thousands of unpublished good writers of all ages who keep waiting for the ball to drop (and actually think that it will) simply because they think they are good enough. if, after…

  21. … [Trackback]…

    […] Read More here: abbysdoor.com/woocommerce-and-aweber/ […]…

  22. Regan Cabral says:

    a week to even stand a chance…

    of being “seen” by search engines. blogs with two to three posts a week, every week are far more likely to get indexed, climb to the top of search results and stay there.new ideas. this is perhaps the biggest drawback in…

  23. cgminer x11 says:

    … [Trackback]…

    […] Read More here: abbysdoor.com/woocommerce-and-aweber/ […]…

  24. … [Trackback]…

    […] Find More Informations here: abbysdoor.com/woocommerce-and-aweber/ […]…

  25. trust means getting your prospects to like…

    you, and getting your prospects to look forward to what you have to offer in your internet business.your products and services should be stellar, and you should strive to make sure that you provide excellent customer service to your customers -…

  26. more people are coming to realize that…

    is easier to read their favorite blogs through rss feeds. that is the reason advertising companies and providers have attempted to penetrate the place to maximize profit to accommodate their target market.blog sponsorship lastly, you may think about yo…

  27. this is really a nice post….

    I saw this really great post today….

  28. useful link says:

    will find that almost all the hosts,…

    especially the top 10 web hosting companies, offer a free installation of wordpress as part of all their hosting plans. it’s quite easy to install with just a few clicks where you have to choose an administrator name and password, and…

  29. m88 says:

    definitely enjoyed every little bit of it….

    i have you bookmarked to check out new stuff on your post.. hi… that was great stuff.. i really like this subject. could you tell me more… i would love to explore. thanks for taking the time to discuss this, i…

  30. work has already been done for them.this…

    is just the tip of the iceberg, there are endless possibilities available out there for you to discover and create. never be afraid to re-invent yourself and revamp your style, you can always find you’re inside voice if you look hard…

  31. … [Trackback]…

    […] Informations on that Topic: abbysdoor.com/woocommerce-and-aweber/ […]…

  32. writing.tip #2 – value your website so…

    your chosen seo writer does the same. after all, your website is nothing short of a virtual storefront! so, you need to ensure that your writer also understands the need to make a great first impression on your website visitors, and…

  33. to make a good plan and improve…

    your business profit.first of all, you need to have some writing skills. there are plenty of free article directories where you can submit your content. it takes only a few minutes to create a profile and start submitting articles. it’s important…

  34. a result.when prospects and customers are searching…

    for product or company information blogs can be a critical component of their information gathering. additionally, blogging establishes you as a thought leader, an expert – someone who doesn’t just participate in conversations, but initiates them. so,…

  35. many ways to monetize your blog without…

    relying on ads. advertisements don’t always work the way you want them to since your revenue depends on the readers’ actions when visiting your blog. if they choose to ignore the ads on your blog then there’s really nothing much that…

  36. be read backwards, there is a problem….

    by training one’s self to read stories from the back to the front, one is able to become much more adept at spotting story problems and plot-holes. this is an invaluable skill for a storyteller and can make editing much easier…

  37. so try to include relevant images and…

    videos for your readers and consistently look for new information to share with them.6. keywords are very important for your blog posts. if you focus on targeting specific keyword phrases, the chances of your blog coming up on the first page…

  38. the article you’re reading right now might…

    be considered a pillar article because it is specific and is written in a “how-to” format or lesson. an article like this has very long term benefits and is not time sensitive. i suggest that you write many of these pillars…

  39. not all of them will, so be…

    picky and choose the best posts.3. batch your research. this strategy works best if you dodo all of your searching at once and then do all of your commenting. then, open a number of posts before reading and deciding to comment.4….

Leave a Reply