> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getSiteProperties(options: GetSitePropertiesOptions) # Method package: wixBusinessToolsV2 # Method menu location: wixBusinessToolsV2 --> siteProperties --> getSiteProperties # Method Link: https://dev.wix.com/docs/velo/apis/wix-business-tools-v2/site-properties/get-site-properties.md # Method Description: Retrieves a current snapshot of a site's properties. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get Site Properties (dashboard page code) ```javascript import { siteProperties } from 'wix-business-tools.v2'; import { elevate } from 'wix-auth'; export async function myGetSitePropertiesFunction() { try { const elevatedGetSiteProperties = elevate(siteProperties.getSiteProperties); const mySiteProperties = await elevatedGetSiteProperties(); console.log('Success! Site properties:', mySiteProperties); return mySiteProperties; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "properties": { * "address": { * "apartmentNumber": "", * "city": "Radlett", * "coordinates": { * "latitude": 51.6855755, * "longitude": -0.3241171999999999 * } * "country": "GB", * "googleFormattedAddress": "10 Watford Road, Radlett, UK", * "hint": { * "placement": "BEFORE", * "text": "Located on the ground floor" * }, * "isPhysical": true, * "state": "Greater London", * "street": "Watford Road", * "streetNumber": "10", * "zip": "WD7 8LD", * }, * "businessConfig": "UNKNOWN", * "businessName": "Kids Clothes For You", * "businessSchedule": { * "periods": [ * { * "closeDay": "MONDAY", * "closeTime": "18:00", * "openDay": "MONDAY", * "openTime": "08:00" * }, * { * "closeDay": "TUESDAY", * "closeTime": "18:00", * "openDay": "TUESDAY", * "openTime": "08:00" * }, * { * "closeDay": "WEDNESDAY", * "closeTime": "18:00", * "openDay": "WEDNESDAY", * "openTime": "08:00" * }, * { * "closeDay": "THURSDAY", * "closeTime": "18:00", * "openDay": "THURSDAY", * "openTime": "08:00" * }, * { * "closeDay": "FRIDAY", * "closeTime": "18:00", * "openDay": "FRIDAY", * "openTime": "08:00" * } * ], * "specialHourPeriod": [ * { * "comment": "Half price in the lead up to Christmas!", * "endDate": "2023-12-24T23:59:00Z", * "isClosed": false, * "startDate": "2023-12-01T00:00:00Z" * } * ] * }, * "categories": { * "businessTermId": "38194ba8-1218-431c-a007-09c26c75ee0d" * "primary": "other", * "secondary": [ * "Local Business" * ], * }, * "consentPolicy": { * "advertising": true, * "analytics": true, * "dataToThirdParty": true, * "essential": true, * "functional": true * }, * "description": "Clothes for little people, for a little price!", * "email": "kidsclothes@example.com", * "fax": "011-44-20-12345678", * "language": "en", * "locale": { * "languageCode": "en", * "country": "GB" * }, * "logo": "a8a52b_bf5596e614d8484e9f1d429ac256e1ad~mv2.jpeg", * "paymentCurrency": "GBP", * "phone": "0208 123 4569", * "siteDisplayName": "Business Tools", * "timeZone": "Europe/London", * "trackClicksAnalytics": false * }, * "version": "60" * } */ ``` ## Get Site Properties (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { siteProperties } from 'wix-business-tools.v2'; import { elevate } from 'wix-auth'; export const myGetSitePropertiesFunction = webMethod(Permissions.Anyone, async () => { try { const elevatedGetSiteProperties = elevate(siteProperties.getSiteProperties); const mySiteProperties = await elevatedGetSiteProperties(); console.log('Success! Site properties:', mySiteProperties); return mySiteProperties; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "properties": { * "address": { * "apartmentNumber": "", * "city": "Radlett", * "coordinates": { * "latitude": 51.6855755, * "longitude": -0.3241171999999999 * } * "country": "GB", * "googleFormattedAddress": "10 Watford Road, Radlett, UK", * "hint": { * "placement": "BEFORE", * "text": "Located on the ground floor" * }, * "isPhysical": true, * "state": "Greater London", * "street": "Watford Road", * "streetNumber": "10", * "zip": "WD7 8LD", * }, * "businessConfig": "UNKNOWN", * "businessName": "Kids Clothes For You", * "businessSchedule": { * "periods": [ * { * "closeDay": "MONDAY", * "closeTime": "18:00", * "openDay": "MONDAY", * "openTime": "08:00" * }, * { * "closeDay": "TUESDAY", * "closeTime": "18:00", * "openDay": "TUESDAY", * "openTime": "08:00" * }, * { * "closeDay": "WEDNESDAY", * "closeTime": "18:00", * "openDay": "WEDNESDAY", * "openTime": "08:00" * }, * { * "closeDay": "THURSDAY", * "closeTime": "18:00", * "openDay": "THURSDAY", * "openTime": "08:00" * }, * { * "closeDay": "FRIDAY", * "closeTime": "18:00", * "openDay": "FRIDAY", * "openTime": "08:00" * } * ], * "specialHourPeriod": [ * { * "comment": "Half price in the lead up to Christmas!", * "endDate": "2023-12-24T23:59:00Z", * "isClosed": false, * "startDate": "2023-12-01T00:00:00Z" * } * ] * }, * "categories": { * "businessTermId": "38194ba8-1218-431c-a007-09c26c75ee0d" * "primary": "other", * "secondary": [ * "Local Business" * ], * }, * "consentPolicy": { * "advertising": true, * "analytics": true, * "dataToThirdParty": true, * "essential": true, * "functional": true * }, * "description": "Clothes for little people, for a little price!", * "email": "kidsclothes@example.com", * "fax": "011-44-20-12345678", * "language": "en", * "locale": { * "languageCode": "en", * "country": "GB" * }, * "logo": "a8a52b_bf5596e614d8484e9f1d429ac256e1ad~mv2.jpeg", * "paymentCurrency": "GBP", * "phone": "0208 123 4569", * "siteDisplayName": "Business Tools", * "timeZone": "Europe/London", * "trackClicksAnalytics": false * }, * "version": "60" * } */ ``` ## Get Business Name and Description from Site Properties ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { siteProperties } from 'wix-business-tools.v2'; import { elevate } from 'wix-auth'; /* Sample options value: * { * fields: [ * 'businessName', * 'description' * ] * } */ export const myGetSitePropertiesFunction = webMethod(Permissions.Anyone, async (options) => { try { const elevatedGetSiteProperties = elevate(siteProperties.getSiteProperties); const mySiteProperties = await elevatedGetSiteProperties(options); console.log('Success! Site properties:', mySiteProperties); return mySiteProperties; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "properties": { * "businessName": "Kids Clothes For You", * "description": "Clothes for little people, for a little price!", * "trackClicksAnalytics": false * }, * "version": "60" * } */ ``` ## getSiteProperties() with choice of fields ```javascript /********************************************* * Backend code - get-site-properties.web.js * ********************************************/ import { Permissions, webMethod } from 'wix-web-module'; import { siteProperties } from 'wix-business-tools.v2'; import { elevate } from 'wix-auth'; export const displaySiteProperties = webMethod(Permissions.Anyone, async (options) => { try { const elevatedGetSiteProperties = elevate(siteProperties.getSiteProperties); const mySiteProperties = await elevatedGetSiteProperties(options); console.log('Success! Site properties:', mySiteProperties); return mySiteProperties; } catch (error) { console.error(error); throw new Error(error); } }); /************* * Page code * ************/ import { displaySiteProperties } from 'backend/get-site-properties.web'; $w.onReady(() => { $w('#submit').onClick(async () => { const checkedFields = getFields(); if (!checkedFields.length) { $w('#chooseAFieldsMsg').show(); setTimeout(() => { $w('#chooseAFieldsMsg').hide(); }, 10000); } else { const fieldOptions = { fields: checkedFields } const mySiteProperties = await displaySiteProperties(fieldOptions); console.log('Chosen site properties are being displayed on the page:', mySiteProperties); $w('#siteProperties').text = mySiteProperties; } }); }); function getFields() { const checkedFields = []; if ($w('#address').checked) { checkedFields.push('address'); } if ($w('#businessConfig').checked) { checkedFields.push('businessConfig'); } if ($w('#businessSchedule').checked) { checkedFields.push('businessSchedule'); } if ($w('#categories').checked) { checkedFields.push('categories'); } if ($w('#consentPolicy').checked) { checkedFields.push('consentPolicy'); } if ($w('#description').checked) { checkedFields.push('description'); } if ($w('#email').checked) { checkedFields.push('email'); } if ($w('#fax').checked) { checkedFields.push('fax'); } if ($w('#language').checked) { checkedFields.push('language'); } if ($w('#locale').checked) { checkedFields.push('locale'); } if ($w('#logo').checked) { checkedFields.push('logo'); } if ($w('#paymentCurrency').checked) { checkedFields.push('paymentCurrency'); } if ($w('#phone').checked) { checkedFields.push('phone'); } if ($w('#siteDisplayName').checked) { checkedFields.push('siteDisplayName'); } if ($w('#timeZone').checked) { checkedFields.push('timeZone'); } if ($w('#trackClicksAnalytics').checked) { checkedFields.push('trackClicksAnalytics'); } return checkedFields; } ``` ---