ClassesBigCommerceFormsProduct Review Handler

Product_Review_Handler

Constants

ConstantVisibilityTypeValue
ACTIONpublicstring’product-review’

Methods

__construct

Product_Review_Handler constructor.

public __construct(\BigCommerce\Api\v3\Api\CatalogApi $api): mixed

Parameters:

ParameterTypeDescription
$api\BigCommerce\Api\v3\Api\CatalogApiThe API instance to interact with BigCommerce’s catalog.

handle_request

Handle the form submission for product reviews.

public handle_request(array $submission): void

Parameters:

ParameterTypeDescription
$submissionarrayThe form submission data.

remove_form_messages_from_post_content

Do not show product review form error/success messages above the post content. They will be rendered with the form.

public remove_form_messages_from_post_content(bool $show, int $post_id): bool

Parameters:

ParameterTypeDescription
$showboolWhether to show messages above content.
$post_idintThe post ID to check.

Return Value:

Whether to show the messages.


toggle_reviews_form_availability

Handle the visibility of the product reviews form.

public toggle_reviews_form_availability(bool $enabled, int $post_id): bool

Parameters:

ParameterTypeDescription
$enabledboolWhether the form is enabled.
$post_idintThe post ID to check.

Return Value:

Whether to display the reviews form.



Automatically generated on 2025-01-21