gomymobi: Knowledge Base

Usable store classes

Store built-in classes

- We already develop many built-in classes and pre-defined objects; you only need to use these objects to build your store themes.

- Depend on your context, some objects are not available to use, example: in listing page of products, you can not use object $Product to query details about product, or you can not use object $Shop_Order unless you are in order page.

- However, above examples are rare; basically, you may use all these global objects in any page in store. But be careful yourself.


You may use this declared object to use in any page of your store themes. This object contains all useful methods to work with store settings.

$shop array of store settings that fetched from both store table & site table or shop ID

Return: Object

Example: define a store object


Return an attribute (database table field) of store. Check out table of stores for fields you may get; with attributes of Paypal you may use: paypal_sandbox, paypal_email, paypal_prefix, paypal_pdt.

Return: String / Number

Example


Return a string of formatted timestamp with date format from store owner setting.

$time a timestamp

Return: String


Return favicon URL of store.

Return: String


Return an array of store payment settings.

Return: Array

Example


Return logo URL of store.

Return: String


Return URL of store.

Return: String

Example


Return a string of formatted price, based on store currency settings.

Return: String



You may use this declared object to use in any page of your store themes. This object contains the hierarchy structure of all categories from a store.

$categories array of all categories from a store that fetched from both category table. Or you may pass NULL or empty, this class shall get the current store autimatically.

Return: Object

Example: fetch all categories from table then define an object of store categories

Example: best simple solution

2 above solutions return object with data like below


Return array of category objects in hierarchy structure.

Return: Array of Objects

Example: you may use this object to create a hierarchy menu bar


don't hesitate to contact us if your thing is outside of this section
by using contact button above or send directly to gomymobi@gmail.com with subject: [contactgmm]
if could not receive our reply within 24 hours, please resend ticket again