Tips and Tricks WP eCommerce

eCommerce Solution for WordPress Blog

  • Home
  • eCommerce Plugins
  • WP eStore Documentation
  • WP Shopping Cart Doc

Running Additional Tasks After a Sale via the Simple Cart Plugin

You can run some additional tasks after the simple cart plugin has processed a sale.

Note that this should only be tried by a developer as it involves custom PHP coding.

The plugin has an action hook that gets fired after the PayPal IPN (Instant Payment Notification) data is processed. You can use this hook to do additional custom tasks. Below is an example snippet of code that shows you how to use this action hook.

Add the following block of code to your functions.php file of the theme:

add_action('wpspc_paypal_ipn_processed', 'wspsc_my_custom_ipn_tasks');
function wspsc_my_custom_ipn_tasks($ipn_data)
{
    //You can write the $ipn_data array's content to a file to see
    //what paypal sends in the IPN
    $firstname = $ipn_data['first_name'];
    $lastname = $ipn_data['last_name'];
    $email = $ipn_data['payer_email']
    //Do something with the data

}

The IPN message consists of variables and is available as an array inside your function. You can access an element of the array by using the proper variable name. To see a list of all the available variables please check the PayPal IPN documentation page.

Note: We provide technical support for our premium plugins via our customer only support forum

Filed Under: WordPress Shopping Cart Tagged With: code example, e-commerce, Tweaks, WP Shopping Cart

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Shopping Cart

Shopping Cart Empty
Shopping Cart is Empty
Visit The Shop

Search

Featured Documents

Stylish Product Display Options for WP eStore WP eStore Quick Setup and Usage Video Tutorial WP eStore Shortcodes and Functions Reference WordPress eStore Plugin Features WordPress eStore Plugin Demo What Our Customers Have to Say About Our Products WordPress eStore WishList (Feature Suggestions) WordPress eStore Frequently Asked Questions (FAQ) How to Show Add to Cart buttons

Featured Plugins

wordpress_estore_icon
wordpress membership plugin icon
WP Express Checkout Plugin
Lightbox Ultimate Plugin
wordpress_affiliate_plugin_icon

Copyright © 2022 | eCommerce Plugins