Emergency

In urgent situations or outages, you can send a text message to our emergency line

Emergency line (text message only)

+45 29 70 15 95

Send a text message with the following information:

  • Your name and webshop
  • A description of the problem

Note: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Template API

Complete reference to all classes and methods available in Shoporama templates

Available classes

In your templates, you have access to objects of the following classes:

SafeBlogPost
Handles blog posts with title, content, and related data
SafeBrand
Represents a brand with image and link information
SafeCampaign
Handles campaigns with discounts and expiry dates
SafeCategory
Represents product categories with a hierarchical structure
SafeCompany
Contains company information such as name, address, and contact details
SafeContentEntry
An entry in a content type (Content → Content types), e.g. a single recipe, with fields, images, and its own URL
SafeContentType
A content type the store owner has created in admin, e.g. Recipes, with fields and entries
SafeCountry
Handles countries with shipping rules and currency
SafeCustomFeed
SafeCustomer
Represents customers with personal information and loyalty points
SafeCustomerCompany
SafeCustomerField
Handles custom customer fields and their values
SafeCustomerGroup
SafeImage
Handles images in different sizes and formats
SafeLandingPage
Represents landing pages with content and SEO data
SafeManufacturer
Handles manufacturers with contact information and images
SafeMenu
Represents menus for navigation in the webshop
SafeMenuItem
Handles individual menu items with links and hierarchy
SafeNewsletterCampaign
SafeNewsletterList
SafeNewsletterSubscriber
SafeOrder
Represents orders with products, prices, and delivery information
SafeOrderBlacklist
SafeOrderLabel
Handles order labels
SafeOrderProduct
Represents products in an order with quantity and prices
SafeOrderReturn
Handles order returns
SafeOrderReturnExchange
SafeOrderReturnProduct
Handles products in a return case
SafeOrderShipment
SafeOrderShipmentProduct
SafePage
Represents static pages with content and SEO data
SafePager
Handles pagination of lists with navigation
SafePaymentGateway
Represents a payment gateway with settings
SafePoint
Handles loyalty points for customers
SafeProduct
Represents products with prices, images, and variants
SafeProductBatch
SafeProductDeposit
SafeProductFile
Handles files attached to products (downloads, manuals)
SafeProductLabel
Handles product labels and badges
SafeProductProfileAttributeValue
Handles values for product attributes
SafeProductReview
Represents customer reviews of products
SafeProfile
Handles product profiles with attributes and properties
SafeProfileAttribute
Represents attributes for product profiles
SafeRecurringOrder
Handles subscription orders and recurring payments
SafeRecurringOrderProduct
Handles products in subscription orders
SafeSafetyProfile
Handles safety profiles for hazardous products
SafeShipping
Represents shipping methods with prices and delivery times
SafeStockLocation
Handles stock locations and stock levels
SafeSupplier
Represents suppliers with contact information and products
SafeVoucher
Handles discount codes and gift cards
SafeWebshop
Represents the webshop with settings and configuration
SafeWishlist
Handles customers' wishlists
SafeWishlistProduct
Handles products on wishlists

SafeBlogPost

Handles blog posts with title, content, and related data

Link
getBlogPostId()
Link
Gets the blog post's ID
getUrl($action = 'view', $controller = null)
Link
Returns the URL of the blog post based on the action
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getRemoteUrl()
Link
Gets the external URL of the blog post
getTitle()
Link
Gets the blog post's title with parsed variables
getName()
Link
Returns the post's name (the title), like the other objects the theme links to
getBody()
Link
Gets the blog post's content with parsed variables
parse($text)
Link
Parses text and replaces variables
@param string $text The text to parse
canEdit()
Link
Checks whether the current blog post can be edited
getImages()
Link
Gets all images attached to the blog post
getMetaValues()
Link
Gets all meta values for the blog post
getMetaValue($key)
Link
Returns a specific meta value
@param string $key The key of the meta value
getHtmlFields()
Link
Gets all HTML fields as an array
getHtmlField($tag)
Link
Returns a specific HTML field
@param string $tag The HTML field's tag
getMetaTitle()
Link
Gets the meta title with parsed variables
getMetaDescription()
Link
Gets the meta description for the blog post
getUserName()
Link
Gets the author name for the blog post
getCreated()
Link
Gets the creation date of the blog post
getUpdated()
Link
Gets the date the blog post was last updated
getPublishAfter()
Link
Gets the publication date of the blog post
getProducts($limit = 50)
Link
Returns products attached to the blog post
@param int $limit Maximum number of products (default: 50)
getOpenGraphTitle()
Link
Gets the Open Graph title for social media
getOpenGraphDescription()
Link
Gets the Open Graph description for social media
getOpenGraphImage()
Link
Gets the Open Graph image for social media
getExtensionValue($name)
Link
Returns the value of an extension data field
@param string $name The name of the extension data field
getCategories()
Link
Gets the categories attached to the blog post
getNoIndex()
Link
Checks whether the blog post is marked as noindex for search engines

SafeBrand

Represents a brand with image and link information

Link
getImage()
Link
Gets the brand's image if it exists
getImageAlt()
Link
Alt text for the brand's logo: the image description, otherwise the brand name
getBrandId()
Link
Gets the brand's ID
getName()
Link
Gets the brand's name
getRemoteUrl()
Link
Gets the URL of the brand's page: the linked category or landing page ("Link to"),
otherwise the brand page (/brands/) when the store has brand pages enabled. Otherwise false.
getLinkToUrl()
Link
Gets the URL of the linked category or landing page ("Link to"), or false
getBrandPageUrl()
Link
Gets the URL of the brand page (/brands/), or false when the store does not have brand pages enabled
getRewriteUrl()
Link
Gets the brand's slug (the part after /brands/)
getDescriptionA()
Link
Gets the brand page's intro, shown above the products (HTML)
getDescriptionB()
Link
Gets the brand page's body text, shown below the products (HTML)
getMetaTitle()
Link
Gets the brand page's SEO title
getMetaDescription()
Link
Gets the brand page's SEO description
getOpenGraphTitle()
Link
Gets the brand page's Open Graph title (for sharing on social media)
getOpenGraphDescription()
Link
Gets the brand page's Open Graph description (for sharing on social media)
getWebsite()
Link
Gets the address of the brand's own website (used as sameAs in structured data)
getNoIndex()
Link
Should the brand page be hidden from search engines (noindex)?
getProductCount()
Link
Number of products from the brand that the customer can see
getBestsellers($limit = 5)
Link
Gets the brand's best-selling products
@param int $limit Number of products (max 50)

SafeCampaign

Handles campaigns with discounts and expiry dates

Link
canUse()
Link
Checks whether the campaign can be used
getName()
Link
Gets the campaign's name
getDescription()
Link
Gets the campaign's description
getPrice()
Link
Gets the campaign's price. In stores with prices incl. VAT and "Adjust prices to reflect the VAT rate
in the destination country", this is the price in the visitor's delivery country, so the theme shows
the same price that the cart charges (#1271).
getPriceModel()
Link
Gets the campaign's pricing model
getPercent()
Link
Gets the campaign's percentage discount
getAppliesTo()
Link
What the campaign applies to: 'regular' (regular purchases), 'subscription' (subscriptions only)
or 'both'.
appliesToSubscriptions()
Link
Does the campaign apply to subscriptions (and does it have a subscription price or percentage)?
getSubscriptionPrice()
Link
Fixed subscription price for getMinProductCount() items, converted like getPrice(). Null when
the campaign has no subscription price.
getSubscriptionUnitPrice()
Link
The unit price on subscription (getSubscriptionPrice() / getMinProductCount()).
getSubscriptionPercent()
Link
Percentage discount on subscription. Null when the campaign has none.
getExpires()
Link
Gets the campaign's expiry date
getMinProductCount()
Link
Number of products that must be in the cart before the campaign is triggered (fixed, cheapest_free, percent).
0 means the campaign is never triggered — see Basket::price().
getBundleThresholdAmount()
Link
Combination discount: optional amount threshold (incl. VAT) that the triggering products must reach.
getThresholdAmount()
Link
Threshold discount: minimum amount (incl. VAT) that the cart must reach to trigger the discount.
getThresholdPercent()
Link
Threshold discount: percentage discount when the threshold is reached.
getThresholdExcludeSale()
Link
Threshold discount: sale products are excluded when the flag is set.
getBundleExcludeSale()
Link
Combination discount: sale products are excluded when the flag is set.
getImage()
Link
Gets the campaign's image if it exists
getCampaignId()
Link
Gets the campaign's ID

SafeCategory

Represents product categories with a hierarchical structure

Link
getObjectType()
Link
Returns the object type for this category
getInMenu()
Link
Returns whether the category should be shown in the menu
getIsOnline()
Link
Returns whether the category is online and visible
getProductCount()
Link
Returns the number of products in the category
getRemoteUrl()
Link
Returns the external URL of the category
getSlugName()
Link
Returns the URL-friendly name (slug) of the category
getImages()
Link
Returns all images attached to the category as SafeImage objects
getCategoryId()
Link
Returns the category ID
getParentId()
Link
Returns the ID of the parent category
isFront()
Link
Returns whether the category is the front page category
getUrl($action = 'view', $controller = null)
Link
Returns the category's URL based on the requested action
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getName()
Link
Returns the category name with text variables parsed
getDescriptionA()
Link
Returns the category's primary description with parsed text variables
getDescriptionB()
Link
Returns the category's secondary description with parsed text variables
getParents($reverse = '')
Link
Returns all parent categories as SafeCategory objects
@param bool $reverse Whether to reverse the order (default: false)
getChildren()
Link
Returns all subcategories as SafeCategory objects
getCategoriesFromLevel($level)
Link
Returns categories from a specific level in the hierarchy
@param int $level The level in the category hierarchy
canEdit()
Link
Returns whether the current user can edit the category
getTree()
Link
Returns the entire category tree with both parents and children
getOnlineProducts($limit = 2500, $offset = 0, $count = null, $sort = null, $sort_order = 'DESC', $filter = null)
Link
Returns online products in the category
@param int $limit Maximum number of products (default: 2500)
@param int $offset Start position (default: 0)
@param int $count Reference to the total count (filled in by the method)
@param string $sort Sorting: default | sold | price | alphabetic | created (optional)
@param string $sort_order Sort order: asc | desc (default: 'DESC')
getBlogPosts($limit = 2500, $offset = 0, $count = null, $sort = null, $sort_order = 'DESC')
Link
Returns blog posts in the category
@param int $limit Maximum number of posts (default: 2500)
@param int $offset Start position (default: 0)
@param int $count Reference to the total count (filled in by the method)
@param string $sort Sorting: updated | created | publish_after (optional)
@param string $sort_order Sort order: asc | desc (default: 'DESC')
getMetaValues()
Link
Returns all meta values for the category
getMetaValue($key)
Link
Returns a specific meta value based on its key
@param string $key The key of the meta value
getMetaTitle()
Link
Returns the SEO meta title with text variables parsed
getMetaDescription()
Link
Returns the SEO meta description with text variables parsed
getHtmlFields()
Link
Returns all HTML fields for the category as an array
getHtmlField($tag)
Link
Returns a specific HTML field based on its tag name
@param string $tag The HTML field's tag
getTag()
Link
Returns the category's tag
getOpenGraphTitle()
Link
Returns the Open Graph title for social media with text variables parsed
getOpenGraphDescription()
Link
Returns the Open Graph description for social media with text variables parsed
getOpenGraphImage()
Link
Returns the Open Graph image for social media as a SafeImage object
getPrimarySearchPhrase()
Link
Returns the primary search phrase for the category
getNoIndex()
Link
Returns whether the category should be excluded from search engine indexing
getPopularProducts($limit = 25, $days = 90, $exclude = null)
Link
Returns the most popular products in the category based on sales
@param int $limit Maximum number of products (default: 25)
@param int $days Number of days to look back (default: 90)
@param array $exclude Array of product IDs to exclude (optional)
getGoogleCategory()
Link
Returns the Google Shopping category
getExtensionValue($name)
Link
Returns a value from the category's extension data
@param string $name The name of the extension data
getBlogPostUrl()
Link
Returns the URL for blog posts in this category

SafeCompany

Contains company information such as name, address, and contact details

Link
getCompanyId()
Link
Returns the company ID
getName()
Link
Returns the company name
getRegNr()
Link
Returns the company's registration number (CVR)
getAddress()
Link
Returns the company's address
getZipcode()
Link
Returns the company's postal code
getCity()
Link
Returns the company's city
getCountry()
Link
Returns the company's country
getEmail()
Link
Returns the company's email address
getPhone()
Link
Returns the company's phone number
getWebshops()
Link
Returns all webshops associated with the company as SafeWebshop objects

SafeContentEntry

An entry in a content type (Content → Content types), e.g. a single recipe, with fields, images, and its own URL

Link
getId()
Link
Returns the entry's ID
getContentEntryId()
Link
Returns the entry's ID (same as getId())
getTitle()
Link
Returns the entry's title
getSlug()
Link
Returns the entry's slug (the last part of the URL), e.g. "rhubarb-trifle"
hasUrl()
Link
Returns true if the entry has its own page in the store (the type has its own URL)
getUrl()
Link
Returns the full address of the entry's page, or null if the type has no URL of its own
getRemoteUrl()
Link
Returns the full address of the entry's page (same as getUrl())
getValue($key)
Link
Returns the value of a field. Images are SafeImage, references are SafeProduct,
SafeCategory, or SafeContentEntry (lists of them for the plural types), yes/no is
true/false, multiple choice is a list of the selected values, video is the video's URL, and
repeating rows are a list of rows (a gallery in a row is a list of SafeImage)
@param string $key The field's key
getExtensionValue($name)
Link
Returns the value of a field (same as getValue())
@param string $name The field's key
getLabel($key)
Link
Returns the field's value as display text: the name of the selected option in a select list,
Yes/No, dates as 24.12.2026, etc. Empty text for images, references, and repeating rows
@param string $key The field's key
getFields($include_empty = '')
Link
Returns all fields with a value as a list of key, title, type, value, and label, for
generic display of all fields in the order they have in the type. Repeating rows also
have sub_fields (key, title, and type for each subfield)
@param bool $include_empty Also include empty fields (default: false)
getListFields()
Link
Returns the fields marked "Show in list" (for cards and lists)
getImages()
Link
Returns the images in the entry's gallery as SafeImage
getImage()
Link
Returns the first image in the entry's gallery, or null
getType()
Link
Returns the entry's content type as SafeContentType
getTypeKey()
Link
Returns the key of the entry's content type, e.g. "recipe"
isOnline()
Link
Returns true if the entry is active (not a draft)
getCreated()
Link
Returns the time the entry was created
getUpdated()
Link
Returns the time the entry was last modified
getMetaTitle()
Link
Returns the SEO title, or the title if none has been set
getMetaDescription()
Link
Returns the SEO description

SafeContentType

A content type the store owner has created in admin, e.g. Recipes, with fields and entries

Link
getId()
Link
Returns the type's ID
getContentTypeId()
Link
Returns the type's ID (same as getId())
getKey()
Link
Returns the type's fixed key, e.g. "recipe". Use the key in the theme, never the name
getName()
Link
Returns the type's plural name, e.g. "Recipes"
getNameSingular()
Link
Returns the type's singular name, e.g. "Recipe"
hasUrl()
Link
Returns true if the entries have their own page in the store
hasImages()
Link
Returns true if the entries have an image gallery
getUrl()
Link
Returns the full address of the type's overview page, or null if the type has no URL of its own
getRemoteUrl()
Link
Returns the full address of the type's overview page (same as getUrl())
getFields()
Link
Returns the type's fields as a list of key, title, type, and description
getEntries($limit = 12, $offset = 0, $sort = 'weight', $sort_order = 'asc')
Link
Returns active entries as SafeContentEntry
@param int $limit At most this many entries (default: 12, max 100)
@param int $offset Skip this many entries (for pagination)
@param string $sort weight (manual sort order), title, newest, oldest, updated, or field:
@param string $sort_order asc or desc (used with field:)
getEntryCount()
Link
Returns the number of active entries

SafeCountry

Handles countries with shipping rules and currency

Link
getCountryId()
Link
Returns the country ID
getName()
Link
Returns the country name
getCode()
Link
Returns the country code (e.g. DK, SE, NO)
getIsDefault()
Link
Returns whether this is the default country for the webshop
getFreeAbove()
Link
Returns the free shipping threshold for this country
getFreeAboveForShipping($shipping_id)
Link
Returns the effective free shipping threshold for a shipping method (per-method override → country)
getVat()
Link
Returns the VAT rate for the country
getPrice()
Link
Returns the shipping price for this country
hasShipping($shipping_id)
Link
Checks whether a specific shipping method is available for this country

SafeCustomFeed

Link
getCustomFeedId()
Link
getName()
Link
getSlug()
Link
getFormat()
Link
getIsOnline()
Link
getFeedKey()
Link
getPublicUrl($with_key = '')
Link
getFullPublicUrl($with_key = '')
Link
getUrl($action = 'edit', $controller = null)
Link
getLastBuilt()
Link
getCreatedAt()
Link
getSourceCount()
Link
getFieldCount()
Link
getExpandVariants()
Link
getXmlRootElement()
Link
getXmlItemElement()
Link
getCsvDelimiter()
Link
getXmlUseCdata()
Link
getCsvIncludeHeader()
Link
getFilter($key)
Link

SafeCustomer

Represents customers with personal information and loyalty points

Link
getActivePoints()
Link
Returns the customer's active points that can be used
getPendingPoints()
Link
Returns the customer's pending points that are not yet active
getSpendPoints()
Link
Returns the customer's used points
getPointsAvailable()
Link
Calculates and returns how many points the customer can use on the current cart
getPoints()
Link
Array of points the customer has earned or used
getHasOneClick()
Link
Returns whether the customer has enabled one-click payment
canUseOneClick()
Link
Checks whether the customer can use one-click payment
getChangeCardUrl()
Link
Returns the URL for changing the payment card
getSubscriptionId()
Link
Returns the customer's subscription ID with the payment gateway
getCustomerId()
Link
Returns the customer ID
getCardInfo()
Link
Returns information about the customer's saved payment card
getCardType()
Link
Returns the card type based on the card information
getName()
Link
Returns the customer's full name
getFirstname()
Link
Returns the customer's first name, extracted from the full name
getEmail()
Link
Returns the customer's email address
getAddress()
Link
Returns the customer's billing address
getZipcode()
Link
Returns the customer's postal code
getCity()
Link
Returns the customer's city
getPhone()
Link
Returns the customer's phone number
getCountryId()
Link
Returns the ID of the customer's country
getShippingName()
Link
Returns the name on the delivery address
getShippingAddress()
Link
Returns the delivery address
getShippingZipcode()
Link
Returns the postal code of the delivery address
getShippingCity()
Link
Returns the city of the delivery address
getShippingCountryId()
Link
Returns the country ID of the delivery address
getVatNumber()
Link
Returns the customer's CVR number
getCompany()
Link
Returns the customer's company name
getCustomerCompanyId()
Link
B2B: the customer's company (SafeCustomerCompany) or false, the customer's role in it, and whether the customer is a company admin.
getCustomerCompanyRole()
Link
isCompanyAdmin()
Link
getCustomerCompany()
Link
getEffectiveVatNumber()
Link
B2B: effective company identity (the company's value if under a company, otherwise the customer's own).
getEffectiveEanNumber()
Link
getEffectiveCompanyName()
Link
getEanNumber()
Link
Returns the customer's EAN number
getTokenUrl($redir = null)
Link
Returns a URL with a login token for automatic login
getCountry()
Link
Returns the customer's country as a SafeCountry object
getShippingCountry()
Link
Returns the delivery country as a SafeCountry object
getSubscriptions()
Link
Returns the customer's subscriptions as SafeRecurringOrder objects
getWishlists()
Link
Returns the customer's wishlists as SafeWishlist objects

SafeCustomerCompany

Link
getCustomerCompanyId()
Link
getName()
Link
getVatNumber()
Link
getEanNumber()
Link
getCustomerGroupId()
Link
getMemberCount()
Link
getMembers()
Link

SafeCustomerField

Handles custom customer fields and their values

Link
getVal()
Link
Returns the field's value for the logged-in customer
getCustomerFieldId()
Link
Returns the customer field's ID
getName()
Link
Returns the field's name
getTag()
Link
Returns the field's tag for use in templates
getType()
Link
Returns the field type (text, checkbox, dropdown, etc.)
getValues()
Link
Returns the possible values for the field (for dropdown and radio)
getLabel($value)
Link
Returns the display text for one of the field's values in the page's language (Countries, #1363). The value
that is sent and saved is always the Danish one from getValues(), so the customer's answer is the same in
every language
@param string $value A value from getValues() or getVal()

SafeCustomerGroup

Link
getCustomerGroupId()
Link
getName()
Link
getDiscountPercent()
Link
getMinOrderValue()
Link

SafeImage

Handles images in different sizes and formats

Link
getSrc($w, $h, $t = 'fit', $format = null, $quality = null)
Link
Returns the URL of a scaled image
@param int $w The width of the image
@param int $h The height of the image
@param string $t Scaling type: box | fit | pad (default: 'fit'). fit scales the whole image down within the dimensions, box fills the dimensions and crops, pad places the whole image centered on a white canvas at exactly the given dimensions (e.g. 1080x1080 for Facebook)
@param string $format Image format: jpg | png | webp (optional)
@param int $quality Image quality: 0-100 (optional)
getInline($width, $height, $type = 'fit', $format = null, $quality = 100)
Link
Returns a base64 inline image
@param int $width The width of the image
@param int $height The height of the image
@param string $type Scaling type: box | fit | pad (default: 'fit')
@param string $format Image format: jpg | png | webp (optional)
@param int $quality Image quality: 0-100 (default: 100)
getHtmlSize($w, $h, $t, $format = 'png', $quality = 100)
Link
Returns the HTML attributes for the image's size so the page loads more smoothly
@param int $w The width of the image
@param int $h The height of the image
@param string $t Scaling type: box | fit | pad
@param string $format Image format (default: 'png')
@param int $quality Image quality: 0-100 (default: 100)
getFilename()
Link
Returns the image's original file name
getDescription()
Link
Returns the image's description
getImageId()
Link
Returns the image's ID
getWidth()
Link
Returns the image's width in pixels
getHeight()
Link
Returns the image's height in pixels
getFocalPoint()
Link
Returns the image's focal point as a CSS object-position ("42% 31%"), or
an empty string if none is set. Used by themes that crop the image themselves with
object-fit. If the theme crops via getSrc(..., 'box'), the server has already taken
the focal point into account, and nothing needs to be done.
getFocalX()
Link
Returns the focal point's horizontal position as a number between 0 and 1, or null
getFocalY()
Link
Returns the focal point's vertical position as a number between 0 and 1, or null
getVariantAttributeValueId()
Link
Returns the ID of the variant the image is linked to, if any
getVariantName()
Link
Returns the name of the variant the image is linked to, if any
getVariantTag()
Link
Returns the tag of the variant the image is linked to, if any

SafeLandingPage

Represents landing pages with content and SEO data

Link
getObjectType()
Link
Returns the object type for this landing page
getCachedProductIds()
Link
Returns the cached product IDs for the landing page
getActivateRss()
Link
Returns whether the RSS feed is enabled for the landing page
getRemoteUrl()
Link
Returns the external URL for the landing page
getImages()
Link
Returns all images linked to the landing page as SafeImage objects
getLandingPageId()
Link
Returns the landing page's ID
getUrl($action = 'view', $controller = null)
Link
Returns the URL of the landing page based on the action
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getName()
Link
Returns the landing page's name with text variables parsed
canEdit()
Link
Returns whether the current user can edit the landing page
getDescription()
Link
Returns the landing page's description with text variables parsed
getDescriptionA()
Link
Returns the landing page's primary description with text variables parsed
getDescriptionB()
Link
Returns the landing page's secondary description with text variables parsed
getMetaTitle()
Link
Returns the SEO meta title with text variables parsed
getMetaDescription()
Link
Returns the SEO meta description with text variables parsed
getProducts($limit = 25000, $offset = 0, $count = null)
Link
Returns the products on the landing page
@param int $limit Maximum number of products (default: 25000)
@param int $offset Start position (default: 0)
@param int $count Reference to the total count (filled in by the method)
getProductCount()
Link
Returns the number of products on the landing page
getMetaValues()
Link
Returns all meta values for the landing page
getMetaValue($key)
Link
Returns a specific meta value
@param string $key The key of the meta value
getHtmlFields()
Link
Returns all HTML fields for the landing page as an array
getHtmlField($tag)
Link
Returns a specific HTML field
@param string $tag The HTML field's tag
getOpenGraphTitle()
Link
Returns the Open Graph title for social media with text variables parsed
getOpenGraphDescription()
Link
Returns the Open Graph description for social media with text variables parsed
getOpenGraphImage()
Link
Returns the Open Graph image for social media as a SafeImage object
getPrimarySearchPhrase()
Link
Returns the primary search phrase for the landing page
getNoIndex()
Link
Returns whether the landing page should be excluded from search engine indexing
getRules()
Link
Returns the rules that define which products are shown on the landing page
getExtensionValue($name)
Link
Returns the value of an extension data field
@param string $name The name of the extension data field

SafeManufacturer

Handles manufacturers with contact information and images

Link
getManufacturerId()
Link
Returns the manufacturer's ID
getName()
Link
Returns the manufacturer's name
getAddress()
Link
Returns the manufacturer's address
getEmail()
Link
Returns the manufacturer's email address
getWebsite()
Link
Returns the manufacturer's website
bool
getIsOutsideEu()
Link
Returns whether the manufacturer is located outside the EU
getEuName()
Link
Returns the name of the EU representative
getEuAddress()
Link
Returns the address of the EU representative
getEuEmail()
Link
Returns the email address of the EU representative
getEuWebsite()
Link
Returns the website of the EU representative

SafeMenu

Represents menus for navigation in the webshop

Link
getTag()
Link
Returns the menu's tag for use in templates
getName()
Link
Returns the menu's name (in a country with a different language, the country's translation)
getMenuId()
Link
Returns the menu's ID
getItems()
Link
Returns all menu items in the menu as SafeMenuItem objects
getChildren()
Link
Returns all submenus as SafeMenu objects

SafeMenuItem

Handles individual menu items with links and hierarchy

Link
getMenuItemId()
Link
Returns the menu item's ID
getUrl($action = 'view', $controller = null)
Link
Returns the URL for the menu item
getVal()
Link
Returns the value/ID of the linked object
getType()
Link
Returns the type of menu item (product, category, page, content_entry, content_type, etc.)
getTitel()
Link
getTitle()
Link
getClass()
Link
Returns the CSS class for the menu item
getObject()
Link
Returns the linked object as a Safe object based on the type
getItems()
Link
Returns submenu items if this is a menu item of the menu type

SafeNewsletterCampaign

Link
getId()
Link
* Returns the newsletter's ID
getTitle()
Link
* Returns the display title (the subject line, falling back to the internal name)
getPreheader()
Link
* Returns the preheader text (short intro/subtitle), or an empty string
getExcerpt($length = 160)
Link
* Returns a short plain-text teaser, e.g. for archive cards (no HTML, cheap)
getDate()
Link
* Returns the publication date (sent, otherwise created) as Y-m-d H:i:s.
* Use the theme's |date_format modifier for formatting.
getUrl()
Link
* Returns the relative, shareable URL of the newsletter (/nyhedsbrev/)
getSlug()
Link
* Returns the newsletter's slug (rewrite_url)
getContent()
Link
* Returns the full HTML body for displaying the entire newsletter inline.
* NOTE: heavy, as it renders all blocks. Use ONLY to display a single newsletter,
* never in a loop over many (use getTitle/getExcerpt/getDate/getImage for cards).
getImage()
Link
* Returns the URL of a representative image (the first image in the newsletter),
* or false if there is no image
isPublic()
Link
* Returns whether the newsletter is publicly visible

SafeNewsletterList

Link
getId()
Link
* Returns the list ID
getName()
Link
* Returns the list name
getDescription()
Link
* Returns the list description
isDefault()
Link
* Returns whether the list is the default
getSubscriberCount()
Link
* Returns the number of active subscribers

SafeNewsletterSubscriber

Link
getId()
Link
* Returns the subscriber ID
getEmail()
Link
* Returns the email
getFirstname()
Link
* Returns the first name
getLastname()
Link
* Returns the last name
getFullName()
Link
* Returns the full name
getStatus()
Link
* Returns the status (active, unsubscribed, bounced)
getCreated()
Link
* Returns the creation date
getSource()
Link
* Returns the source (signup_form, import, purchase)
getLists()
Link
* Returns the lists as SafeNewsletterList objects

SafeOrder

Represents orders with products, prices, and delivery information

Link
getCurrency()
Link
The currency of the order's amounts (e.g. "SEK" for an order placed in a country with its own currency,
Countries #1363), otherwise the store's
getShipping()
Link
Returns the shipping method as a SafeShipping object, or null if the order has no shipping
getShippingName()
Link
Returns the name of the shipping method
getComments()
Link
Returns the customer's comments on the order
getIsCreditNote()
Link
Returns whether the order is a credit note
getOriginalWebshopOrderId()
Link
Returns the webshop order ID of the original order if this is a credit note
getPaid()
Link
Returns the payment status of the order
getOrderId()
Link
Returns the order's ID
getInvoiceId()
Link
Returns the invoice ID for the order
getMarginInvoiceId()
Link
The invoice number of the margin scheme invoice when the order contains both used and other products and
therefore has two invoices (HD #6141). Otherwise empty.
getTime()
Link
Returns the time the order was created
getEmail()
Link
Returns the customer's email address
getPhone()
Link
Returns the customer's phone number
getSetting($n)
Link
Returns a specific setting for the order
@param string $n The name of the setting
getWebshopOrderId()
Link
Returns the webshop's order number. For an order imported from the store's previous webshop,
this is the order number from there (see isHistorical())
isHistorical()
Link
Returns true if the order was imported from the store's previous webshop. Such an order
is shown in the customer's order history, but cannot be returned, canceled, or reordered
getTrackingNumber()
Link
Returns the track & trace number
getTrackingNumbers($as_string = '')
Link
Returns all track & trace numbers for the order
@param bool $as_string Whether to return the numbers as a single combined string (default: false)
getTrackingUrl()
Link
Returns the track & trace URL
getShipments()
Link
Returns the order's partial shipments as SafeOrderShipment objects, oldest first.
An empty list means the order ships in one package, so use getTrackingNumbers() as before.
Used when an order ships in several packages, so the theme can show which products are in
which package and with which tracking number.
hasShipments()
Link
Returns true if the order ships in several packages
getPublicUrl($action = 'order')
Link
Returns the public URL of the order
@param string $action The action to perform (default: 'order')
hasReviews()
Link
Returns whether the order has product reviews
getUrl($action = 'view', $controller = null)
Link
Returns the URL of the order based on the requested action
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getCreditUntil()
Link
Returns the credit expiry date
getProductVouchers()
Link
Returns product gift cards generated by this order as SafeVoucher objects
getStatus()
Link
Returns the order's status
getOrderPrice()
Link
= getPrice() - getShippingPrice()
getPrice()
Link
The order's price excluding shipping, incl. VAT
getTotalPrice()
Link
Total incl. everything
getTotalPriceExVat()
Link
getTotalPrice() - getVat()
getPrepaidAmount()
Link
Prepaid amount (the return value offset in an instant exchange, #5481). 0 for normal orders.
getAmountToCharge()
Link
The amount the customer actually has to pay = getTotalPrice() - getPrepaidAmount().
getShippingPrice()
Link
getShippingPriceExVat()
Link
Shipping excl. VAT. The shipping VAT is only deducted on orders that actually have VAT, as in
Order::getAmountExVatAndShipping() (export and reverse charge have no VAT).
getGoodsAmountExVat()
Link
The products' amount excl. VAT, shipping, and deposit, in the order's currency (see getCurrency()). Discount code,
campaign discount, points, and gift card have been deducted. The basis for commission to
affiliate networks (e.g. Make Influence). Deposit is not included, the amount is never below 0,
and with partial payment, the remaining balance is included in the booking (see Order::getGoodsAmountExVat()).
The remainder order (getIsDownPaymentRemainder()) is therefore not a new sale.
toMain($amount)
Link
Converts an amount from the order's currency to the store's currency (Countries, #1363). Unchanged for
orders in the store's own currency.
@param float $amount The amount in the order's currency
getMainCurrency()
Link
The store's own currency (e.g. "DKK"), even when the order was placed in a country with its own currency.
Goes with amounts from toMain(). Within a country, $webshop->getCurrency() returns that country's currency.
getVat()
Link
getVatSpecification()
Link
Base amount and VAT per rate for an order with products at different VAT rates (e.g. a product with
its own 0% rate), with shipping and discounts distributed across the rates:
[['rate' => 25.0, 'net' => 196.44, 'vat' => 24.56], ['rate' => 0.0, ...]]. Empty for orders with
a single rate, so themes only show the breakdown when it matters.
hasMarginScheme()
Link
Whether the order has products sold under the margin scheme (second-hand VAT). If so, the invoice must carry
the note from getMarginSchemeNote(), and no VAT amount may be shown for those products: mark them
with $order_product->isMarginScheme(), and hide the VAT line when the order's VAT is 0.

@return bool
hasOnlyMarginScheme()
Link
Whether all of the order's products are sold under the margin scheme. Hide the VAT line when that is the case and
the VAT is 0, and do not show "reverse charge" (it does not apply to second-hand goods).

@return bool
getMarginSchemeNote()
Link
The note for the invoice when the order has margin scheme products (otherwise empty), e.g.
"Margin scheme – second-hand goods. The buyer cannot deduct the VAT."

@return string
getIsPaid()
Link
Returns whether the order is paid
getPaymentUrl()
Link
Returns the URL of the payment page
getReviewUrl()
Link
Returns the URL of the review page
getReturnUrl()
Link
Returns the URL of the return page. Null for an order imported from the store's previous webshop
(isHistorical()), so <{if $order->getReturnUrl()}> hides the link
hasExchange()
Link
Returns whether the order is part of an exchange chain: either an exchange has been created on the order,
or the order is itself an exchange order. Use it to show a message instead of
the exchange button on the return page:
<{if $order->hasExchange()}>You have already created an exchange<{/if}>
isExchangeOrder()
Link
Returns whether the order ITSELF is an exchange order (created when an earlier exchange was approved).
Check it BEFORE hasExchange(), since both are true on an exchange order, so the customer gets the right
explanation of why it cannot be exchanged again:
<{if $order->isExchangeOrder()}>This order is already an exchange<{/if}>
getWithdrawalUrl()
Link
Returns the URL of the digital withdrawal function (the customer's withdrawal page).
isWithinWithdrawalPeriod()
Link
Is the order still within the withdrawal period, so a "Cancel purchase" link should be shown?
getWithdrawalDays()
Link
Number of days of right of withdrawal for the digital withdrawal (at least 14, longer if the store
has set the theme setting checkout.withdrawal_days). Used for the text on the withdrawal page:
<{if $order->getWithdrawalDays() > 14}>You have a <{$order->getWithdrawalDays()}>-day right of withdrawal<{/if}>
hasDownloadedDigitalContent()
Link
Does the order have digital content where the download has already started? Used to inform
the customer that the right of withdrawal for those products may have lapsed.
getWithdrawalExemptProducts()
Link
Returns order lines marked as exempt from the right of withdrawal (issue #596).
Each element is an array with 'name' (product name), 'amount', 'reason' (legal ground)
and 'text' (translated explanation for the customer). Empty array if no products are exempt.
hasWithdrawalExemptProducts()
Link
Does the order have at least one product that is exempt from the right of withdrawal?
getEanNumber()
Link
Returns the EAN number for the order
getPaymentPrice()
Link
Returns the payment price in minor units (cents)
getOrderName()
Link
Returns the billing name
getOrderFirstName()
Link
Returns the first name from the billing address
getOrderCompanyName()
Link
Returns the company name from the billing address
getOrderAddress()
Link
Returns the billing address
getOrderAddress2()
Link
Returns billing address line 2
getOrderZipcode()
Link
Returns the postal code of the billing address
getOrderCity()
Link
Returns the city of the billing address
getOrderCountry()
Link
Returns the country of the billing address
getDelName()
Link
Returns the delivery name
getDelCompanyName()
Link
Returns the company name for the delivery address
getDelAddress()
Link
Returns the delivery address
getDelAddress2()
Link
Returns delivery address line 2
getDelCity()
Link
Returns the city of the delivery address
getDelZipcode()
Link
Returns the postal code of the delivery address
getDelCountry()
Link
Returns the country of the delivery address
getPickupAddress()
Link
Returns the pickup address if the order is to be picked up
getShopId()
Link
Returns the parcel shop ID
getBasketId()
Link
Returns the ID of the cart the order was created from
getVatNumber()
Link
Returns the CVR number for the order
getOrderProducts()
Link
Returns all order products as SafeOrderProduct objects.
Deposit lines (#645) are filtered out — they have no product (product_id = 0) and would make
older themes' line loops fail on getProduct()/getImage() calls. Themes instead show
the deposit via getDepositLines()/getDepositTotal(), and the totals (getPrice/
getTotalPrice) always include the deposit amount.
getReviewProducts()
Link
Returns the order's products for the review page (product_review.html) as SafeOrderProduct
objects, one per product. A review applies to the product, and the fields are named rating[product id],
description[product id] and review_images[product id][]. If the same product is on several lines (e.g. in
two colors), the last line's empty fields would otherwise overwrite the customer's stars and text.
getDepositLines()
Link
Deposit (#645): Returns the order's deposit lines as SafeOrderProduct objects.
Negative quantities on credit notes.
getDepositTotal()
Link
Deposit (#645): The order's total deposit amount (gross, incl. VAT). Negative on credit notes.
getProducts()
Link
Returns all products in the order as SafeProduct objects
getOrderProductCount()
Link
Returns the number of products in the order
getExtras($field = null)
Link
Returns extra fields for the order
@param string $field Specific field to fetch (optional, returns all if not specified)
getDisplayExtras()
Link
The extra fields prepared for display: a list of rows with key, label, value,
and demoted. Known theme keys get a Danish field name, and the old customer_type
is marked demoted so a document can leave it out.

getExtras() above is still raw data and must stay that way — the themes'
own printed_invoice.html passes the value on unchanged.
getVoucher()
Link
Returns the gift card used on the order as a SafeVoucher object
getVoucherDiscount()
Link
Returns the discount amount from the gift card
getVoucherDiscountAmount()
Link
Returns the actual discount amount from the gift card
getVoucherCode()
Link
Returns the code used on the order (empty if none). It can be a gift card, in which case
the code is a means of payment with a balance: getVoucher()->getSaveChange() is true for gift cards
setTrackingCalled($i = 1)
Link
Marks that tracking has been called for the order
@param int $i The value to set (default: 1)
getTrackingCalled()
Link
Returns whether tracking has been called for the order
getPaymentGateway()
Link
Returns the payment gateway used for the order
getPaymentGatewayId()
Link
Returns the ID of the payment gateway used
getCardType()
Link
Returns the card type used for payment
getTransactionId()
Link
Returns the transaction ID from the payment gateway
getShippingWeight()
Link
Returns the total shipping weight for the order
getTtStatus()
Link
Returns the Trustpilot status for the order
getTtData()
Link
Returns Trustpilot data as an array
getUtmSource()
Link
Returns the UTM source tracking parameter
getUtmMedium()
Link
Returns the UTM medium tracking parameter
getUtmCampaign()
Link
Returns the UTM campaign tracking parameter
getUtmTerm()
Link
Returns the UTM term tracking parameter
getUtmContent()
Link
Returns the UTM content tracking parameter
getAlsoBought()
Link
Returns products that other customers have also bought
getOrderLabels()
Link
Returns labels attached to the order as SafeOrderLabel objects
getCampaigns()
Link
Returns campaigns used on the order as SafeCampaign objects
int
getDelCountryId()
Link
Returns the country ID of the delivery address
getCustomer()
Link
Returns the customer as a SafeCustomer object if the order is linked to a customer
getCampaign()
Link
Use getCampaigns() instead of this
getCampaignDiscount()
Link
Returns the discount amount from campaigns
getPointsUsed()
Link
Returns the number of points used on the order.

NOTE: the number is NEGATIVE and is summed from customer_point, which also contains the
points a credit note/return has given back — that inflates the number after a return.
If you need the discount as an amount of money, use getPointDiscount() instead.
getPointDiscount()
Link
Returns the point discount in currency: a POSITIVE amount incl. VAT, 0 if no points
were used. Reads the order's own 'use_points' and only falls back to
customer_point, so it is also correct on orders where the point rows are missing.
Needs a minus in front of it in the template — the amount is positive.
getPointsEarned()
Link
Returns the number of points earned with the order
getGlsReturnQr()
Link
Returns the path to the GLS return QR code image, or null
hasTickets()
Link
Tickets: does the order have tickets?
getTicketUrl()
Link
Tickets: link to the customer's ticket page with all of the order's tickets (QR codes, PDF, calendar, and
edit attendees), or null when the order has no tickets. The link is signed and can be passed on.
Also null on /order and the thank-you page when the visitor did not buy the order themselves (those pages can be opened
with the order number and email). Use hasTickets() to say that the tickets have been sent by email.
getGiftCardUrl()
Link
Gift Card (HD #6165): link to the gift card page, where the customer enters the recipient's name and a message and downloads
the gift card as a PDF, or "null" when the order does not include a gift card or the store does not have a
gift card design. Also "null" on the /order and thank-you pages when the visitor did not place the order themselves.
getTickets()
Link
Tickets: the order's valid tickets as a list of arrays with product, date, label, info, location,
holder, type, code, url, and qr_url (the QR code as a PNG, for emails). code and url are null when
the product does not send QR tickets (e.g. trips).
getDownPayment()
Link
Partial payment: the payment plan as an array with label (e.g. "Deposit"), status (scheduled, sent, paid,
overdue, cancelled ...), deposit_formatted, remainder_formatted, send_date, due_date, is_remainder
(this order is the remainder order) and payment_url (link to pay the remaining balance when the remainder order exists
and is not paid), or null when the order was not paid with a deposit.
getIsDownPaymentRemainder()
Link
Partial payment: is the order the remainder order for an order paid with a deposit?
getRemainderLines()
Link
Partial payment: the remainder order's lines (they are not included in getOrderProducts() because they have no product).
List of arrays with name, amount, unit_price, and total.

SafeOrderBlacklist

Link
getOrderBlacklistId()
Link
getType()
Link
getBlacklistValue()
Link
getNote()
Link
getCreated()
Link
getBlockCount()
Link
getUrl($action = 'edit')
Link

SafeOrderLabel

Handles order labels

Link
getOrderLabelId()
Link
Returns the order label's ID
getName()
Link
Returns the name of the order label

SafeOrderProduct

Represents products in an order with quantity and prices

Link
getAmount()
Link
Returns the quantity of the product in the order
getProduct()
Link
Returns the product as a SafeProduct object
getRemoteUrl()
Link
Returns the product's URL in the webshop, or an empty string if the product has been deleted.

Already exists on SafeProduct. Without this one, an email template that
iterates over order lines (rather than $order->getProducts(), which returns SafeProduct)
would get null and an empty link — e.g. when a partial shipment shows the products in its own package.
getProductId()
Link
Returns the product ID
getOrderProductId()
Link
Returns the order product ID
getUnitPrice($amount = 1)
Link
Returns the unit price incl. VAT
@param int $amount Number of units (default: 1)
getUnitVat($amount = 1)
Link
Returns the VAT per unit
@param int $amount Number of units (default: 1)
getCalculatedUnitPrice($amount = 1)
Link
Returns the calculated unit price incl. VAT
@param int $amount Number of units (default: 1)
getCalculatedUnitVat($amount = 1)
Link
Returns the calculated VAT per unit
@param int $amount Number of units (default: 1)
getPrice($amount = 1)
Link
Returns the total price incl. VAT
@param int $amount Number of units (default: 1)
getPriceExVat($amount = 1)
Link
Returns the total price excl. VAT
@param int $amount Number of units (default: 1)
getRealPrice($amount = 1)
Link
Returns the actual price incl. VAT
@param int $amount Number of units (default: 1)
getName()
Link
Returns the product name
getComment()
Link
Returns the comment on the order product
getRental()
Link
The rental period on the line as an array with from and to (Y-m-d) and days (calendar days including
both dates), or null if the line is not a rental.
Example: <{if $rental = $op->getRental()}><{$rental.from|date_format:"%d.%m.%Y"}> - <{$rental.to|date_format:"%d.%m.%Y"}> (<{$rental.days}> days)<{/if}>
getTicket()
Link
Tickets on the line: array with date (e.g. "Fri 18.01.2027 at 19:00–22:00"), starts_at, label,
info, location, and tickets (list with holder, type, code, and url), or null when the line is not
a ticket line. Canceled tickets are not included.
getDownPayment()
Link
Partial payment: the line's deposit as an array with deposit, remainder, and full (per unit), or null.
getFromBundle()
Link
Returns whether the product is part of a bundle
getBundleProductId()
Link
Returns the bundle_product_id for this order product (parent bundle's product_id)
getOwnId()
Link
Returns the product's own ID (SKU)
getProductDepositId()
Link
Deposit (#645): Is the line a deposit line? Returns the deposit type's ID or 0.
getVatRate()
Link
The VAT rate derived from the line's own amounts (whole percentages, e.g. 25). Used as a
fallback when the product object is missing (deposit lines, hard-deleted products).
isMarginScheme()
Link
Whether the line is sold under the margin scheme (second-hand VAT). If so, no VAT amount may be shown
for the line, and the themes mark it and show the note from $order->getMarginSchemeNote().

@return bool
getAttributes()
Link
Returns the product's attributes as an array.
Additive keys (attribute_id, input_mode, data_type, is_variant) so templates
can tell customer input rows from variant rows; sort order = variants first.
is_variant/input_mode/data_type are NULL if the attribute has been deleted.

COALESCE(is_variant, 1) in the sorting: NULL (deleted attribute) is sorted LAST by
a plain DESC, and then $attributes[0] would become a customer input row on old
order lines whose variant attribute has been deleted. Same sorting as
OrderProductAttribute::getList(), so all readers agree on what "first" means.

The types match OrderProductAttribute::getList(): int on the id columns, and NULL
is kept on is_variant for deleted attributes (so "unknown" can be told apart from
"confirmed non-variant"). Without the cast, the values are raw mysqli strings, and the
"=== 0" checks found around the codebase become silent no-ops.
getImages()
Link
Returns all images for the product as SafeImage objects
getImage()
Link
Returns the primary image for the product as a SafeImage object
getFile()
Link
Returns the downloadable file attached to the product
getFileDownloadUrl()
Link
Returns the download URL for the product's file
int
getReturned()
Link
Returns the number of returned units of this product
getBatches()
Link
Returns batch allocations for this order product
@return array Array of OrderProductBatch objects

SafeOrderReturn

Handles order returns

Link
getReturnProductCount()
Link
Returns the number of returned products
getStatus()
Link
Returns the status of the return
getPublicUrl()
Link
Returns the public URL of the return
getOrderReturnId()
Link
Returns the return ID
getTime()
Link
Returns the time of the return
getPrice()
Link
Returns the total price of the return
getVat()
Link
Returns the total VAT amount of the return
getReturnPrice()
Link
Returns the return price
getReturnVat()
Link
Returns the VAT amount of the return
getShippingPrice()
Link
Returns the shipping price of the return
getShippingVat()
Link
Returns the VAT amount on the shipping for the return
isFullReturn()
Link
Returns whether this is a full return (all products returned)
getShipping()
Link
Returns the shipping method as a SafeShipping object
getOrder()
Link
Returns the associated order as a SafeOrder object
getReturnProducts()
Link
Returns all returned products as SafeOrderReturnProduct objects
getDepositRefunds()
Link
Deposit (#645): Returns the return's deposit refund lines as SafeOrderReturnProduct
objects (name via getDisplayName(), quantity via getDepositUnits()).
getExchange()
Link
Is the return an exchange?
getRefundSurplus()
Link
Does the customer want any remaining balance refunded to their card rather than as store credit?
getExchangeTotal()
Link
Total value of the requested exchange products
getExchangeReturnValue()
Link
The return value offset in an exchange (the returned products, excluding shipping)
getExchangeDifference()
Link
Price difference in an exchange (positive = the customer pays, negative = the customer is refunded)
getOrderReturnExchanges()
Link
The requested exchange products as SafeOrderReturnExchange objects

SafeOrderReturnExchange

Link
getAmount()
Link
Returns the requested quantity of the exchange product
getUnitPrice()
Link
Returns the unit price of the exchange product (snapshot from the time of the request)
getUnitVat()
Link
Returns the VAT amount per unit for the exchange product
getProduct()
Link
Returns the exchange product as a SafeProduct object
getAttributes()
Link
Returns the attributes of the selected variant
getAttributeLabels()
Link
Readable labels for the selected variant, e.g. ["Size: M"]

SafeOrderReturnProduct

Handles products in a return case

Link
getUnitPrice()
Link
Returns the unit price of the returned product
bool
isDeposit()
Link
Deposit (#645): Is the line a deposit refund line?
int
getDepositUnits()
Link
Number of refunded deposit units (deposit lines only)
getDisplayName()
Link
Display name: the product's name — or the deposit type's name for deposit refund lines
getUnitVat()
Link
Returns the VAT amount per unit for the returned product
getReason()
Link
Returns the reason for the return
getProduct()
Link
Returns the product as a SafeProduct object
getAttributes()
Link
Returns the product's attributes

SafeOrderShipment

Link
getOrderShipmentId()
Link
Returns the shipment ID
getStatus()
Link
Returns the shipment status: new, sent, or cancelled
getPartNumber()
Link
Returns which package in the sequence this is. The first package is 1
getPartCount()
Link
Returns the total number of packages for the order, so the theme can write "package 1 of 2"
isPartial()
Link
Returns true if the package contains only PART of the order.
Use this rather than getPartCount() > 1 in emails: when the first package is sent,
the later packages do not exist yet, so the counter would say "1 of 1"
isFinal()
Link
Returns true if the entire order has now shipped, now that this package is out.
Used to write "the last part of your order has shipped"
getTrackingNumber()
Link
Returns the shipment's tracking number, or an empty string if there is none
getTrackingUrl()
Link
Returns the tracking URL for this specific package, or an empty string if
the shipping method has no tracking URL, or the package has no tracking number
getSentAt()
Link
Returns the time the package was shipped, or null if it has not been sent
getTime()
Link
Returns the time the shipment was created
getOrderShipmentProducts()
Link
Returns the product lines in this specific package as SafeOrderShipmentProduct objects
getProducts()
Link
Alias for getOrderShipmentProducts(), so templates can write
products=$shipment->getProducts() for the shared product line partial
getOrder()
Link
Returns the order the package belongs to

SafeOrderShipmentProduct

Link
getAmount()
Link
Returns the quantity of the product in THIS package — not the total quantity ordered
getOrderShipmentProductId()
Link
Returns the ID of the product line in the shipment
getProduct()
Link
Returns the product as a SafeProduct object
getRemoteUrl()
Link
Returns the product's URL in the webshop, or an empty string if the product has been deleted.

Already exists on SafeProduct. Without this one, an email template that
iterates over order lines (rather than $order->getProducts(), which returns SafeProduct)
would get null and an empty link — e.g. when a partial shipment shows the products in its own package.
getProductId()
Link
Returns the product ID
getOrderProductId()
Link
Returns the order product ID
getUnitPrice($amount = 1)
Link
Returns the unit price incl. VAT
@param int $amount Number of units (default: 1)
getUnitVat($amount = 1)
Link
Returns the VAT per unit
@param int $amount Number of units (default: 1)
getCalculatedUnitPrice($amount = 1)
Link
Returns the calculated unit price incl. VAT
@param int $amount Number of units (default: 1)
getCalculatedUnitVat($amount = 1)
Link
Returns the calculated VAT per unit
@param int $amount Number of units (default: 1)
getPrice($amount = 1)
Link
Returns the total price incl. VAT
@param int $amount Number of units (default: 1)
getPriceExVat($amount = 1)
Link
Returns the total price excl. VAT
@param int $amount Number of units (default: 1)
getRealPrice($amount = 1)
Link
Returns the actual price incl. VAT
@param int $amount Number of units (default: 1)
getName()
Link
Returns the product name
getComment()
Link
Returns the comment on the order product
getRental()
Link
The rental period on the line as an array with from and to (Y-m-d) and days (calendar days including
both dates), or null if the line is not a rental.
Example: <{if $rental = $op->getRental()}><{$rental.from|date_format:"%d.%m.%Y"}> - <{$rental.to|date_format:"%d.%m.%Y"}> (<{$rental.days}> days)<{/if}>
getTicket()
Link
Tickets on the line: array with date (e.g. "Fri 18.01.2027 at 19:00–22:00"), starts_at, label,
info, location, and tickets (list with holder, type, code, and url), or null when the line is not
a ticket line. Canceled tickets are not included.
getDownPayment()
Link
Partial payment: the line's deposit as an array with deposit, remainder, and full (per unit), or null.
getFromBundle()
Link
Returns whether the product is part of a bundle
getBundleProductId()
Link
Returns the bundle_product_id for this order product (parent bundle's product_id)
getOwnId()
Link
Returns the product's own ID (SKU)
getProductDepositId()
Link
Deposit (#645): Is the line a deposit line? Returns the deposit type's ID or 0.
getVatRate()
Link
The VAT rate derived from the line's own amounts (whole percentages, e.g. 25). Used as a
fallback when the product object is missing (deposit lines, hard-deleted products).
isMarginScheme()
Link
Whether the line is sold under the margin scheme (second-hand VAT). If so, no VAT amount may be shown
for the line, and the themes mark it and show the note from $order->getMarginSchemeNote().

@return bool
getAttributes()
Link
Returns the product's attributes as an array.
Additive keys (attribute_id, input_mode, data_type, is_variant) so templates
can tell customer input rows from variant rows; sort order = variants first.
is_variant/input_mode/data_type are NULL if the attribute has been deleted.

COALESCE(is_variant, 1) in the sorting: NULL (deleted attribute) is sorted LAST by
a plain DESC, and then $attributes[0] would become a customer input row on old
order lines whose variant attribute has been deleted. Same sorting as
OrderProductAttribute::getList(), so all readers agree on what "first" means.

The types match OrderProductAttribute::getList(): int on the id columns, and NULL
is kept on is_variant for deleted attributes (so "unknown" can be told apart from
"confirmed non-variant"). Without the cast, the values are raw mysqli strings, and the
"=== 0" checks found around the codebase become silent no-ops.
getImages()
Link
Returns all images for the product as SafeImage objects
getImage()
Link
Returns the primary image for the product as a SafeImage object
getFile()
Link
Returns the downloadable file attached to the product
getFileDownloadUrl()
Link
Returns the download URL for the product's file
int
getReturned()
Link
Returns the number of returned units of this product
getBatches()
Link
Returns batch allocations for this order product
@return array Array of OrderProductBatch objects

SafePage

Represents static pages with content and SEO data

Link
getPageId()
Link
Returns the page ID
getUrl($action = 'view', $controller = null)
Link
Returns the URL of the page based on the action
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getRemoteUrl()
Link
Returns the external URL of the page
getHeadline()
Link
Returns the page heading with parsed text variables
getName()
Link
Returns the page name (the heading), as on the other objects the theme links to
getIsFront()
Link
Returns whether the page is the front page
getText()
Link
Returns the page text with parsed text variables
parse($text)
Link
Parses text and replaces variables
@param string $text The text to parse
canEdit()
Link
Returns whether the current user can edit the page
getImages()
Link
Returns all images attached to the page as SafeImage objects
getMetaValues()
Link
Returns all meta values for the page
getMetaValue($key)
Link
Returns a specific meta value
@param string $key The key of the meta value
getHtmlFields()
Link
Returns all HTML fields for the page as an array
getHtmlField($tag)
Link
Returns a specific HTML field
@param string $tag The HTML field's tag
getOpenGraphTitle()
Link
Returns the Open Graph title for social media
getOpenGraphDescription()
Link
Returns the Open Graph description for social media
getMetaTitle()
Link
Returns the SEO meta title with text variables parsed
getMetaDescription()
Link
Returns the SEO meta description with text variables parsed
getOpenGraphImage()
Link
Returns the Open Graph image for social media as a SafeImage object
getPrimarySearchPhrase()
Link
Returns the primary search phrase for the page
getNoIndex()
Link
Returns whether the page should be excluded from search engine indexing
getExtensionValue($name)
Link
Returns the value of an extension data field
@param string $name The name of the extension data field

SafePager

Handles pagination of lists with navigation

Link
render()
Link
Renders the pagination as HTML

SafePaymentGateway

Represents a payment gateway with settings

Link
getPaymentGatewayId()
Link
Returns the payment gateway ID
getName()
Link
Returns the name of the payment gateway
getType()
Link
Returns the type of payment gateway
getSecret()
Link
Returns the secret key for the payment gateway
getImage()
Link
Returns the payment gateway logo as a SafeImage object
getHtmlFields()
Link
Returns all HTML fields for the payment gateway as an array
getHtmlField($tag)
Link
Returns a specific HTML field based on the tag name
hasInvoiceAddressSelection()
Link
Returns whether the payment gateway allows choosing a billing address
getEasyCheckoutUrl()
Link
Returns the Easy Payment checkout URL based on the test mode setting

SafePoint

Handles loyalty points for customers

Link
getTime()
Link
Returns the time of the points transaction
getStatus()
Link
Returns the status of the points (active, pending, used)
getPendingUntil()
Link
Returns when pending points become active
getPoints()
Link
Returns the number of points
getExpires()
Link
Returns the expiry date of the points
getOrder()
Link
Returns the associated order as a SafeOrder object

SafeProduct

Represents products with prices, images, and variants

Link
getVariant()
Link
Returns the variant attribute if the product has variants
getProductId()
Link
Returns the product ID
getTrackingId($attribute_id = null, $attribute_value_id = null)
Link
Returns the product's tracking ID (matches the Google feed's g:id), optionally for a specific variant
@param int $attribute_id The attribute ID (optional)
@param int $attribute_value_id The attribute value ID (optional)
getOwnId($attribute_value_id = null, $attribute_id = null)
Link
Returns the product's own ID (SKU), optionally for a specific variant
@param int $attribute_value_id The attribute value ID (optional)
@param int $attribute_id The attribute ID (optional)
getSecOwnId($attribute_id = null, $attribute_value_id = null)
Link
Returns the product's secondary SKU, optionally for a specific variant
@param int $attribute_id The attribute ID (optional)
@param int $attribute_value_id The attribute value ID (optional)
getGtin($attribute_value_id = null, $attribute_id = null)
Link
Returns the product's GTIN/EAN, optionally for a specific variant
@param int $attribute_value_id The attribute value ID (optional)
@param int $attribute_id The attribute ID (optional)
getSiblings()
Link
Returns sibling products (products with the same parent) as SafeProduct objects
getNoShopping()
Link
Returns whether the product is excluded from shopping feeds
int
getRequiresAgeVerification()
Link
Returns the minimum age for buying the product (0 if there is no age requirement)
int
getAgeLimit()
Link
bool
isWithdrawalExempt()
Link
Is the product exempt from the 14-day right of withdrawal? (Danish Consumer Contracts Act §18(2) — issue #596)
getWithdrawalExemptReason()
Link
Returns the legal exemption reason (made_to_order, perishable, sealed_hygiene,
inseparable, other) or null if the product has the standard right of withdrawal.
getWithdrawalExemptNote()
Link
Returns the store's optional free text that elaborates on the exemption (or null).
getDepositType()
Link
Deposit (#645): Returns the product's deposit type as SafeProductDeposit —
or null if the product has no deposit (no type selected, or the type has been removed).
bool
hasDeposit()
Link
Does the product have a deposit? (handy for <{if}> gates in templates)
getDepositCount($attribute_id = null, $attribute_value_id = null)
Link
Number of deposit units per sales unit (optionally per variant)
getDepositTotal($amount = 1, $attributes = null)
Link
Total deposit amount (gross, incl. VAT) for $amount units — 0.0 if the product has no deposit.
$attributes uses the basket line format, so variant quantities are looked up automatically.
getUnitAmount()
Link
Unit price (#663): number of base units in the package (e.g. 24, or 0.5 for a 500 g bag).
getUnitLabel()
Link
Unit price (#663): the base unit as free text ("pcs", "L", "kg", etc.) — may be empty.
getPricePerUnit($amount = 1, $attributes = 'Array')
Link
Unit price (#663): the sales price divided across the package contents, with the customer's VAT/customer group/
voucher (via getRealPrice). Returns null if the product has no unit quantity set.
getPricePerUnitExVat($amount = 1, $attributes = 'Array')
Link
Unit price excl. VAT (#663) — for B2B themes that show prices excluding VAT.
string
getWithdrawalExemptText()
Link
Returns a friendly, translated explanation to the customer of why the product is exempt from
the right of withdrawal. The store's own note takes precedence if it is set.
Empty string if the product is not exempt.
getMpn($attribute_value_id = null, $attribute_id = null)
Link
Returns the manufacturer part number (MPN), optionally for a specific variant
@param int $attribute_value_id The attribute value ID (optional)
@param int $attribute_id The attribute ID (optional)
getHasCreditUntil()
Link
Returns whether the product has a credit period until a specific date
getNeverFreeShipping()
Link
Returns whether the product never qualifies for free shipping
getCreditUntil()
Link
Returns the credit expiry date
getHasCreditDays()
Link
Returns whether the product has a number of credit days
getCreditDays()
Link
Returns the number of credit days for the product
getCampaigns()
Link
Returns campaigns associated with the product as SafeCampaign objects
getSubscriptionCampaigns()
Link
Returns campaigns that give the product a different price on subscription (e.g. "3 for DKK 255
on subscription"), as SafeCampaign objects. Use getSubscriptionPrice()/
getSubscriptionUnitPrice() or getSubscriptionPercent() on the campaign.
getHasCreditDate()
Link
Returns whether the product has a specific credit date
getCreditDate()
Link
Returns the specific credit date
getIsVoucher()
Link
Returns whether the product is a gift card
getVoucherDays()
Link
Returns the gift card's validity period in days
getVoucherAmount()
Link
Returns the gift card amount
getGiftCardAmountRange()
Link
Gift card with a customizable amount (HD #6165): ['min' => …, 'max' => …] in the currency the customer is shopping in,
or null when the item has a fixed amount. If there are limits, the theme must display an amount field named
giftcard_amount in the Add to Cart form (e.g., 350 or 350.50). The customer pays the amount, and the gift card
is credited with the same amount. If no amount is provided, the item is rejected with $giftcard_amount_error (product_id, code, min, max;
codes: missing, invalid, min, and max). The theme sets "supports_giftcard_amount": true in
theme_settings.json.
getLocation($attribute_value_id = null, $attribute_id = null)
Link
Returns the product's stock location, optionally for a specific variant
@param int $attribute_value_id The attribute value ID (optional)
@param int $attribute_id The attribute ID (optional)
getAllowNegativeStock()
Link
Returns whether the product allows negative stock

For bundles where the stock status reflects the contents, it also applies that none of the
missing products may themselves prohibit negative stock (HD #5731 / GH #977). Without this, a
discontinued product was sold again and again through the bundle, because the bundle's own flag is inherited from
the webshop's default setting and thereby overrode the product's own choice. All other
products are unaffected and return the setting as before.
canOversell($amount = 1)
Link
Returns whether the product may actually be sold without stock to cover it

Same answer as getAllowNegativeStock(), but with a name that says what it means.
@param int $amount Quantity to be purchased (default: 1)
canEdit()
Link
Returns whether the current user can edit the product
getMetaValues($parsed = '1')
Link
Returns all meta values for the product
@param bool $parsed Whether the values should be parsed for variables (default: true)
getSubscriptionInterval()
Link
Returns the subscription interval in days
hasVariant()
Link
Returns whether the product has variants
hasVariants()
Link
Returns whether the product has variants (alias for hasVariant)
hasCustomerInput()
Link
Does the product's profile have customer input attributes (input_mode='customer')?
Used by themes to, for example, hide sticky add-to-cart bars that do not
post attributes. Request-cached via getProductProfileAttributeList.
hasRequiredCustomerInput()
Link
Does the product's profile have REQUIRED customer input attributes? Quick-add buttons
(product cards, landing pages, upsell) should then link to the product page
instead, since they cannot collect the customer's input.
getSubscriptionPrice($country_id = null)
Link
Returns the subscription price incl. VAT for a specific country
@param int $country_id The country ID (optional, uses the session if not specified)
getSubscriptionPriceExVat()
Link
getMetaValue($key, $parsed = '1')
Link
Returns a specific meta value based on the key
@param string $key The key of the meta value
@param bool $parsed Whether the value should be parsed for variables (default: true)
getUrl($action = 'view', $controller = null)
Link
Returns the product's URL based on the requested action
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getRemoteUrl()
Link
Returns the product's external URL
getName()
Link
Returns the product's name
getDescription()
Link
Returns the product's description
getListDescription()
Link
Returns the product's list description with parsed variables
getParsedDescription()
Link
Returns the product's description with parsed variables
getTariffCode()
Link
Returns the product's customs tariff code
getCountryOfOrigin()
Link
Returns the product's country of origin
getProductVat($country_id = null)
Link
Returns the VAT rate for the product in a specific country
@param int $country_id The country ID (optional, uses the session/webshop default if not specified)
getPrice()
Link
Returns the product's price incl. VAT
getDiscountPrice()
Link
Returns the price after any gift card discount
getNormalPrice($amount = 1, $attributes = 'Array')
Link
Returns the regular price BEFORE any sale, incl. VAT, with quantity and variant.

The counterpart to getRealPrice(), which returns the sale price when there is one. Used for
the struck-through previous price on a cart line: without the variant lookup, the previous price
would be the product's base price, even when the line is a variant with its own price.

@param int $amount Number of products (default: 1)
@param array $attributes The line's attributes (optional)
getRealPriceExVat($amount = 1, $attributes = 'Array')
Link
Returns the actual price excl. VAT with quantity and attributes
@param int $amount Number of products (default: 1)
@param array $attributes Array of attributes (optional)
getPriceExVat()
Link
getSalePriceExVat()
Link
getLowest30DayPrice($variant = null)
Link
Returns the lowest price in the last 30 days incl. VAT. Used for the previous price under the Omnibus Directive when prices are reduced. Returns null if there is no price history. $variant can be specified for a variant-specific previous price.
getBulkDiscountOver()
Link
getBulkDiscount()
Link
getBulkDiscountPrice($a = 'Array')
Link
Returns the price with bulk discount
@param array $a Array of attributes (optional)
hasBulkDiscount()
Link
Does the product have an active quantity discount (bulk_discount) configured?
Used by themes to show a "Quantity discount" badge and a hint on the product page.
Requires a threshold >= 1 ("buy more than X"): over = 0 would mean "always"
(not a real quantity discount) and would make getBulkDiscountPrice() subtract
the discount twice in the strikethrough display.
getBulkDiscountTriggerAmount()
Link
The quantity that must be bought before the quantity discount applies.
bulk_discount_over means "more than X", so the discount applies at X+1.
Returns null if there is no quantity discount.
getBulkDiscountInclVat()
Link
The quantity discount per unit incl. VAT (for storefront display).
Mirrors the VAT logic in getRealPrice()/getBulkDiscountPrice().
getBasketAmount()
Link
Returns how many units of the product are in the cart right now, counted across
variants and lines. Used, for example, to show whether an add-on from
$webshop->getBasketAddOnProducts() is already selected (0 = not in the cart).
isBulkDiscountActive($attributes = 'Array')
Link
Is the quantity discount actually active right now, given the quantity of this product in the cart?
Mirrors the condition in getRealPrice(): the quantity discount is skipped when a
customer group/contract price is active (the contract price wins), and otherwise the quantity must be
strictly greater than the threshold, counted across variants/lines via
Basket::getProductCount().
@param array $attributes The line's attributes (so the group price check matches the variant)
getLowestRealPriceAttributeValueId()
Link
getLowestSalePriceAttributeValueId()
Link
getLowestPriceAttributeValueId()
Link
getLowestRealPrice()
Link
getLowestPrice($in_stock_only = '')
Link
Lowest variant price (the "From" price)
@param bool $in_stock_only Only variants in stock. For themes that hide sold-out variants, so
"From" does not show the price of a variant the customer cannot select. If all are sold out, it works as before.
getLowestSalePrice($in_stock_only = '')
Link
Lowest variant sale price
@param bool $in_stock_only See getLowestPrice(). Here a variant without a sale price is included at its regular price,
so a cheaper sold-out variant does not look like a sale.
getSalePrice()
Link
getRealVat($amount = 1, $attributes = 'Array')
Link
Calculates and returns the VAT for the actual price
@param int $amount Number of products (default: 1)
@param array $attributes Array of attributes (optional)
getRealPrice($amount = 1, $attributes = 'Array', $no_voucher = '', $skip_basket_check = '', $price_per_unit = null, $sale_limit_consumed = null)
Link
Calculates and returns the actual price incl. VAT and discounts
@param int $amount Number of products (default: 1)
@param array $attributes Array of attributes (optional)
@param bool $no_voucher Whether the gift card discount should be ignored (default: false)
@param bool $skip_basket_check Whether the cart check should be skipped (default: false)
@param float $price_per_unit Reference to the unit price (filled in by the method)
getSaleLimitAppliedAmount($amount = 1, $attributes = 'Array')
Link
How many of the $amount units actually get the sale price. null when the product is not
on sale or has no quantity limit, in which case there is nothing to tell
the customer. Used by themes for the "3 of 5 at sale price" line in the cart.
@param int $amount Quantity on the cart line
@param array $attributes The line's attributes
getSaleLimit()
Link
Number of units left at the sale price. null = no limit.
hasActiveCustomerGroupPrice($attributes = 'Array')
Link
B2B: does the current (logged-in group) customer have a contract price/discount on
this product? Used by Basket::price() to route a group price line as
not on sale (contract price ≠ sale). Always returns false when there
is no group.
*
getCustomerGroupPriceTiers()
Link
B2B: the logged-in group's quantity price tiers for this product as
[min_quantity => price_incl_vat_per_unit], sorted ascending. Empty if there is no group or
no fixed tiers. For storefront display of quantity discounts (the template shows prices excl. VAT).
*
getDiscountPriceInclVat($amount, $attribute_value_id)
Link
Returns the discount price incl. VAT for a specific quantity
@param int $amount Number of products
@param int $attribute_value_id The attribute value ID
getRealSubscriptionVat($amount = 1, $attributes = 'Array', $country_id = null)
Link
Calculates and returns the VAT for the subscription price
@param int $amount Number of products (default: 1)
@param array $attributes Array of attributes (optional)
@param int $country_id The country ID (optional)
getRealSubscriptionPrice($amount = 1, $attributes = 'Array', $country_id = null)
Link
Returns the actual subscription price incl. VAT
@param int $amount Number of products (default: 1)
@param array $attributes Array of attributes (optional)
@param int $country_id The country ID (optional)
getRealSubscriptionPriceExVat($amount = 1, $attributes = 'Array')
Link
getVat()
Link
hasAttributePrice()
Link
clearAttributePriceCache($product_id = null)
Link
preloadForCards($product_ids)
Link
preloadAttributePrice($product_ids)
Link
preloadRating($product_ids)
Link
preloadImages($product_ids)
Link
preloadProductLabels($product_ids)
Link
preloadStockVariants($product_ids)
Link
registerAttributeValuesForPreload($product_ids)
Link
registerSimilarProductsForPreload($product_ids)
Link
registerBrandsForPreload($product_ids)
Link
registerMainCategoriesForPreload($product_ids)
Link
getAttributePrice($attribute_value_id, $before_sale = '')
Link
Returns the price for a specific attribute value
@param int $attribute_value_id The attribute value ID
@param bool $before_sale Whether the sale price should be ignored (default: false)
getAttributeSalePrice($attribute_value_id)
Link
Returns the sale price for a specific attribute value
@param int $attribute_value_id The attribute value ID
getAttributeSubscriptionPrice($attribute_value_id, $country_id = null)
Link
Returns the subscription price for a specific attribute value
@param int $attribute_value_id The attribute value ID
@param int $country_id The country ID (optional)
getAttributeSubscriptionPriceExVat($attribute_value_id)
Link
getShippingInclVat()
Link
getShipping()
Link
getApproxShipping()
Link
getDeliveryTime()
Link
getDeliveryTimeNotInStock()
Link
getSave()
Link
getPercentSave()
Link
getImages()
Link
getImage($attribute_value_id = null)
Link
Returns the product image, optionally for a specific variant
@param mixed $attribute_value_id ID or value of the attribute (e.g. 'L') (optional)
getProfile()
Link
getIsRental()
Link
Is the product for rent? It is when its profile is a rental profile. The price is then
the daily price, the stock figure is the number of units, and add to cart requires the fields rental_from and
rental_to (Y-m-d). Available dates are fetched from /rental-availability.
getRentalMinDays()
Link
Rental: the shortest period in days that can be rented (at least 1). Calendar days, counting both dates.
getIsTicket()
Link
Is the product a ticket product? It is when its profile is a ticket profile. The product then has dates with
a number of seats (getTicketDates()), and add to cart requires the field ticket_date_id, unless
the product has only one date available for purchase. Stock is not used.
getTicketDates($include_sold_out = '1')
Link
Tickets: the dates that can be purchased now, in order of start time. Each date is an array with
ticket_date_id, starts_at, ends_at, date (e.g. "Fri. 18.01.2027 at 19:00–22:00"), label, info,
remaining (null = unlimited), sold_out and price (the price per ticket incl. the date's surcharge).
Seats can be up to 4 hours old on a cached page: fetch them fresh from /ticket-availability.
@param bool $include_sold_out Include sold-out dates (default: yes, so they can be shown as sold out)
getTicketSettings()
Link
Tickets: the product's settings as an array: holder_fields (none, name or name_birthday),
location (venue), terms (terms and conditions) and send_tickets (QR tickets or just a booking confirmation).
getDownPaymentInfo()
Link
Partial payment: details for the product page when the product can be paid with a deposit, otherwise null.
Array with label (e.g. "Deposit"), type (fixed or percent), amount (fixed amount per unit in the
customer's currency), percent and send_days (the deposit applies when the date is more than that many days away).
getAttributeValue($i)
Link
Returns the attribute value for a given attribute
@param int $i The attribute ID
getAttributeSearchUrl($attribute_id)
Link
Link to the search page with all products that have the same value for the property, e.g. "Series: Valhalla"
→ all issues in the series. Null when the product has no value. For non-variant properties with
text, numbers or a value list (not yes/no, files or HTML).
@param int $attribute_id The property's ID
@return string|null
getAttributeValueIdBySku($sku)
Link
Finds the attribute value ID based on SKU
@param string $sku SKU to search for
getAttributeTag($i)
Link
Returns the attribute tag for a given attribute
@param int $i The attribute ID
getAttributeValueByName($i)
Link
Returns the attribute value based on name
@param string $i The name of the attribute
getCategory()
Link
getCategoryName()
Link
getOnlineSince()
Link
getOnlineHours()
Link
getCategoryNames($pre = '', $sep = ' ', $post = '')
Link
Returns category names formatted with prefix, separator and suffix
@param string $pre Prefix before each category name (default: "")
@param string $sep Separator between category names (default: " ")
@param string $post Suffix after each category name (default: "")
getCategories($as_ids = '')
Link
Returns all categories the product belongs to
@param bool $as_ids Whether to return only category IDs (default: false)
getStockCount()
Link
getPackage()
Link
getMaxPerOrder()
Link
Max. quantity the customer can buy of the product per order, across variants. Empty (null) = no limit.
The store enforces the limit itself in the cart and checkout. Use the number to show the limit and as max on
the quantity field. The message shown when the limit is reached is in $max_per_order_notice.

@return int|null
getOpenPrice()
Link
Whether the price is entered at the register (POS): the product is a product group, e.g. "LP - Jazz", that is only sold
at the register. It cannot be added to the cart in the webshop.

@return bool
getIsInStock()
Link
getStructuredDataAvailability($attributes = 'Array')
Link
Returns the schema.org availability for structured data, e.g. "https://schema.org/BackOrder"

Uses the same logic as the Google Shopping feed, so the product page and the feed do not
contradict each other (HeroDesk #5659 / issue #877)
@param array $attributes Array of attribute_id => value_id if the stock status applies to a variant
getStructuredDataAvailabilityStarts($attributes = 'Array')
Link
Returns the date a backordered product is expected back in stock (schema.org availabilityStarts)

Returns null if the product is not on backorder, or the store has not specified a number of days
@param array $attributes Array of attribute_id => value_id if the stock status applies to a variant
getInStock($attributes = 'Array', $x = null)
Link
Returns the stock level for the product
@param array $attributes Array of attributes, or an attribute ID if $x is specified
@param mixed $x Attribute value if the first parameter is an attribute ID
getLocationStock($stock_location_id = null, $attribute_id = null, $attribute_value_id = null)
Link
Returns the stock level for a specific stock location
@param int $stock_location_id ID of the stock location (optional)
@param int $attribute_id ID of the attribute (optional)
@param int $attribute_value_id ID of the attribute value (optional)
getNegativeStockCount()
Link
Returns the quantity on backorder (negative stock)
getAmount()
Link
isMarginScheme()
Link
Sold under the margin scheme (the Margin scheme VAT category at the time of purchase) when the product comes from
$order->getProducts(). The order line's category, not the product's current one. The themes Alaska2,
California and Washington call it on these products in emails; previously it only existed on
SafeOrderProduct, so the asterisk was missing. False for products outside an order.
getRecurringOrderProductId()
Link
The line's ID in the subscription when the product comes from SafeRecurringOrder::getProducts(). Used
to look up the line's price in SafeRecurringOrder::getLinePrices(). Null for other products.
getUnitPrice()
Link
getUnitVat()
Link
getComment()
Link
getAttributes()
Link
getRelatedProducts($limit = 25, $order_by = null)
Link
Returns related products
@param int $limit Maximum number of products (default: 25)
@param string $order_by Sorting: 'stock' (in stock first), 'price' (cheapest first), 'price_desc' (most expensive first), 'name' (alphabetical), 'random' (random), or null (default weighting)
getSimilarProducts($limit = 25, $order_by = null)
Link
Returns similar products
@param int $limit Maximum number of products (default: 25)
@param string $order_by Sorting: 'stock' (in stock first), 'price' (cheapest first), 'price_desc' (most expensive first), 'name' (alphabetical), 'random' (random), or null (default sorting)
getSimilarProductRatings()
Link
getSimilarProductReviews()
Link
getNext()
Link
getPrev()
Link
getSupplier()
Link
getSupplierName()
Link
getBrandName()
Link
getSearch()
Link
getAlsoBought($limit = 25)
Link
Returns products that other customers also bought
@param int $limit Maximum number of products (default: 25)
getHtmlFields()
Link
getHtmlField($tag)
Link
Returns a specific HTML field based on tag
@param string $tag The HTML field's tag
getInStockVariants()
Link
getStockVariants($only_in_stock = '', $hide_stock = '')
Link
Returns the stock status for all variants
@param bool $only_in_stock Show only variants in stock (default: false)
@param bool $hide_stock Hide the stock quantity (default: false)
getFileDownloadUrl($order_id = null)
Link
Returns the download URL for the product file
@param int $order_id The order ID (optional, uses the product's order ID if not specified)
getFile()
Link
getPDF()
Link
getPdfFiles()
Link
getSubscriptionFixation()
Link
getDiscountIntervals()
Link
getPurchasePrice($attribute_id = null, $attribute_value_id = null)
Link
Returns the purchase price for the product
@param int $attribute_id ID of the attribute (optional)
@param int $attribute_value_id ID of the attribute value (optional)
getDiscountIntervalPrice($amount, $attribute_value_id = 0)
Link
Returns the discount price for a given quantity (alias for getDiscountPriceInclVat)
@param int $amount Number of products
@param int $attribute_value_id ID of the attribute value (default: 0)
getDiscountIntervalPriceExVat($amount, $attribute_value_id = 0)
Link
Returns the discount price excl. VAT for a given quantity
@param int $amount Number of products
@param int $attribute_value_id ID of the attribute value (default: 0)
getShippingWeight()
Link
hasBundleProducts()
Link
getBundleProductsCount()
Link
getBundleProducts()
Link
hasBundleVariants()
Link
Returns true if the product is a bundle where at least one component has variants
getLocationByOwnId($own_id)
Link
Finds the stock location based on SKU
@param string $own_id The SKU
getBundleProductIds()
Link
getMainCategoryName()
Link
getMainCategory()
Link
hasCategory($category_id)
Link
Checks whether the product is assigned to a specific category
@param int $category_id The category ID
getProductReviews($limit = 25)
Link
Returns product reviews
@param int $limit Maximum number of reviews (default: 25)
getAvgRating($no_round = '')
Link
Returns the average rating
@param bool $no_round Whether the rating should not be rounded (default: false)
getReviewCount()
Link
getSafeProduct()
Link
getBrand()
Link
getMetaTitle()
Link
getMetaDescription()
Link
getOpenGraphTitle()
Link
getOpenGraphDescription()
Link
getOpenGraphImage()
Link
getPrimarySearchPhrase()
Link
getGoogleShoppingTitle()
Link
getGoogleCategory()
Link
getNoIndex()
Link
hasCampaigns()
Link
getCampaignInfo()
Link
getCampaignPrice($price = null)
Link
Returns the campaign price for 1 unit when a campaign gives a discount already when buying
a single unit (percent or fixed with a minimum quantity of 1). Otherwise null.
@param float $price The price shown today (incl. any sale price/variant). Default getRealPrice()

Mirrors Basket::price(): percent is calculated from getRealPrice() (so the sale price is
the basis), fixed gives the campaign's price per unit (+ VAT if prices are excl. VAT).
If more than one active campaign applies to the product, null is returned — the cart
stacks them, and a displayed price that doesn't match the cart is worse than none.
getProductLabels()
Link
getGoogleShoppingImage()
Link
getBlogPosts()
Link
getExtensionValue($name)
Link
Returns the value of an extension data field
@param string $name The name of the extension data field
getManufacturer()
Link
getManufacturerName()
Link
getSafetyProfile()
Link
getSafetyProfileName()
Link
hasActiveVariants($attribute_id)
Link
getActiveVariantIds($attribute_id)
Link

SafeProductBatch

Link
getProductBatchId()
Link
getProductId()
Link
getBatchNumber()
Link
getName()
Link
getExpiryDate()
Link
getFormattedExpiryDate()
Link
getManufacturingDate()
Link
getReceivedDate()
Link
getSupplierId()
Link
getSupplier()
Link
getNotes()
Link
getStockAmount($attribute_id = null, $attribute_value_id = null)
Link
isExpired()
Link
getDaysUntilExpiry()
Link
getUrl($action = 'view', $controller = null)
Link

SafeProductDeposit

Link
getProductDepositId()
Link
Returns the deposit type's ID
getName()
Link
Returns the deposit type's name (e.g. "Deposit A")
getAmount()
Link
Returns the deposit amount per unit, gross (incl. VAT)
getOwnIdOrDefault()
Link
Returns the SKU used for bookkeeping (or the fallback "DEPOSIT-{id}")
getVatShare($vat_pct)
Link
Returns the VAT portion of the gross amount at a given VAT rate
getAmountExVat($vat_pct)
Link
Returns the deposit amount per unit excl. VAT at a given VAT rate
(for B2B themes that show prices excl. VAT)

SafeProductFile

Handles files attached to products (downloads, manuals)

Link
getFilename()
Link
Returns the file name
getUrl()
Link
Returns the public URL of the file
getMB()
Link
Returns the file size in megabytes
getBytes()
Link
Returns the file size in bytes

SafeProductLabel

Handles product labels and badges

Link
getProductLabelId()
Link
Returns the product label's ID
getName()
Link
Returns the name of the product label
getTag()
Link
Returns the tag of the product label
getColor()
Link
Returns the color of the product label

SafeProductProfileAttributeValue

Handles values for product attributes

Link
getAttributeValueId()
Link
Returns the attribute value's ID
getVal()
Link
Returns the value of the attribute
getTag()
Link
Returns the tag of the attribute value
getAttributeSharedValueId()
Link
Returns the ID of the shared value the value is linked to, or null. Used to find all products with the same value across profiles, e.g. /ajax?shared_values=ID
getImages($product)
Link
Returns any images on the variant. Takes the current product as an argument.
getImage($product)
Link
Returns any image on the variant. If there are several, the first one is returned. Takes the current product as an argument.

SafeProductReview

Represents customer reviews of products

Link
getRating()
Link
Returns the rating (number of stars)
getDescription()
Link
Returns the review's description
getCreated()
Link
Returns the time the review was created
getName()
Link
Returns the name of the reviewer
getEmail()
Link
Returns the email address of the reviewer
getOrder()
Link
Returns the associated order as a SafeOrder object
getProduct()
Link
Returns the reviewed product as a SafeProduct object
getImages()
Link
Returns the customer's images as an array of SafeImage objects. Empty if the review has not
been approved, or if the store has turned off showing the images on the review.

SafeProfile

Handles product profiles with attributes and properties

Link
getAttributeList()
Link
Returns the list of attributes for this profile as SafeProfileAttribute objects
getName()
Link
Returns the profile's name
getTag()
Link
Returns the profile's tag
getIsAddon()
Link
Returns 1 if the profile is an add-on profile (the products are shown as add-ons in the cart and checkout)
getIsFinancial()
Link
Returns 1 if the profile is for financial products (credit and store credit vouchers)
getProfileId()
Link
Returns the profile's ID

SafeProfileAttribute

Represents attributes for product profiles

Link
bool
offsetExists($offset)
Link
mixed
offsetGet($offset)
Link
void
offsetSet($offset, $value)
Link
void
offsetUnset($offset)
Link
getValues($product = null)
Link
Returns values for this attribute as SafeProductProfileAttributeValue objects
If $product is given, the values are filtered by active variants for that product
getHasPrice()
Link
Returns whether the attribute has prices attached
getPurpose()
Link
Returns the purpose of the attribute
getTags()
Link
Tags from the values
getTag()
Link
Returns the attribute's tag
getIsVariant()
Link
Returns whether the attribute is a variant
getInputMode()
Link
'shop' (the webshop fills it in — spec data) or 'customer' (the customer fills in
the field on the product page — personalization)
isCustomerInput()
Link
Is the attribute a customer input field? (is_variant=0 + input_mode='customer')
getIsRequired()
Link
Must the customer fill in the field before the product can be added to the cart?
getMaxLength()
Link
Max. number of characters for text fields (null/0 = unlimited, but always max. 255)
getPlaceholder()
Link
Placeholder text shown in the empty field in the webshop
getDataType()
Link
Returns the data type of the attribute
getName()
Link
Returns the attribute's name
getVal()
Link
Returns the value of the attribute
getUnit()
Link
Returns the attribute's unit (e.g. kg, cm, GB)
getHiddenVariantFields()
Link
Returns hidden variant fields as an array
isVariantFieldVisible($field)
Link
Checks whether a variant field is visible (not hidden)
getAttributeId()
Link
Returns the attribute's ID
getList($profile_id)
Link
Returns the list of attributes for a given profile

SafeRecurringOrder

Handles subscription orders and recurring payments

Link
getDeliver()
Link
Returns the delivery interval
getInterval()
Link
Returns the subscription interval in days
getFirst()
Link
Returns the date of the first delivery
getNext()
Link
Returns the date of the next delivery
getShipping()
Link
Returns the shipping method as a SafeShipping object
getComments()
Link
Returns the customer's comments on the subscription
getRecurringOrderId()
Link
Returns the subscription's ID
getInvoiceId()
Link
Returns the invoice ID for the subscription
getTime()
Link
Returns the time the subscription was created
getEmail()
Link
Returns the customer's email address
getPhone()
Link
Returns the customer's phone number
getSetting($n)
Link
Returns a specific setting for the subscription
@param string $n The name of the setting
getWebshopRecurringOrderId()
Link
Returns the webshop's subscription number
getTrackingNumber()
Link
getTrackingUrl()
Link
getPublicUrl($action = 'subscription')
Link
Returns the public URL of the subscription
@param string $action The action (default: 'subscription')
getStatus()
Link
Returns the subscription's status
getOrderPrice()
Link
Returns the subscription price excluding shipping
getPrice()
Link
Returns the subscription's price incl. VAT
getTotalPrice()
Link
Returns the total price incl. shipping and VAT
getLinePrices()
Link
The lines' price per delivery, incl. campaign prices on subscriptions. The key is
recurring_order_product_id (the same as getRecurringOrderProductId() on the lines from
getOrderProducts()). Per line: product_id, name, amount, base_price (without campaign),
price, unit_price and campaign (SafeCampaign or null).
getShippingPrice()
Link
Returns the shipping price
getVat()
Link
Returns the total VAT amount
getEanNumber()
Link
getPaymentPrice()
Link
getOrderName()
Link
getOrderCompanyName()
Link
getOrderAddress()
Link
getOrderZipcode()
Link
getOrderCity()
Link
getOrderCountry()
Link
getDelName()
Link
getDelCompanyName()
Link
getDelAddress()
Link
getDelCity()
Link
getDelZipcode()
Link
getDelCountry()
Link
getPickupAddress()
Link
getDeliveryShippings()
Link
Returns the shipping methods the customer can switch the subscription to (SafeShipping objects).
Methods for the delivery country that the subscription's products are not too heavy for. The
current method is always included. Use SafeShipping::hasDeliveryShops() to see whether
the method requires a parcel shop.
getShippingId()
Link
Returns the ID of the subscription's shipping method
getDelCountryId()
Link
Returns the ID of the subscription's delivery country
getOrderProducts()
Link
Returns all products in the subscription as SafeRecurringOrderProduct objects
getProducts()
Link
Returns all products in the subscription as SafeProduct objects
getExtras($field = null)
Link
Returns extra fields for the subscription
@param string $field Specific field to get (optional, returns all if not specified)
getVoucher()
Link
getVoucherDiscount()
Link
getVoucherCode()
Link
setTrackingCalled($i = 1)
Link
Marks that tracking has been called for the subscription
@param int $i The value to set (default: 1)
getTrackingCalled()
Link
getPaymentGateway()
Link
getPaymentGatewayId()
Link
getCustomer()
Link
Returns the customer as a SafeCustomer object
getSubscriptionId()
Link
Returns the subscription ID from the payment gateway
getCloseAfter()
Link
Returns the number of deliveries before the subscription is closed automatically

SafeRecurringOrderProduct

Handles products in subscription orders

Link
getAmount()
Link
getUnitPrice($amount = 1)
Link
getPrice($amount = 1)
Link
getRealPrice($amount = 1)
Link
getName()
Link
getComment()
Link
getOwnId()
Link
getAttributes()
Link

SafeSafetyProfile

Handles safety profiles for hazardous products

Link
int
getSafetyProfileId()
Link
string
getName()
Link
getImages()
Link

SafeShipping

Represents shipping methods with prices and delivery times

Link
getShippingId()
Link
getName()
Link
getModule()
Link
hasDeliveryShops()
Link
Returns true if the shipping method delivers to a parcel shop that the customer must choose
(GLS, PostNord, DAO, DHL, Swipbox)
getMaxWeight()
Link
getShowWhenTooHeavy()
Link
isTooHeavy($basket_weight = null)
Link
getTag()
Link
getCost($country_id = null, $basket_total = null)
Link
Calculates shipping costs for a specific country and cart total
@param int $country_id The country ID (optional, uses the session if not specified)
@param float $basket_total The cart total (optional, calculated automatically if not specified)
getImage()
Link
getCarrier()
Link
Returns the selected carrier (slug), or "" if the logo is derived automatically
getCarrierLogos()
Link
Returns the carrier logos to display, as a list of ["slug", "name", "width"].
Empty list if no logo should be shown.
getHtmlFields()
Link
getHtmlField($tag)
Link
Returns a specific HTML field based on tag
@param string $tag The HTML field's tag
getDeliveryShops($as_json = '')
Link
Returns delivery shops/parcel shops
@param bool $as_json Whether the data should be returned as JSON (default: false)
getTrackingUrl($id = '')
Link
Returns the tracking URL for a shipment: the store owner's own, otherwise the carrier's
default tracking page. Empty string if there is none. Without a number, the template is returned
with %ID%. If the order has several parcels, call it once per number
@param string $id Tracking number (default: "")

SafeStockLocation

Handles stock locations and stock levels

Link
getStockLocationId()
Link
getName()
Link
getIsDefault()
Link
getTag()
Link

SafeSupplier

Represents suppliers with contact information and products

Link
getSupplierId()
Link
getName()
Link
getRemoteUrl()
Link

SafeVoucher

Handles discount codes and gift cards

Link
canUse()
Link
getVoucherId()
Link
getCode()
Link
getExpires()
Link
getAllowOnSale()
Link
bool
getAllowWithPoints()
Link
getIsPublic()
Link
getPercentDiscount()
Link
getPriceDiscount()
Link
getSaveChange()
Link
Is the remaining balance saved for the next purchase? Then the code is a means of payment (gift card or
store credit) and not a discount. The themes use it to name the line in the cart.
*
getFreeShipping()
Link
Does the code give free shipping in THIS cart? Context-dependent on purpose: it answers based on
the delivery country in the session and the cart amount, not just the flag in the database.
The themes use it to show the "Free shipping" line, and it must disappear when
shipping is actually charged — e.g. when the customer chooses a country the code doesn't apply in.
*
getOnlyOver()
Link

SafeWebshop

Represents the webshop with settings and configuration

Link
getName()
Link
getDescription()
Link
getWebshopId()
Link
getCheapestShipping()
Link
getGaId()
Link
getEnableTracking()
Link
getEnableNewTracking()
Link
getGoogleAdsConversionId()
Link
getGoogleAdsConversionLabelOrder()
Link
getFbId()
Link
getGoogleMerchantId()
Link
getGoogleMerchantDeliveryDays()
Link
getGoogleOptimizeId()
Link
getGoogleTagManagerId()
Link
getGA4MeasurementID()
Link
getGooglePlaceID()
Link
getPinterestTagID()
Link
getPinterestAccessToken()
Link
getSnapPixelID()
Link
getSnapApiToken()
Link
getTikTokPixelID()
Link
getTikTokAccessToken()
Link
getGoogleAdsConversionActionId()
Link
getLinkedInID()
Link
getMerchantNumber()
Link
getStatus()
Link
getHideDelivery()
Link
getFreeShippingOver()
Link
getFreeShippingProgress()
Link
How far the cart is from free shipping, using the same rules as checkout. Same value as
the template variable $free_shipping_progress. null when there is nothing to show (no
limit, "Never free shipping" on the shipping method, a product with "Never free shipping" in
the cart, or an empty cart). Otherwise an array:
limit the limit in the country's currency
price the amount measured against the limit
remaining the missing amount (0 when free shipping is reached)
percent 0-100
reached true when free shipping is reached
getFreeShippingSuggestions($limit = 3)
Link
Suggestions for products that give (or bring the customer closer to) free shipping, based on
the cart's contents. Empty list when free shipping is reached, or when there is no limit.
Each element is an array:
product SafeProduct
price the unit price the customer pays
reaches true when the product alone gives free shipping
attribute the variant attribute, or null when the product has no variants
values the variant values that can be bought (getAttributeValueId(), getVal())
Add to the cart with a POST to / with product_id, amount=1, attributes[attribute-id]
and redirect=/basket (or /shipping).
@param int $limit Max. number of suggestions (default: 3, at most 12)
getThemeSetting($element, $name)
Link
Returns a specific theme setting
@param string $element The element name
@param string $name The setting's name
getUrl($action = 'view', $controller = null)
Link
Returns the webshop's URL
@param string $action The action (default: "view")
@param string $controller Controller name (optional)
getLocale()
Link
Returns language and country as a locale, e.g. "da-DK", or the country's, e.g. "en-GB", when the page or
email is shown in a country (Countries, #1363). For JavaScript's Intl, payment windows and widgets
getPageLimit()
Link
Number of products per page in lists (Settings), as the headless API uses them: 25 when
nothing is set. E.g. for a theme that fetches the next page itself (infinite scroll).
getDecimalSeparator($default = ',')
Link
The decimal separator for prices and numbers: the country's, when the page or email is shown in a country with a
different number format (Countries, #1363), otherwise $default
@param string $default The theme's own decimal separator (default: comma)
getThousandSeparator($default = '.')
Link
The thousands separator for prices and numbers: the country's, when the page or email is shown in a country
with a different number format (Countries, #1363), otherwise $default
@param string $default The theme's own thousands separator (default: period)
getAllCategories()
Link
getCategories()
Link
getPages()
Link
getBrands($only_with_products = '')
Link
Gets the store's brands in the store's sort order
@param bool $only_with_products Only brands with at least one product the customer can see (as on /brands)
hasBrandPages()
Link
Has the store turned on brand pages (/brands and /brands/), and can the theme show them?
getShippings()
Link
getCountries()
Link
getDeliveryCountries()
Link
The countries the customer can have products delivered to: the store's countries, and in a country (Countries) only those the country delivers
to (Countries → the country → Delivery and payment). For the delivery address's country. The billing address
may be in any of the store's countries (getCountries()), so customers from all over the EU can shop.
*
getVouchers()
Link
getPublicVouchers()
Link
getNewsletters($limit = 25, $offset = 0, $count = null, $sort = 'newest')
Link
* Returns the store's public newsletters (shareable at /nyhedsbrev/).
* @param int $limit Number per page (default 25)
* @param int $offset Offset for pagination
* @param int $count Filled with the total number of public newsletters (reference)
* @param string $sort 'newest' (default), 'oldest' or 'title'
* @return array List of SafeNewsletterCampaign
getLatestNewsletter()
Link
* Returns the store's latest public newsletter, or false.
* @return SafeNewsletterCampaign|false
getNewsletterBySlug($slug)
Link
* Returns one public newsletter by slug, or false if it doesn't exist
* or isn't public.
* @param string $slug The newsletter's slug (rewrite_url)
* @return SafeNewsletterCampaign|false
hasNewsletters()
Link
* Returns whether the store has at least one public newsletter (for showing/hiding
* an archive section).
* @return bool
getPaymentModule()
Link
getLandingPageByTag($tag)
Link
Finds a landing page based on tag
@param string $tag The tag to search for
getLandingPagesByTags($tags)
Link
Finds landing pages based on tags
@param array $tags Array of tags or variadic arguments
getLandingPages()
Link
getCategoryByTag($tag)
Link
Finds a category based on tag
@param string $tag The tag to search for
getPagesByTag($tag)
Link
Finds pages based on tag
@param string $tag The tag to search for
getCategoriesByTags($tags = null)
Link
getCategoryByTags($tags = null)
Link
Finds categories based on tags
@param array $tags Array of tags or variadic arguments
getCategory($category_id)
Link
Returns a specific category
@param int $category_id The category ID
getCategoriesByIds($category_ids, $max = 100)
Link
Finds several categories based on IDs in ONE lookup (issue #869).
Themes that looped over a comma-separated ID list and called getCategory() per
iteration made one "SELECT * FROM product_category" per category. Here the
whole set is primed via Category::preloadIds() first, so the lookup becomes one IN(...) query.
Invalid and foreign categories are skipped — exactly like getCategory() — and
the order from $category_ids is preserved.
@param mixed $category_ids Array of category IDs or a comma-separated string
@param int $max Maximum number of categories returned (default: 100)
getLandingPage($landing_page_id)
Link
Returns a specific landing page
@param int $landing_page_id The landing page ID
getAttributeValues($categori_ids = 'Array')
Link
Returns attribute values for specific categories
@param array $categori_ids Array of category IDs (optional)
getSharedValues()
Link
Returns the store's shared values (e.g. Small, Medium, Large) as an array with id, value and num_value, in the order they appear in admin. Used e.g. to build a filter with /ajax?shared_values=
getAttributeValuesByTags()
Link
getCurrency()
Link
The currency prices are shown in: the country's currency when the customer shops in a country with its own
currency (Countries, #1363), otherwise the store's
getCountryCurrency()
Link
The country's currency (e.g. "SEK") when the customer shops in a country that sells in its own currency,
otherwise empty. For themes that otherwise show the store's own currency text (e.g. "kr.").
getAlsoBought($products)
Link
Returns products that other customers have also bought
@param array $products Array of SafeProduct objects
getRelated($products)
Link
Returns related products
@param array $products Array of SafeProduct objects
getAfterPurchase($products)
Link
Returns products recommended after purchase
@param array $products Array of SafeProduct objects
getPopularProducts($limit = 25, $days = 90, $exclude = null)
Link
Returns the most popular products in the webshop
@param int $limit Maximum number of products (default: 25)
@param int $days Number of days to look back (default: 90)
@param array $exclude Array of product IDs to exclude (optional)
getLiveSince()
Link
getCreated()
Link
getRelayUrl($page = '')
Link
Returns the relay URL
@param string $page Page path to append (default: "")
getPaymentGateways()
Link
getVippsExpressScript()
Link
The Vipps MobilePay Express buttons (#1480) for themes that render their pages in the browser
(e.g. Washington): <{$webshop->getVippsExpressScript()}> before on all pages. The buttons
only appear where the theme has a slot for them (
in the cart,
data-vipps-express="product" in the product form), and they are inserted again when the page changes.
Other themes get the script from the server on the cart and product page and should not call it.
*
getSuppliers()
Link
getProfiles()
Link
getMenu($tag)
Link
Finds a menu based on its tag
@param string $tag The tag to search for
getMenuByLocation($location)
Link
Finds a menu based on its location
@param string $location The location to search for
getMenus()
Link
getRootMenus()
Link
getHtmlFields()
Link
getHtmlField($tag)
Link
Returns a specific HTML field based on tag
@param string $tag The HTML field's tag
getCustomerFields()
Link
getAllowBasketPayment()
Link
getOnlineProducts($fields_str = '', $limit = null, $sort = null)
Link
Returns online products in the webshop
@param string $fields_str Comma-separated list of fields to include (optional)
@param int $limit Maximum number of products (default: 2500)
@param string $sort Sorting: newest (optional, default is alphabetical)
getProductById($product_id)
Link
Finds a product based on its ID
@param int $product_id The product ID
getProductsByIds($product_ids, $max = 100)
Link
Finds multiple products based on IDs in ONE lookup (issue #863).
Themes that looped over IDs and called getProductById() on each iteration made
one "SELECT * FROM product" per product. Here the whole set is registered with
Product::registerForPreload first, so the lookup becomes a single IN(...) query.
Invalid, deleted, offline, and foreign products are skipped (same rule as
getProductById(), which is reused directly), and the order from $product_ids is kept.
@param mixed $product_ids Array of product IDs or a comma-separated string
@param int $max Maximum number of products RETURNED (default: 100)
getProductBySku($sku)
Link
Finds a product based on its SKU
@param string $sku SKU
getProductByGtin($gtin)
Link
Finds a product based on its GTIN/EAN
@param string $gtin GTIN/EAN number
getUseEvents()
Link
For Klaviyo
getFinancialProducts()
Link
Returns the products whose profile is "financial", i.e. discount codes and credits
getBasketAddOnProducts()
Link
Returns the store's add-ons for the cart and checkout as SafeProduct objects: online products
in profiles marked as "Add-on profile" (e.g. gift wrapping, carry-in service, greeting cards).

Add-on products are not shown in the store's lists, search, or feeds. Instead, they are shown as
checkboxes in the cart and on the last step before payment. The list is empty when the cart does not
contain any regular products, so an add-on can never be bought on its own.

Each add-on is shown as a checkbox in its own form, which is sent as a POST to / with
the fields basket_addon (product ID), basket_addon_state (1 = add to cart, 0 = remove), and
basket_addon_return (basket, address, shipping, or approve: the step the customer is sent back
to). The box must never be checked in advance (Danish Consumer Contracts Act § 31), so use
getBasketAmount() on the product to show whether the add-on is already in the cart.

See components/basket-addons.html in Delaware, DelawareDK, Montana, and MontanaB2B for a
ready-made component that can be copied into your own theme.

@return array List of SafeProduct (at most 20, sorted by name)
getThemeSettings()
Link
getBlogPostById($blog_post_id)
Link
Returns a specific blog post based on its ID
@param int $blog_post_id The blog post ID
getBlogPost($blog_post_id)
Link
Returns a published blog post based on its ID, or false if it is deleted
or scheduled for later (same rule as getBlogPosts). The themes' wysiwyg component
calls it for inserted links, and without it they showed "Link not found".
@param int $blog_post_id The blog post ID
getPage($page_id)
Link
Returns a static page based on its ID, or false if it is deleted or offline
@param int $page_id The page ID
getBlogPosts($limit = 25, $offset = 0, $count = null, $sort = null, $sort_order = null)
Link
Returns published blog posts
@param int $limit Maximum number of posts (default: 25)
@param int $offset Start position (default: 0)
@param int $count Reference to the total count (filled in by the method)
@param string $sort Sort method (optional)
@param string $sort_order Sort order (optional)
getContentTypes()
Link
Returns the store's content types (Content → Content Types) as SafeContentType
getContentType($type)
Link
Returns a content type by its key (e.g. "recipe") or ID, or null
@param string $type The type's key or ID
getContentEntries($type, $limit = 12, $offset = 0, $sort = 'weight', $sort_order = 'asc')
Link
Returns active entries from a content type as SafeContentEntry
@param string $type The type's key (e.g. "recipe") or ID
@param int $limit At most this many entries (default: 12, max 100)
@param int $offset Skip this many entries (for pagination)
@param string $sort weight (manual sort order), title, newest, oldest, updated, or field:
@param string $sort_order asc or desc (used with field:)
getContentEntryCount($type)
Link
Returns the number of active entries in a content type
@param string $type The type's key (e.g. "recipe") or ID
getContentEntry($type, $slug_or_id)
Link
Returns one active entry from a content type by slug or ID, or null
@param string $type The type's key (e.g. "recipe") or ID
@param string $slug_or_id The entry's slug (e.g. "rhubarb-trifle") or ID
getBlogTitle()
Link
getBlogDescription()
Link
getBlogOpenGraphTitle()
Link
getBlogOpenGraphDescription()
Link
getStylesheet()
Link
getSkipApprove()
Link
getFrontCategory()
Link
hasInvoiceAddressSelection()
Link
hasPayPalCheckout()
Link
getPayPalSecret($basket_id)
Link
Returns the PayPal secret for a given cart
@param int $basket_id The cart ID
getPayPalClientId()
Link
getAfterBasket()
Link
getActiveCampaigns()
Link
getKlaviyoPublicKey()
Link
getCompany()
Link
paidOrders($email)
Link
Returns the number of paid orders for a given email
@param string $email The email address to search for
getProductLabels()
Link
getBlocks($type, $id = null)
Link
Returns blocks for a given page type
@param string $type Page type
@param int $id Page ID (optional)
templateExists($filename)
Link
Checks whether a template file exists
@param string $filename The file name of the template
getLoyaltyProgramFreeShipping()
Link
hasLoyaltyProgram()
Link
getLoyaltyProgramBasePoints()
Link
getLoyaltyProgramApprovalPeriod()
Link
getLoyaltyProgramSignupPoints()
Link
getLoyaltyProgramBaseCost()
Link
bool
useReturnCenter()
Link
getUseBatch()
Link
Does the store use batch/lot numbers? The packing slip (printed_invoice.html) gates
the batch lines on it, so it MUST be here — otherwise those lines are dropped,
and the store owner gets a "Missing method" notice.
float
getReturnShippingPrice($country_id = null)
Link
Returns the return shipping price incl. VAT
@param int $country_id The country ID (optional)
float
getReturnShippingVat($shipping_price, $country_id = null)
Link
Calculates the VAT on return shipping
@param float $shipping_price The shipping price excl. VAT
@param int $country_id The country ID (optional)
bool
getReturnShippingVatFree()
Link
bool
getReturnExchangeInstantPayment()
Link
Does the customer pay the price difference right away in the exchange flow (#5481, return_exchange_instant_payment)?
Otherwise, for a more expensive exchange, the customer gets a payment link for the full new product, and the return's
value is refunded to the card (OrderReturn::approve()). The themes choose the text on
the exchange page and in the email return_exchange_received.html based on it.
getReturnShipping()
Link
The return shipping the store has chosen (Webshop → Returns), as SafeShipping, so getCost() is the
price the return center deducts (return.php), in the order's currency (Countries, #1363). Previously it was the
raw Shipping object, whose getCost() was the price field in the store's currency.
getLoyaltyProgramMinDiscount()
Link
getLoyaltyProgramMinPoints()
Link
getLoyaltyProgramMaxDiscount()
Link
getLoyaltyProgramBaseExpires()
Link
getTerms()
Link
getCountrySites()
Link
The store's countries for a language or country selector (Countries, #1363). One element per active country
plus the main country, each with language (e.g. sv), language_name (e.g. Svenska), label (the language's
name, with the country code when two countries share a language), hreflang (sv-SE), code (SE), country
(the country's name), url (the page the customer is on, in that country), and current. Empty list for stores without
countries or with only one active. Use the hreflang attribute on the link, so the store does not
move the link into the country the customer is in.
getLanguageCode()
Link
The language code the page is shown in (e.g. da or sv), for . Without countries, the store's language.
getFavicon()
Link
bool
getUseCalculatedUnitPrice()
Link
getLatestProductReviews($limit = 10)
Link
Returns the latest product reviews
@param int $limit Maximum number of reviews (default: 10)
getLanguage()
Link
getStockLocations()
Link
getDefaultStockLocation()
Link
getShippingsByTag($tag)
Link
getAllShippingCount()
Link
Number of shipping methods the store has in total — WITHOUT country, Burd, and weight filtering (but in a country
under Countries, only those the country offers).

getShippings() filters on $_SESSION['del']['country_id'], i.e. the country that was last
SUBMITTED. On a compact checkout (shipping inline on /address), this meant the theme
decided the page's layout based on stale session state: if the customer changed country in
the dropdown without submitting, the list was not recalculated, and the page showed the foreign
shipping method under a Danish country.

This counter, on the other hand, answers "does the store have more than one option at all?", which does not
depend on the session. The themes use it as a gate, so a store with several shipping methods
always sends the customer via /shipping — that page is rendered AFTER the address POST, where the country
is fresh.

Deliberately a counter and not a list: a theme could render an unfiltered list as
radio buttons, and then the customer could choose a method that does not apply to their country.
setup_address.php only corrects the method when the COUNTRY changes, so it would not be caught.

The base filter (is_removed = 0) is the same one getShippings() builds on.
*
useInternalNewsletter()
Link

SafeWishlist

Handles customers' wishlists

Link
int
getWishlistId()
Link
string
getName()
Link
string
getDescription()
Link
string
getRemoteUrl()
Link
array
getWishlistProducts()
Link
string
getCreated()
Link
string
getStatus()
Link
string
getEditUrl()
Link
int
getProductCount()
Link

SafeWishlistProduct

Handles products on wishlists

Link
getProduct()
Link
int
getWishlistProductId()
Link
getAmount()
Link
getComments()
Link
getAttributeValueId()
Link
getAttributeId()
Link
getVariantName()
Link
getVariantValue()
Link

Need help with the API?

Our support team is happy to help you get started with template development