Class Hook_catalogue_items

Description

Located in /sources/hooks/systems/ecommerce/catalogue_items.php (line 21)


	
			
Method Summary
AUTO_LINK add_order (array $product_det)
AUTO_LINK add_purchase_order (AUTO_LINK $product, array $product_det)
float calculate_product_price (float $item_price, float $tax, integer $item_weight)
float calculate_shipping_cost (float $item_weight)
float calculate_tax (float $gross_cost, float $tax_percentage)
?integer get_available_quantity (ID_TEXT $product)
void get_custom_product_map_fields (AUTO_LINK $id, array &$map)
tempcode get_message (AUTO_LINK $product)
array get_products ([boolean $site_lang = false], [?ID_TEXT $search = NULL], [boolean $search_titles_not_ids = false])
array get_product_details ([?AUTO_LINK $pid = NULL])
?SHORT_TEXT get_product_image (ID_TEXT $catalogue_name, AUTO_LINK $entry_id)
boolean is_available (ID_TEXT $product, [?MEMBER $member = NULL], [integer $req_quantity = 1])
tempcode product_info (AUTO_LINK $id)
tempcode show_cart_entry (tempcode &$shopping_cart, array $entry)
void update_stock (AUTO_LINK $entry_id, integer $quantity)
Methods
add_order (line 252)

Add an order

  • return: Order id of newly added order.
AUTO_LINK add_order (array $product_det)
  • array $product_det: Array of product details.
add_purchase_order (line 302)

Add order - (order coming from purchase module)

  • return: order id
AUTO_LINK add_purchase_order (AUTO_LINK $product, array $product_det)
  • AUTO_LINK $product: Product id
  • array $product_det: Product details
calculate_product_price (line 453)

Calculate product price

  • return: Calculated shipping cost for the product
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 (line 438)

Calculate shipping cost of product.

  • return: Calculated shipping cost for the product
float calculate_shipping_cost (float $item_weight)
  • float $item_weight: Weight of product
calculate_tax (line 420)

Calculate tax of catalogue product.

  • return: Calculated tax for the product.
float calculate_tax (float $gross_cost, float $tax_percentage)
  • float $gross_cost: Gross cost of product.
  • float $tax_percentage: Tax in percentage
get_available_quantity (line 140)

Get currently available quantity of selected product

  • return: Quantity (NULL: no limit).
?integer get_available_quantity (ID_TEXT $product)
  • ID_TEXT $product: The product.
get_custom_product_map_fields (line 583)

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_message (line 180)

Get the message for use in the purchase wizard

  • return: The message.
tempcode get_message (AUTO_LINK $product)
  • AUTO_LINK $product: The product in question.
get_products (line 34)

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.

  • return: A map of product name to list of product details.
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_product_details (line 209)

Get the products details

  • return: A map of product name to list of product details.
array get_product_details ([?AUTO_LINK $pid = NULL])
  • ?AUTO_LINK $pid: Product ID (NULL: read from environment, product_id)
get_product_dispatch_type (line 561)

Function to return dispatch type of product.

  • return: Dispatch type (manual/automatic)
ID_TEXT get_product_dispatch_type ()
get_product_image (line 476)

Find product image for a specific catalogue product

  • return: Image name (NULL: no image)
?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
is_available (line 98)

Check whether the product code is available for purchase by the member.

  • return: Whether it is.
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.
product_info (line 572)

Return product info details

  • return: Product information
tempcode product_info (AUTO_LINK $id)
  • AUTO_LINK $id: Product id
show_cart_entry (line 353)

Show shopping cart entries

  • return: Tempcode object of shopping cart result table.
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.
update_stock (line 496)

Calculate product price

void update_stock (AUTO_LINK $entry_id, integer $quantity)
  • AUTO_LINK $entry_id: Catalogue entry id
  • integer $quantity: Quantity

Documentation generated on Sun, 02 Jan 2011 23:10:26 +0000 by phpDocumentor 1.4.3