Skip to content

Instantly share code, notes, and snippets.

Avatar

Brennan Heyde bheyde

View GitHub Profile
@bheyde
bheyde / quote_form
Created Jan 5, 2019
Customer Quote Form
View 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 Aug 14, 2018
Sample List_Load_Query Response
View sample_list_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 },
View ondemandcolumns
{
"name": "ondemandcolumns",
"value": [ "field", "field", "field", ... ]
}
View ondemandcolumns
{
"name": "ondemandcolumns",
"value": [ "field", "field", "field", ... ]
}
@bheyde
bheyde / parenthentical_comparison
Created Aug 14, 2018
Parenthetical comparisons can be accomplished using the "SUBWHERE" operator and special field names "search", "search_AND" and "search_OR"
View parenthentical_comparison
"Filter":
[
{
"name": "search",
"value":
[
{
"field": "ship_lname",
"operator": "EQ",
"value": "Burchmore"
@bheyde
bheyde / json_success
Created Aug 14, 2018
Successful calls return their data as a JSON structure in the following format:
View json_success
{
"success": true,
"data": call-specific data
}
View xml_export.xml
<?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>
View bronto.js
<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>
View customfield.js
<a href="&mvt:product:customfield_values:customfields:user_manual_01;">User
Manual</a>
@bheyde
bheyde / order_export.json
Created Jul 20, 2017
JSON Export Template
View order_export.json
<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":
[