Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function() {
$(document).on('click', "[href='#email-me-quote']", function(e) {
e.preventDefault();
});
});
@cox-auto-inc-codeweavers
cox-auto-inc-codeweavers / PHP_cURLExample.php
Last active May 4, 2016 12:24
PHP cURL Stock Vehicle Service Example
<?php
// our provided uri
$uri = "https://services.codeweavers.net/public/v2/stock";
// build the JSON array
$data = array(
"Credentials" => array(
"username" => "kurts dealer",
"password" => "kh"
),
@cox-auto-inc-codeweavers
cox-auto-inc-codeweavers / Passing Search Queries - JS Functions
Last active August 29, 2015 14:14
Passing Search Queries via JavaScript cookies
document.getElementById("call-to-action").onclick = function()
{
setCookie('financeMileage', document.getElementById('finance_mileage').value, 3);
setCookie('financeDeposit', document.getElementById('finance_deposit').value, 3);
setCookie('financeTerm', document.getElementById('finance_term').value, 3);
};
function setCookie(name, value, expiryInDays)
{
var today = new Date();
/* Quote with Two payments */
"Payments":[
{
"Amount":255.94,
"NumberOfPayments":29
},
{
"Amount":400.94,
"NumberOfPayments":1
}
technicalSpecification: {
manufacturer: 'BMW',
description: '3 Series Diesel Touring 316d Sport 5dr',
model: '3 Series',
variant: 'Diesel Touring',
derivative: '316d Sport 5dr',
bodyStyle: 'hatchback',
colour: 'Mahogany',
doors: 5,
transmission: 'manual',
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="https://services.codeweavers.net/v2/script/FinancePlugin?key=YOUR_API_KEY_HERE"></script>
<script type='text/javascript'>
function loadPlugin() {
codeweavers.main({
pluginContentDivId: 'PLUGIN_DIV_ID',
vehicle: {
type: 'car',
formValues: {
emailAddress: 'cwtest@codeweavers.net',
title: 'Mr',
forename: 'Code',
surname: 'Weaver'
}
{
formValues: { },
onSuccess: function (message) { },
onError: function (message) { }
}
<div class="cw-plugin">
<div id="cw-vehicle-injection"></div>
<div id="cw-finance-options">
<div id="cw-form-container" class="cw-finance-options clearfix">
<div class="cw-calculation-form-row">
<label for="cw-annual-mileage">Expected Annual Mileage</label>
<select id="cw-annual-mileage" class="cw-element">
<option selected="selected" value="10000">10000</option>
<option value="11000">11000</option>
</select>