ePages 7.47.0 - DE_EPAGES/Order/API/ProductValidator.pm

Package DE_EPAGES::Order::API::ProductValidator

helper class for stock level shop setting, this is use by the REST API

@EXPORT_OK
ValidateStockLevelSettings
ValidateAvailibilityVisibilitySettings

Functions

ValidateAvailibilityVisibilitySettings
ValidateStockLevelSettings

ValidateAvailibilityVisibilitySettings

Check if products is visible and available Throws an error in case of product is not visible or not available

Syntax
ValidateAvailibilityVisibilitySettings( $Product );
Input
$Product (DE_EPAGES::Product::API::Object::Product)
Product Object

ValidateStockLevelSettings

Check if has enough products on stock, according to the shop setting Throws an error in case of low stock level and setting restrition

Syntax
ValidateStockLevelSettings( $Product, $RequestQuantity );
Input
$Product (DE_EPAGES::Product::API::Object::Product)
Product Object
$RequestQuantity (string)
Quantity to be request on the lineItem