shopp_resource_{src}

called dynamically on resource requests to Shopp.

add_action('shopp_resource_{src}', [callback]);

Description

Runs dynamically on page load when a shopp resource is requested, itentified by name in the request src variable. Examples include shopp_resource_download for product downloads, and shopp_resource_export_purchases for file download of purchase export file, as well as shopp_resource_export_customers for file download of customer export file.

Example

// Generic example, won't actually work
add_action('shopp_resource_{src}', 'my_function');
function my_function () {
// do stuff
}

add_action('shopp_resource_download', 'download_requested');
function download_requested () {
// do stuff
$id = $_GET['s_dl']; // See core/flow/Resources.php in the Resources::download() method
// ...
}

// Some other built-in examples
// shopp_resource_help
add_action('shopp_resource_help', 'my_help_function');
function my_help_function () {
// do stuff
}

// shopp_resource_export_purchases
add_action('shopp_resource_export_purchases', 'my_purchase_export_function');
function my_purchase_export_function () {
// do stuff
}

// shopp_resource_export_customers
add_action('shopp_resource_export_customers', 'my_customer_export_function');
function my_customer_export_function () {
// do stuff
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar