Difference between revisions of "Product class"
Line 9: | Line 9: | ||
{{CGscriptMethods_Template|ReturnType=number|Name=<nowiki>CostInCurrency</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=number|Name=<nowiki>CostInCurrency</nowiki>|Parameters= | ||
{{CGscriptParameters_Template|Type=string|Name=<nowiki>currency</nowiki>|Description=<nowiki>Currency to use for calculations. Use empty for default currency</nowiki>}} | {{CGscriptParameters_Template|Type=string|Name=<nowiki>currency</nowiki>|Description=<nowiki>Currency to use for calculations. Use empty for default currency</nowiki>}} | ||
− | |Description=<nowiki> | + | |Description=<nowiki>Unit price</nowiki>}} |
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}} | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}} | ||
|Properties= | |Properties= | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Category</nowiki>|HasGetter=1|Description=<nowiki>Category of the Product</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Category</nowiki>|HasGetter=1|Description=<nowiki>Category of the Product</nowiki>}} | ||
− | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>CostInDefaultCurrency</nowiki>|HasGetter=1|Description=<nowiki> | + | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>CostInDefaultCurrency</nowiki>|HasGetter=1|Description=<nowiki>Unit price</nowiki>}} |
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>CostInPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points does this product cost</nowiki>}} | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>CostInPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points does this product cost</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>GiftPoints</nowiki>|HasGetter=1|Description=<nowiki>Bonus points awarded when buying this product</nowiki>}} | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>GiftPoints</nowiki>|HasGetter=1|Description=<nowiki>Bonus points awarded when buying this product</nowiki>}} | ||
Line 25: | Line 25: | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=array|Name=<nowiki>ProductOptions</nowiki>|HasGetter=1|Description=<nowiki>Get the options of this product, ordered by points then by localizedName</nowiki>}} | {{CGscriptProperties_Template|ReturnType=array|Name=<nowiki>ProductOptions</nowiki>|HasGetter=1|Description=<nowiki>Get the options of this product, ordered by points then by localizedName</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>PurchasePrice</nowiki>|HasGetter=1|Description=<nowiki>Purchase price</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>RecommendedPrice</nowiki>|HasGetter=1|Description=<nowiki>Recommended price</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Description=<nowiki>Resource id of the Product</nowiki>}} | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Description=<nowiki>Resource id of the Product</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ResourceName</nowiki>|HasGetter=1|Description=<nowiki>Name of the Product</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ResourceName</nowiki>|HasGetter=1|Description=<nowiki>Name of the Product</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}} | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Weight</nowiki>|HasGetter=1|Description=<nowiki>Weight in kg</nowiki>}} | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Weight</nowiki>|HasGetter=1|Description=<nowiki>Weight in kg</nowiki>}} | ||
+ | |StaticMethods= | ||
+ | {{CGscriptMethods_Template|ReturnType=Array of Product|Name=<nowiki>Product_getByAllAccessableProductCategory</nowiki>|Description=<nowiki>Fetch all the products the user currently has access to view in the configured order</nowiki>}} | ||
}} | }} |
Latest revision as of 05:06, 13 March 2024
Product
Represents a Product.
Parent class
Inherits from object
Constructors
- (int ResourceId "Resource Id of the Product") - Instanciate an existing instance using the resource id of a product
Methods
- number CostInCurrency(string currency "Currency to use for calculations. Use empty for default currency") - Unit price
- (From object) string ToString() - The string representation of the object.
Properties
- string Category { get; } - Category of the Product
- number CostInDefaultCurrency { get; } - Unit price
- int CostInPoints { get; } - How many points does this product cost
- int GiftPoints { get; } - Bonus points awarded when buying this product
- object GroupResourceId { get; } - Resource id of the group contains product (product supplier). if product doesn't belong any group, return empty
- string ImageUrl { get; } - Url to the main image of the product
- bool IsPhysical { get; } - Is the product something that needs to be physically delivered
- string LocalizedDescription { get; } - Localized description of the Product. This is HTML
- Dictionary LocalizedDescriptions { get; } - Localized Descriptions of the Product
- string LocalizedName { get; } - Localized Name of the Product
- Dictionary LocalizedNames { get; } - Localized Names of the Product
- string ObjectTypeName { get; } - The name of the type of object.
- array ProductOptions { get; } - Get the options of this product, ordered by points then by localizedName
- number PurchasePrice { get; } - Purchase price
- number RecommendedPrice { get; } - Recommended price
- int ResourceId { get; } - Resource id of the Product
- string ResourceName { get; } - Name of the Product
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
- int Weight { get; } - Weight in kg
Static Methods
- Array of Product Product_getByAllAccessableProductCategory() - Fetch all the products the user currently has access to view in the configured order