Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_Eshop class

• Introduction

E-shop business layer.

• Class synopsis

AMI_Eshop {
/* Methods */
// Return calculated price data for specified additional price.
public calcPrice ( $aPrice ) returns array;
// Converts currency.
public convertCurrency ( float $price, string $from, string $to ) returns float;
// Formats money.
public formatMoney ( float $value, [ string $currency = null ], [ bool $onlyPositive = TRUE ] ) returns string;
// Returns other prices columns (for items & cats).
public getOtherPricesColumns ( [ string $prefix = '' ], [ string $catPrefix = 'cat_' ] ) returns array;
// Returns information about product by id.
public getProductInfo ( int $itemId ) returns array|null;
// Returns TRUE if fractional product quantity is allowed.
public isFractionalQtyAllowed ( ) returns bool;
}
Tags:
since 6.0.2
resource eshop AMI::getSingleton('eshop')

• Class Methods

// Return calculated price data for specified additional price.
public calcPrice ( $aPrice ) returns array;
  • array $aPrice
    Price data array, keys:
    • price: price value;
    • priceNumber: price number 1..N, empty by default;
    • tax: tax value;
    • taxType: tax type ('percent', 'abs');
    • chargeTaxType: charge tax type ('charge', 'detach');
    • discount: discount value;
    • discountType: discount type ('percent', 'abs')
    • currency: currency code of result price;
    • dbCurrency: currency code of incoming price;
    • addCurrency: add curency name to result, true by default.
// Converts currency.
public convertCurrency ( float $price, string $from, string $to ) returns float;
  • float $price
    Price to convert
  • string $from
    Source currency code
  • string $to
    Destination currency code
// Formats money.
public formatMoney ( float $value, [ string $currency = null ], [ bool $onlyPositive = TRUE ] ) returns string;
  • float $value
    Value to format
  • string $currency
    Currency code
  • bool $onlyPositive
    Flag specifying to return only positive numbers
Tags:
since 6.0.6
// Returns other prices columns (for items & cats).
public getOtherPricesColumns ( [ string $prefix = '' ], [ string $catPrefix = 'cat_' ] ) returns array;
  • string $prefix
    Item columns prefix, pass NULL to exclude item fields
  • string $catPrefix
    Category columns prefix, pass NULL to exclude category fields
// Returns information about product by id.
public getProductInfo ( int $itemId ) returns array|null;
  • int $itemId
    Catalog item id
// Returns TRUE if fractional product quantity is allowed.
public isFractionalQtyAllowed ( ) returns bool;