• Home
  • Demo
  • Buy Now
RISE - Ultimate Project Manager & CRM
    RISE - Ultimate Project Manager & CRMInstallation & MaintenancePersonalizationSettingsClient ManagementAI AssistantInvoices & PaymentsProjects & TasksTeam & CollaborationProductivity ToolsSales & ServicesRISE ReportsPluginsFAQChange logs
Mailbox PluginLanding Page Builder PluginEasy Backup PluginSquare Payment Method PluginLogin as Client PluginAsset Management Plugin2 Factor Authentication PluginPassword Manager PluginSocial Login PluginGoogle Meet Integration PluginSpreadsheets PluginZoom Integration PluginAuto Attendance PluginWhiteboards PluginDocs PluginBlog Manager PluginWhatsApp Link PluginMicrosoft Teams Integration PluginProperty Management PluginTelegram Notification PluginAWS S3 Integration PluginWhatsApp Notification PluginWasabi Integration PluginBackblaze Integration PluginCloudflare R2 Integration PluginDigitalOcean Spaces Integration PluginAdyen Payment Method PluginbKash Payment Method Pluginiyzico Payment Method PluginJazzCash Payment Method PluginMercado Pago Payment Method PluginMidtrans Payment Method PluginMontonio Payment Method PluginN-Genius Payment Method PluginNagad Payment Method PluginPayFast Payment Method PluginPaysera Payment Method PluginPaystack Payment Method PluginPix Payment Method PluginRazorpay Payment Method PluginRocket Payment Method PluginSSLCommerz Payment Method Plugin
  1. Docs
  2. RISE - Ultimate Project Manager & CRM
  3. Plugins

Add your own data to store items from a plugin

Your plugin can save its own values with an item, for example a Paddle product ID, a regular and an extended price ID, or a license type. RISE copies these values to the order when a client buys the item. Your plugin can then use them when the client pays and when the order is delivered.

The values are saved as plugin data, grouped by your plugin name:

{"paddle": {"product_id": "pro_01", "price_id": "pri_01", "license_type": "single"}}

Use a short, unique name for your plugin. Names and keys can only have letters, numbers, _ and -. Values are cleaned before they are saved.

Step 1: Add fields to the item form

Use one of these actions to add your fields to the item form (Sales > Items):

ActionWhere it shows
app_hook_item_modal_form_extensionOn every item form, below the custom fields. It doesn't need the Store module.
app_hook_item_modal_form_store_optionsIn the Store options window of the item (Sales > Items > Store options icon). It shows only when the Store module is on.

Both get the item. Name your fields plugin_data[your_plugin][key]. For example, a regular price ID and an extended price ID:

app_hooks()->add_action('app_hook_item_modal_form_extension', function ($item_info) {
    $regular_price_id = \App\Libraries\Store_manager::get_plugin_data($item_info, "paddle", "regular_price_id");
    $extended_price_id = \App\Libraries\Store_manager::get_plugin_data($item_info, "paddle", "extended_price_id");
    echo view("Paddle\Views\item_fields", array(
        "regular_price_id" => $regular_price_id,
        "extended_price_id" => $extended_price_id
    ));
});

In your view, add the fields like the other fields of the form:

<input type="text" name="plugin_data[paddle][regular_price_id]" value="<?php echo esc($regular_price_id); ?>" class="form-control" />
<input type="text" name="plugin_data[paddle][extended_price_id]" value="<?php echo esc($extended_price_id); ?>" class="form-control" />

When the item is saved, RISE saves your fields with the item:

{"paddle": {"regular_price_id": "pri_01", "extended_price_id": "pri_02"}}

The data of other plugins is kept. If your fields are not posted, your saved values are kept too. Each key is saved on its own, so you can add some fields to the item form and others to the Store options window. To clear a value, post the field empty.

Step 2: Check the values (optional)

Use the app_filter_item_plugin_data filter to check or change the values before they are saved:

app_hooks()->add_filter('app_filter_item_plugin_data', function ($data, $info) {
    //$info: item_id, item_info, posted_data
    if (isset($data["paddle"]["price_id"]) && strpos($data["paddle"]["price_id"], "pri_") !== 0) {
        $data["paddle"]["price_id"] = "";
    }
    return $data;
}, 10, 2);

Save more data in your own tables (optional)

The app_hook_item_saved action runs after an item is saved from the item form. Use it if your plugin keeps its own table:

app_hooks()->add_action('app_hook_item_saved', function ($data) {
    //$data: item_id, item_info (the saved item), old_item_info (null for a new item), is_new
    $regular_price_id = \App\Libraries\Store_manager::get_plugin_data($data["item_info"], "paddle", "regular_price_id");
});

You can also read your own posted fields here with service("request")->getPost().

Step 3: Change the values for each order item (optional)

When a client adds the item to the cart, RISE copies the item's plugin data to the cart item. It is updated if you change the item, until the order is placed. Then it stays with the order item.

Use the app_filter_store_order_item_plugin_data filter to change it for one order item, for example by the buyer inputs:

app_hooks()->add_filter('app_filter_store_order_item_plugin_data', function ($data, $info) {
    //$info: item_info, options (buyer inputs: array of title and value), quantity
    foreach ($info["options"] as $option) {
        if ($option["title"] === "License") {
            $data["paddle"]["license_type"] = $option["value"];
        }
    }
    return $data;
}, 10, 2);

Add buyer inputs from your plugin (optional)

Buyer inputs are the fields a client fills before adding an item to the cart. You add them in the item form. A plugin can also add them with the app_filter_store_item_checkout_fields filter, for example a license type list:

app_hooks()->add_filter('app_filter_store_item_checkout_fields', function ($fields, $info) {
    //$info: item_info
    if (\App\Libraries\Store_manager::get_plugin_data($info["item_info"], "paddle", "extended_price_id")) {
        $fields[] = array("title" => "License", "type" => "select", "options" => "Regular,Extended", "required" => 1);
    }
    return $fields;
}, 10, 2);

A field has a title, a type (text, textarea, number or select), options (for select, separated by commas), a placeholder and required (1 or 0). Add your fields at the end of the list. Your fields are not shown in the item form, so they are not saved with the item.

Give each option its own price (optional)

A select field can also have a default option and a price for each option. The item page selects the default option first and shows the price of the chosen option. The cart uses the same price.

$fields[] = array(
    "title" => "License",
    "type" => "select",
    "options" => "Regular,Extended",
    "default" => "Regular",
    "option_rates" => array("Regular" => $info["item_info"]->rate, "Extended" => 299),
    "required" => 1
);

The default must be one of the options. Prices must be numbers of 0 or more. An option without a price uses the item's rate.

Change the price by the buyer inputs (optional)

By default the price of a cart item is the item's rate, or the price of the chosen option (see above). For other rules, use the app_filter_store_order_item_rate filter, for example a lower price for a large quantity:

app_hooks()->add_filter('app_filter_store_order_item_rate', function ($rate, $info) {
    //$info: item_info, options (buyer inputs: array of title and value), quantity
    foreach ($info["options"] as $option) {
        if ($option["title"] === "License" && $option["value"] === "Extended") {
            return 299;
        }
    }
    return $rate;
}, 10, 2);

Return a number of 0 or more. The cart checks the price again each time it loads, so the price always follows the item and the chosen inputs.

Change the sales count (optional)

When Show sales count is on in Settings > Store, the store shows the total quantity sold of each item in delivered orders. Use the app_filter_store_item_sales_count filter to change it, for example to add the sales of your old shop:

app_hooks()->add_filter('app_filter_store_item_sales_count', function ($sales_count, $info) {
    //$info: item_info
    return $sales_count + 120;
}, 10, 2);

Return a number of 0 or more. Nothing is shown when the count is 0.

Read the values

WhereHow
Item or order item\App\Libraries\Store_manager::get_plugin_data($row, "paddle", "price_id")
Payment gateway$payment["items"][0]["plugin_data"]["paddle"]["price_id"] (see Add a payment gateway from a plugin - Your own online payment method for invoices and orders)
Invoice\App\Libraries\Payment_processor::get_invoice_payment_items($invoice_info) gives the invoice lines with the plugin data of the order items (or of the items)

Show the values on the order

Use the app_filter_order_item_info_html filter to add text under an item on the order page. It is shown to team members and clients, so check is_staff:

app_hooks()->add_filter('app_filter_order_item_info_html', function ($html, $info) {
    //$info: order_item, plugin_data, is_staff
    $price_id = $info["plugin_data"]["paddle"]["price_id"] ?? "";
    if ($price_id && $info["is_staff"]) {
        $html .= "
Paddle: " . esc($price_id) . "
"; } return $html; }, 10, 2);

When the order is delivered

The app_hook_store_order_released action runs when the order's deliverables are released, for example after the invoice is fully paid. Use it to create license keys or call your provider:

app_hooks()->add_action('app_hook_store_order_released', function ($data) {
    //$data: order_id, order_info
});

It can run again if a team member withholds the order and releases it again. It also runs again when the server stopped while it was running (ex: a restart): RISE marks the order as released only after this hook, and the next try (ex: the payment retry) runs it again. So make sure your code doesn't do the same work twice. For example, check what you created for the order already.

order_info already has the delivered_at value. One order is released by one request at a time.

Add downloads to the deliverables

The order page shows a Downloads card with one row per order item: its short description, its files in a download menu, and its notes under the item name. Use the app_filter_order_item_deliverable_links filter to add your own lines and download buttons to an order item, for example a license key and its certificate:

app_hooks()->add_filter('app_filter_order_item_deliverable_links', function ($links, $info) {
    //$info: order_item, item_info, plugin_data
    $links[] = array("title" => "License key", "text" => "abc-123", "icon" => "key");
    $links[] = array("title" => "Download license", "url" => get_uri("my_plugin/license/" . $info["order_item"]->id), "icon" => "file-text");
    return $links;
}, 10, 2);

A line with a url is added to the download menu of the item. A line with only a text (no url) is not shown on the Downloads card. Clients see them only after the deliverables are released. Your download page must still check that the client owns the order.

Know when a client downloads a file

The app_hook_store_delivery_file_downloaded action runs when a client downloads a delivery file of an order:

app_hooks()->add_action('app_hook_store_delivery_file_downloaded', function ($data) {
    //$data: order_item, order_info, file
});

It doesn't run for team members.

Close the deliverables of one order item

Releasing or withholding works for the whole order. To close only one item of a released order, for example when the buyer got a refund for that item, use the app_filter_store_order_item_delivery_available filter:

app_hooks()->add_filter('app_filter_store_order_item_delivery_available', function ($available, $info) {
    //$info: order_item
    if (my_plugin_is_refunded($info["order_item"]->id)) {
        return false;
    }
    return $available;
});

When it returns false, the client can't see or download the files and notes of that item. The item shows "Not available" and your deliverable links are still shown. Team members always see everything.

A closed item also stops counting for reviews. To delete the review the client wrote, call \App\Libraries\Store_feedback::delete_review_of_order_item($order_item_id) after the refund.

Was this article helpful? Yes No
How can we improve this article?
© 2026 Fairsketch
Home Get Support Buy Now

Delete?

Are you sure? You won't be able to undo this action!
To do