API (function, action and class reference)
This sections contains details about LemonStand classes and functions.
Helper functions
Helper functions are PHP functions which help you to build websites in LemonStand.
- checkbox_state - returns checked="checked" string if its parameter is TRUE. Useful for programming form checkboxes.
- content_block - inserts editable content block into a page
- customer_logout - closes current customer session and redirects browser to a specified location.
- flash_message - returns a message previously set by a page action.
- format_currency - returns a number in currency format.
- h - returns string in HTML-safe format, replacing < with < and so on.
- include_resources - outputs HTML links to JavaScript and CSS libraries required for LemonStand AJAX framework
- open_form - outputs HTML FORM tag with the ACTION attribute pointing to a current page (by default).
- option_state - outputs string 'selected="selected"' if the first parameter matches the second parameter. Useful for programming SELECT elements.
- post - returns an element from the POST array by its name (key). Allows to specify a default value for the case if the specified element not found.
- radio_state - alias for the checkbox_state function, use it for programming radio buttons.
- root_url - returns an URL of a specified resource relative to the LemonStand domain root
- site_url - outputs an absolute URL to a specified website page.
- tax_incl_label - returns the tax included label text, for example "including GST"
JavaScript framework
LemonStand JavaScript framework allows you to send AJAX requests to the server and update page content without reloading the whole page.
Common classes
Common classes are provided by the programming framework.
- Db_ActiveRecord - base database record management class.
- Db_DataCollection - represents a set of database records.
- Db_File - represents a file (or image) in the LemonStand database.
- Phpr_DateTime - class for working with date/time values.
- Phpr_Pagination - helps in creating pagination of database objects.
- Phpr_Response - the class which you can use for managing the HTTP response and for redirecting the browser to a specific page.
CMS module classes
Classes included to the LemonStand CMS module. You can access the controller and page objects in the page, partials, templates and actions code.
- Cms_Controller - renders the website pages, templates and partials.
- Cms_Page - represents a website page.
- Cms_VisitorPreferences - allows to store visitor preferences in the server session storage.
Shop module classes
Classes provided by the Shop module. You can access these classes on your pages, partials and templates to load data about eCommerce objects - products, categories, customers and so on.
- Shop_Cart - represents a visitor's shopping cart.
- Shop_CartItem - represents an item in a customer shopping cart.
- Shop_Category - represents a product category.
- Shop_CheckoutAddressInfo - represents a customer's shipping or billing address
- Shop_CheckoutData - contains the checkout-related information and can be used for creating an order.
- Shop_ComparisonList - manages the product comparison list.
- Shop_Country - represents a country.
- Shop_CountryState - represents a state of a country.
- Shop_CustomGroup - represents a custom product group such as Featured Products.
- Shop_Customer - represents a customer.
- Shop_CustomerGroup - represents a customer group.
- Shop_Manufacturer - represents a product manufacturer.
- Shop_Order - represents an order.
- Shop_OrderItem - represents an item of a specific order.
- Shop_OrderStatus - represents a status of an order.
- Shop_PaymentMethod - represents a payment method.
- Shop_Product - represents a product.
- Shop_ProductFile - represents a file in a downloadable product.
- Shop_ShippingOption - represents a shipping option.
Shop module actions
Actions provided by the Shop module.
- shop:cart - base action for the Cart page.
- shop:category - base action for the Category page.
- shop:change_password - base action for the Change Password page.
- shop:checkout - base action for the Checkout page.
- shop:compare - base action for the Compare Products page.
- shop:login - base action for the customer login page.
- shop:order - base action for the order details page.
- shop:orders - base action for the customer order list page.
- shop:manufacturers - base action for the manufacturer list page.
- shop:manufacturer - base action for the manufacturer details page page.
- shop:password_restore - base action for the customer password restore page.
- shop:pay - base action for the Pay page.
- shop:payment_information - base action for the custom payment pages
- shop:payment_receipt - base action for the order payment receipt page.
- shop:product - base action for the product page.
- shop:search - base action for the product search page.
- shop:signup - base class for the customer registration page.
-
Step-by-step checkout actions - describes actions for creating the step-by-step checkout process and custom checkout scenarios.
- shop:checkout_billing_info - base action for the Billing Information step of the checkout process
- shop:checkout_shipping_info - base action for the Shipping Information step of the checkout process
- shop:checkout_shipping_method - base action for the Shipping Method step of the checkout process
- shop:checkout_payment_method - base action for the Payment Method step of the checkout process.
- shop:checkout_order_review - base action for the Order Review checkout page, the last page in the conventional checkout process.
Shop module common AJAX handlers
A list of AJAX handlers which do not belong to a specific action, and can be called from any page.
- shop:on_addToCompare - adds a product to the comparison list.
- shop:on_removeFromCompare - removes a product from the product comparison list.
- shop:on_clearCompareList - removes all products from the product comparison list.
Next: checkbox_state
Previous: Building your online store
Return to Developer's Guide
Comments
No comments posted so far.
Add your comment
Loading form...