Order_History
Provides a shortcode to display the order history for logged-in users.
Handles rendering both the order history list and individual order details.
- Full name:
\BigCommerce\Shortcodes\Order_History
- This class implements:
\BigCommerce\Shortcodes\Shortcode
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
NAME | public | string | ’bigcommerce_order_history’ |
ORDER_ID_QUERY_ARG | public | string | ’order_id’ |
Methods
__construct
Constructor for the Order_History class.
public __construct(\BigCommerce\Rest\Orders_Shortcode_Controller $rest_controller): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$rest_controller | \BigCommerce\Rest\Orders_Shortcode_Controller | The REST controller used for AJAX requests. |
default_attributes
Get the default attributes for the order history shortcode.
public static default_attributes(): array
- This method is static.
Return Value:
Default attributes including pagination, per-page limits, and AJAX settings.
render
Render the order history or order details based on the attributes and query parameters.
public render(array $attr, mixed $instance): string
Parameters:
Parameter | Type | Description |
---|---|---|
$attr | array | Shortcode attributes. |
$instance | mixed | The current instance (not used). |
Return Value:
The rendered HTML output or an empty string for unauthorized users.
Automatically generated on 2025-01-21