This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
SETUP: | |
This must be in an "Orders" workflow | |
Inputs: hs_order_name = Name | |
Output: shipping_street_address (String) | |
You will need a BigCommerce API key (stored as BIGCOMMERCE_KEY) with the ability to read orders/order addresses here: https://support.bigcommerce.com/s/article/Store-API-Accounts?language=en_US#creating | |
You will also need your store hash (stored as STORE_HASH secret) - directions on getting this here: https://www.atensoftware.com/p90.php?q=333 | |
*/ | |
const axios = require('axios'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set SAMPLE_TEMPLATE_DATA = { | |
"hubspot_base_url" : "https://api.hubapi.com", | |
"is_preview": "true", | |
"quote" : { | |
"hubspot_owner_id": "1", | |
"hs_all_owner_ids": "1", | |
"hs_created_by_user_id": "1", | |
"hs_updated_by_user_id": "1", | |
"hs_lastmodifieddate": "1/1/20", | |
"hubspot_owner_assigneddate": "1/1/20", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- see comments for modifications --> | |
{% from '../../imports/mock_data.html' import SAMPLE_TEMPLATE_DATA as mock_data %} | |
{% set QUOTE = template_data.quote || mock_data.quote %} | |
{% set CURRENCY = QUOTE.hs_currency || 'USD' %} | |
{% set LOCALE = QUOTE.hs_locale || 'en-US' %} | |
{% set LANGUAGE = QUOTE.hs_language || 'en' %} | |
{% set ASSOCIATED_OBJECTS = QUOTE.associated_objects %} | |
{% set LINE_ITEMS = ASSOCIATED_OBJECTS.line_items_by_start_date ? ASSOCIATED_OBJECTS.line_items_by_start_date.PRESENT : ASSOCIATED_OBJECTS.line_items %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Dropdown Option Area | |
- before adding a new section, you need to add a new option to the "Prebuilt Modules" field on the right side | |
- keep in mind that the "content" section may require HTML / styling, so it may be worth tinkering with in the module tester on "custom" setting before adding new options to the dropdown | |
--> | |
{% if module.prebuilt_modules == "option_a" %} | |
{% set custom_values = { | |
'title': 'Title A', | |
'button_image': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div itemscope itemtype="http://schema.org/Organization"> | |
<meta itemprop="name" content="{{ module.organization_name }}" /> | |
<meta itemprop="logo" content="{{ module.small_logo }}" /> | |
</div> | |
<div itemscope itemtype="http://schema.org/DiscountOffer"> | |
<meta itemprop="description" content="{{ module.discount_amount }}" /> | |
<meta itemprop="discountCode" content="{{ module.discount_code }}" /> | |
<meta itemprop="availabilityStarts" content="{{ module.deal_starts|datetimeformat('%Y-%m-%dT%H:%M:%S%z') }}" /> | |
<meta itemprop="availabilityEnds" content="{{ module.deal_ends|datetimeformat('%Y-%m-%dT%H:%M:%S%z') }}" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Answer the questions below to get a good idea of the cost to clean your house each month in the Boston area (disclaimer below)</p> | |
<script> | |
/* | |
List of elements | |
options for those elements: | |
what_size_is_your_home_ | |
0 = Studio | |
1 = 1 Bedroom | |
2 = 2 Bedroom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- note: json is unminified for readability --> | |
<!-- I'm using this section to print out the HubDB for the podcast on the page so I can easily access it by blog ID. | |
I would use one table per podcast, as it seems rare you'd get much past a few hundred rows. --> | |
<div id="json-object" style="display:none;"> | |
[{ | |
{% for row in hubdb_table_rows(677960) %} | |
"{{ row.blog_id }}": { | |
"soundcloud_track_number": "{{ row.soundcloud_track_number }}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.main = (event, callback) => { | |
// get current time in unix | |
const now = new Date(); | |
const hourOfDayInUTC = now.getUTCHours(); | |
const day = now.getDay(); // use this to check whether it's the weekend | |
// prep response object | |
const responseJson = { | |
responseExpected: false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function() { | |
// verbose: get current unix datetime - outputs in MS | |
var dateNow = Date.now(); | |
// if the "cookie" already exists | |
if (localStorage.getItem('viewCounter') !== null) { | |
// shorthand for viewCounter | |
var viewCounter = JSON.parse(localStorage.getItem('viewCounter')); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/books/:id | |
Method Details | |
HTTP Methods: GET | |
Response Format: json | |
Example GET URL: | |
api.example.com/books/6 | |
Example response (data is filler, reflective of type only): |