Skip to content

Instantly share code, notes, and snippets.

View bheyde's full-sized avatar

Brennan Heyde bheyde

View GitHub Profile
@bheyde
bheyde / quote_form
Created January 5, 2019 00:30
Customer Quote Form
<mvt:if expr="l.settings:messages:error_message_count">
<div class="error-message">
<mvt:foreach iterator="error" array="messages:error_messages">
&mvt:error;
</mvt:foreach>
</div>
</mvt:if>
<mvt:if expr="l.settings:messages:information_message_count">
<div class="information-message">
<mvt:foreach iterator="message" array="messages:information_messages">
@bheyde
bheyde / sample_list_query_response
Created August 14, 2018 17:48
Sample List_Load_Query Response
{
"success": true,
"data":
{
"total_count": <numeric total count of records matching any input filters>,
"start_offset": <numeric starting offset of the records>,
"data":
[
{ record },
{ record },
@bheyde
bheyde / ondemandcolumns
Created August 14, 2018 17:35
Ondemandcolumns
{
"name": "ondemandcolumns",
"value": [ "field", "field", "field", ... ]
}
@bheyde
bheyde / ondemandcolumns
Created August 14, 2018 17:35
Ondemandcolumns
{
"name": "ondemandcolumns",
"value": [ "field", "field", "field", ... ]
}
@bheyde
bheyde / parenthentical_comparison
Created August 14, 2018 17:26
Parenthetical comparisons can be accomplished using the "SUBWHERE" operator and special field names "search", "search_AND" and "search_OR"
"Filter":
[
{
"name": "search",
"value":
[
{
"field": "ship_lname",
"operator": "EQ",
"value": "Burchmore"
@bheyde
bheyde / json_success
Created August 14, 2018 15:56
Successful calls return their data as a JSON structure in the following format:
{
"success": true,
"data": call-specific data
}
@bheyde
bheyde / xml_export.xml
Created December 11, 2017 23:50
XML Template
<?xml version="1.0" encoding="utf-8"?>
<orders>
<mvt:foreach iterator="order" array="admin_order:orders">
<order>
<!--General Order Information -->
<order_date>&mvte:order:date;</order_date>
<order_id>&mvt:order:id;</order_id>
<order_status>&mvte:order:formatted_status;</order_status>
<batch_id>&mvt:order:batch_id;</batch_id>
@bheyde
bheyde / bronto.js
Created September 7, 2017 15:38
bronto
<mvt:comment>Bronto JSON Integration - Cart Data => only run after first item is added to cart or on invoicee page</mvt:comment>
<mvt:if expr="l.settings:global_minibasket:basketitemsonly_count GT 0 OR l.settings:page:code EQ 'INVC'">
<mvt:comment><!-- Variable setup --></mvt:comment>
<mvt:if expr="l.settings:page:code NE 'INVC'">
<mvt:comment><!-- Order item data --></mvt:comment>
<mvt:assign name="l.settings:orderData:subtotal" value="0" />
<mvt:assign name="l.settings:orderData:discounts" value="0" />
<mvt:assign name="l.settings:orderData:tax" value="0" />
<mvt:foreach iterator="item" array="global_minibasket:items">
<mvt:comment><!-- Order subtotal --></mvt:comment>
<a href="&mvt:product:customfield_values:customfields:user_manual_01;">User
Manual</a>
@bheyde
bheyde / order_export.json
Created July 20, 2017 23:44
JSON Export Template
<mvt:comment>
| Loop though all orders returned all new orders.
</mvt:comment>
{
<mvt:assign name="g.number_orders" value="miva_array_elements( l.settings:admin_order:orders )" />
"orders_returned": "&mvtj:global:number_orders;",
"orders":
[