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: This should only be tried by a developer as it involves custom PHP coding.

The plugin includes action hooks that are triggered after the checkout data is processed. These hooks allow you to perform additional custom tasks. Below is a code snippet demonstrating how to use one of these action hooks.

You can add this code to the functions.php file of your theme or to a custom plugin.

Table of Contents

  • PayPal Commerce Platform
  • PayPal Standard
  • Stripe Checkout

PayPal Commerce Platform

Here is example code if you are using the PayPal Commerce Platform (PPCP) checkout option.

add_action('wpsc_paypal_checkout_ipn_processed', 'wpsc_custom_post_payment_tasks');
function wpsc_custom_post_payment_tasks($ipn_data)
{
    //You can write the $ipn_data array's content to a file.
    $firstname = $ipn_data['first_name'];
    $lastname = $ipn_data['last_name'];
    $email = $ipn_data['payer_email']
    //TODO - Do something with the data
}

PayPal Standard

Here is example code if you are using the standard PayPal checkout option.

add_action('wpsc_paypal_ipn_processed', 'wpsc_pp_ipn_tasks');
function wpsc_pp_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 PayPal 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.

Stripe Checkout

Here is example code if you are using the Stripe checkout option.

add_action('wpsc_stripe_ipn_processed', 'wpsc_stripe_post_payment_tasks');
function wpsc_stripe_post_payment_tasks($ipn_data)
{
//You can write the $ipn_data array's content to a file.
$firstname = $ipn_data['first_name'];
$lastname = $ipn_data['last_name'];
$email = $ipn_data['payer_email']
//TODO - Do something with the data
}

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

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

WP Express Checkout Plugin
wordpress_estore_icon
wordpress membership plugin icon
wordpress_affiliate_plugin_icon

Copyright © 2025 | eCommerce Plugins