ClassesBigCommerceShortcodesOrder History

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.

Constants

ConstantVisibilityTypeValue
NAMEpublicstring’bigcommerce_order_history’
ORDER_ID_QUERY_ARGpublicstring’order_id’

Methods

__construct

Constructor for the Order_History class.

public __construct(\BigCommerce\Rest\Orders_Shortcode_Controller $rest_controller): mixed

Parameters:

ParameterTypeDescription
$rest_controller\BigCommerce\Rest\Orders_Shortcode_ControllerThe 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:

ParameterTypeDescription
$attrarrayShortcode attributes.
$instancemixedThe current instance (not used).

Return Value:

The rendered HTML output or an empty string for unauthorized users.



Automatically generated on 2025-01-21