Add an order
AUTO_LINK
add_order
(array $product_det)
-
array
$product_det: Array of product details.
Add order - (order coming from purchase module)
AUTO_LINK
add_purchase_order
(AUTO_LINK $product, array $product_det)
-
AUTO_LINK
$product: Product id
-
array
$product_det: Product details
Calculate product price
float
calculate_product_price
(float $item_price, float $tax, integer $item_weight)
-
float
$item_price: Weight of product
-
float
$tax: Tax in percentage
-
integer
$item_weight: Weight of item
Calculate shipping cost of product.
float
calculate_shipping_cost
(float $item_weight)
-
float
$item_weight: Weight of product
Calculate tax of catalogue product.
float
calculate_tax
(float $gross_cost, float $tax_percentage)
-
float
$gross_cost: Gross cost of product.
-
float
$tax_percentage: Tax in percentage
Get currently available quantity of selected product
?integer
get_available_quantity
(ID_TEXT $product)
-
ID_TEXT
$product: The product.
Get custom fields for ecommerce product
void
get_custom_product_map_fields
(AUTO_LINK $id, array &$map)
-
AUTO_LINK
$id: Product entry Id
-
array
&$map: Map where product details are placed
Get the message for use in the purchase wizard
tempcode
get_message
(AUTO_LINK $product)
-
AUTO_LINK
$product: The product in question.
Get the products handled by this eCommerce hook.
IMPORTANT NOTE TO PROGRAMMERS: This function may depend only on the database, and not on get_member() or any GET/POST values. Such dependencies will break IPN, which works via a Guest and no dependable environment variables. It would also break manual transactions from the Admin Zone.
array
get_products
([boolean $site_lang = false], [?ID_TEXT $search = NULL], [boolean $search_titles_not_ids = false])
-
boolean
$site_lang: Whether to make sure the language for item_name is the site default language (crucial for when we read/go to third-party sales systems and use the item_name as a key).
-
?ID_TEXT
$search: Product being searched for (NULL: none).
-
boolean
$search_titles_not_ids: Whether $search refers to the product name rather than the product_id.
Get the products details
array
get_product_details
([?AUTO_LINK $pid = NULL])
-
?AUTO_LINK
$pid: Product ID (NULL: read from environment, product_id)
Function to return dispatch type of product.
ID_TEXT
get_product_dispatch_type
()
Find product image for a specific catalogue product
?SHORT_TEXT
get_product_image
(ID_TEXT $catalogue_name, AUTO_LINK $entry_id)
-
ID_TEXT
$catalogue_name: Catalogue name
-
AUTO_LINK
$entry_id: Catalogue entry id
Check whether the product code is available for purchase by the member.
boolean
is_available
(ID_TEXT $product, [?MEMBER $member = NULL], [integer $req_quantity = 1])
-
ID_TEXT
$product: The product.
-
?MEMBER
$member: The member we are checking against (NULL: current meber).
-
integer
$req_quantity: The number required.
Return product info details
tempcode
product_info
(AUTO_LINK $id)
-
AUTO_LINK
$id: Product id
Show shopping cart entries
tempcode
show_cart_entry
(tempcode &$shopping_cart, array $entry)
-
tempcode
&$shopping_cart: Tempcode object of shopping cart result table.
-
array
$entry: Details of new entry to the shopping cart.
Calculate product price
void
update_stock
(AUTO_LINK $entry_id, integer $quantity)
-
AUTO_LINK
$entry_id: Catalogue entry id
-
integer
$quantity: Quantity