Menu Close

Get Support From ShopWired Close

All systems fully operational

Subscribe To Updates
Prefer To Live Chat? Chat directly with ShopWired support Available from 9.00am to 10.00pm Monday to Friday Quickest response time
Send A Message
Response within 24 hours

Menu Close

Menu

Global objects

Global objects can be accessed from any file or view in your theme.


theme

global.theme.settings

The attributes of the theme.settings object are as defined in the theme settings file.


header

global.header

This is a required object that must be present in master.twig. It must be placed within the HTML <head> tag and dynamically loads all the required meta tags for a page and any other scripts or tags entered into the account (such as the visitor tracking scripts).


footer

global.footer

Similar to the global.header object, this is a required object that must be present in master.twig. It should be placed immediately before the closing </body> tag of the document and loads scripts and other code entered into the account (such as the live chat script).


basket

global.basket.value

Returns the total (currency) value of products in the visitor's shopping basket.


global.basket.items

Returns the total number of items in the visitor's shopping basket.


global.shipping_rate_id

Returns the ID of the shipping rate selected by the customer (if one has been selected).


global.shipping_country_id

Returns the ID of the shiping country selected by the customer (if one has been selected).


wishlist

global.wishlist.items

Returns the total number of items in the visitor's wishlist.


current

global.current_url

Returns the URL of the current page.


global.current_path

Returns the path of the current page.


business

The business object has a range of attributes for different details about the account, e.g. the logo URL. View more details here.


customer

The customer object has a range of attributes relating to a visitor (if they are logged into a customer account). View more details here.


currencies

The currencies object is detailed here.


categories

The categories object is detailed here.


social link

The link object has the following attributes in the global.social_links array:

link.name

Returns the name of the social media link, e.g. googleplus.


link.url

Returns the URL of the social media link as entered in the account.


link.title

Returns the title of the social media link, e.g. Google+.


platform message

global.info_message

Returns the platform generated message when a certain action is performed on the website. For example completing the contact form will output the message "Thank you for your enquiry - we will respond to you as soon as possible".


currency

global.currency_id

Returns the ID of the currency currently selected by the website visitor.


global.features.ajax_basket

Returns true if the soft add to basket app is activated.


featured categories and products

featured_categories

Returns an array of categories chosen as featured categories.


featured_products

Returns an array of products chosen as featured products.


random_products

Returns an array of random products. There is a platform limit of 100 products that can be returned.


new_products

Returns an array of new products added to the website. There is a platform limit of 100 products that can be returned.