Functions

Function to add new item to cart.

add_to_cart(array $product_det) 
package shopping

Parameters

$product_det

array

Product details

Delete incomplete orders from ages ago.

delete_incomplete_orders() 
package shopping

Delete any pending orders for the current user. E.g. if cart purchase was cancelled, or cart was changed.

delete_pending_orders_for_current_user() 
package shopping

Delete cart contents for the current user.

empty_cart(boolean $soft_delete = false
package shopping

Parameters

$soft_delete

boolean

Whether to just do a soft delete, i.e. mark as deleted.

Find products in cart

find_products_in_cart() : array
package shopping

Returns

arrayProduct details in cart

Find current order ID

get_current_order_id() : \AUTO_LINK
package shopping

Returns

\AUTO_LINKOrder ID

Return list entry of common order statuses of orders

get_order_status_list() : \Tempcode
package shopping

Returns

\TempcodeOrder status list entries

Find current order tax opt out status

get_order_tax_opt_out_status() : \BINARY
package shopping

Returns

\BINARYTax opt out status of current order

Return a string of order products to export as csv

get_ordered_product_list_string(\AUTO_LINK $order_id) : \LONG_TEXT
package shopping

Parameters

$order_id

\AUTO_LINK

Order ID

Returns

\LONG_TEXTProducts names and quantity

Get product details array, according to the hook specified in the 'hook' GET parameter

get_product_details() : array
package shopping

Returns

arrayProduct details

Log cart actions

log_cart_actions(\ID_TEXT $action) 
package shopping

Parameters

$action

\ID_TEXT

The data

Payment step.

payment_form() : \Tempcode
package shopping

Returns

\TempcodeThe result of execution.

Tell the staff the shopping order was placed

purchase_done_staff_mail(\AUTO_LINK $order_id) 
package shopping

Parameters

$order_id

\AUTO_LINK

Order ID

Remove from cart.

remove_from_cart(array $product_to_remove) 
package shopping

Parameters

$product_to_remove

array

Products to remove

Stock maintain warning mail

stock_maintain_warn_mail(\SHORT_TEXT $product_name, \AUTO_LINK $product_id) 
package shopping

Parameters

$product_name

\SHORT_TEXT

Product name

$product_id

\AUTO_LINK

Product ID

Update cart

update_cart(array $product_det) 
package shopping

Parameters

$product_det

array

Product details

Stock reduction

update_stock(\AUTO_LINK $order_id) 
package shopping

Parameters

$order_id

\AUTO_LINK

The ID