public final class CSProductUtil
extends java.lang.Object
The CSProductUtil
class includes methods for generating a product description, evaluating the prices
for a specified product option, and for getting the status of the specified product type.
CSProductOption
,
CSProductType
,
CSPrices
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildProductOptionDescription(java.lang.String strPropertyFile,
java.lang.Integer nProductOptionID,
java.lang.String strDescription,
java.lang.String strProductTypeName)
Build a product option's description from either a specified description, its associated attribute values or
parent product type name.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
double nDefaultPrice,
double nPrice,
int nDefaultVatSchemeID,
int nVatSchemeID,
double nVatFixed)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified price, shipping
and VAT information using the currency of the default country as defined by the iCM Commerce Settings.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
double nDefaultPrice,
double nPrice,
int nDefaultVatSchemeID,
int nVatSchemeID,
double nVatFixed,
int nDecimalPlaces)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified price, shipping
and VAT information using the currency of the default country as defined by the iCM Commerce Settings.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
double nDefaultPrice,
double nPrice,
int nDefaultVatSchemeID,
int nVatSchemeID,
double nVatFixed,
java.lang.String strCountryName)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified price, shipping
and VAT information using the currency of the specified country.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
double nDefaultPrice,
double nPrice,
int nDefaultVatSchemeID,
int nVatSchemeID,
double nVatFixed,
java.lang.String strCountryName,
int nDecimalPlaces)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified price, shipping
and VAT information using the currency of the specified country.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
int nProductOptionID)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified product option
using the currency of the default country as defined by the iCM Commerce Settings.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
int nProductOptionID,
int nDecimalPlaces)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified product option
using the currency of the default country as defined by the iCM Commerce Settings.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
int nProductOptionID,
java.lang.String strCountryName)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified product option
using the currency of the specified country.
|
static CSPrices |
getProductOptionPrices(java.lang.String strPropertyFile,
int nProductOptionID,
java.lang.String strCountryName,
int nDecimalPlaces)
Calculates the VAT, net price (including VAT) and gross price (excluding VAT) for the specified product option
using the currency of the specified country.
|
public static java.lang.String buildProductOptionDescription(java.lang.String strPropertyFile, java.lang.Integer nProductOptionID, java.lang.String strDescription, java.lang.String strProductTypeName) throws CSException
Any specified description will be used by default for the product option description. If a description has not been specified than the specified product option's associated attribute values will be used to build the product option description.
If the specified product option does not have any associated attribute values then the product option description will default to the specified product type name. If a product type name has not been specified then the product option's parent product type will be retrieved from the database.
strPropertyFile
- the property file that contains the connection detailsnProductOptionID
- the ID of the product option for which a description is to be builtstrDescription
- the description to be usedstrProductTypeName
- the name of the product type to be used if the product option does not have any associated attributesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, int nProductOptionID) throws CSException
The VAT, net price and gross price will be formatted to the number of decimal places defined by the iCM Commerce Settings.
strPropertyFile
- the property file that contains the connection detailsnProductOptionID
- the ID of the product option for which its prices are to be calculated and retrievedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, int nProductOptionID, int nDecimalPlaces) throws CSException
The VAT, net price and gross price will be formatted to the specified number of decimal places, if less than zero then zero will be used.
strPropertyFile
- the property file that contains the connection detailsnProductOptionID
- the ID of the product option for which its prices are to be calculated and retrievednDecimalPlaces
- the number of decimal places of the formatted prices, if less than zero then zero will be usedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, int nProductOptionID, java.lang.String strCountryName) throws CSException
The VAT, net price and gross price will be formatted to the number of decimal places defined by the iCM Commerce Settings.
strPropertyFile
- the property file that contains the connection detailsnProductOptionID
- the ID of the product option for which its prices are to be calculated and retrievedstrCountryName
- the name of the country for which the prices are to be calculatedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, int nProductOptionID, java.lang.String strCountryName, int nDecimalPlaces) throws CSException
The VAT, net price and gross price will be formatted to the specified number of decimal places, if less than zero then zero will be used.
strPropertyFile
- the property file that contains the connection detailsnProductOptionID
- the ID of the product option for which its prices are to be calculated and retrievedstrCountryName
- the name of the country for which the prices are to be calculatednDecimalPlaces
- the number of decimal places of the formatted prices, if less than zero then zero will be usedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, double nDefaultPrice, double nPrice, int nDefaultVatSchemeID, int nVatSchemeID, double nVatFixed) throws CSException
The VAT, net price and gross price will be formatted to the number of decimal places defined by the iCM Commerce Settings.
strPropertyFile
- the property file that contains the connection detailsnDefaultPrice
- the default country's price specified in the product type associated with the product optionnPrice
- the default country's price of the product optionnDefaultVatSchemeID
- the VAT scheme ID specified in the product type associated with the product optionnVatSchemeID
- the VAT scheme ID specified in the product optionnVatFixed
- the fixed VAT to be applied to the product option, but only if the VAT scheme requires itCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, double nDefaultPrice, double nPrice, int nDefaultVatSchemeID, int nVatSchemeID, double nVatFixed, int nDecimalPlaces) throws CSException
The VAT, net price and gross price will be formatted to the specified number of decimal places, if less than zero then zero will be used.
strPropertyFile
- the property file that contains the connection detailsnDefaultPrice
- the default country's price specified in the product type associated with the product optionnPrice
- the default country's price of the product optionnDefaultVatSchemeID
- the VAT scheme ID specified in the product type associated with the product optionnVatSchemeID
- the VAT scheme ID specified in the product optionnVatFixed
- the fixed VAT to be applied to the product option, but only if the VAT scheme requires itnDecimalPlaces
- the number of decimal places of the formatted prices, if less than zero then zero will be usedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, double nDefaultPrice, double nPrice, int nDefaultVatSchemeID, int nVatSchemeID, double nVatFixed, java.lang.String strCountryName) throws CSException
The VAT, net price and gross price will be formatted to the number of decimal places defined by the iCM Commerce Settings.
strPropertyFile
- the property file that contains the connection detailsnDefaultPrice
- the default country's price specified in the product type associated with the product optionnPrice
- the default country's price of the product optionnDefaultVatSchemeID
- the VAT scheme ID specified in the product type associated with the product optionnVatSchemeID
- the VAT scheme ID specified in the product optionnVatFixed
- the fixed VAT to be applied to the product option, but only if the VAT scheme requires itstrCountryName
- the name of the country for which the prices are to be calculatedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.public static CSPrices getProductOptionPrices(java.lang.String strPropertyFile, double nDefaultPrice, double nPrice, int nDefaultVatSchemeID, int nVatSchemeID, double nVatFixed, java.lang.String strCountryName, int nDecimalPlaces) throws CSException
The VAT, net price and gross price will be formatted to the specified number of decimal places, if less than zero then zero will be used.
strPropertyFile
- the property file that contains the connection detailsnDefaultPrice
- the default country's price specified in the product type associated with the product optionnPrice
- the default country's price of the product optionnDefaultVatSchemeID
- the VAT scheme ID specified in the product type associated with the product optionnVatSchemeID
- the VAT scheme ID specified in the product optionnVatFixed
- the fixed VAT to be applied to the product option, but only if the VAT scheme requires itstrCountryName
- the name of the country for which the prices are to be calculatednDecimalPlaces
- the number of decimal places of the formatted prices, if less than zero then zero will be usedCSPrices
object containing the calculated and formatted pricesCSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.