local_shipping Car Shipping checklist_rtl My Cars volunteer_activism Services question_mark FAQ conciergeContact Us

Pricing Widget — Callback Demo

Live Preview with Callback

This demo shows how a partner can use the data-callback attribute to receive quote data when the user clicks "Continue". Try getting a quote and clicking Continue to see the alert with all available values.

Embed Code with Callback

The data-callback attribute specifies a global function that receives the quote data. The "Continue" button appears after a price is shown.

<div id="ch247-quote" data-callback="onQuoteReady"></div> <script src="https://carhauler247.com/js/ch247-widget.js"></script> <script> function onQuoteReady(data) { // data.fromZip — pickup ZIP code // data.toZip — delivery ZIP code // data.vehicleType — sedan, suv, pickup, van, etc. // data.price — price in dollars (integer) // data.distance — distance in miles (integer) // data.estimatedDays — delivery estimate (string) // data.fromCity — pickup city // data.fromState — pickup state // data.toCity — delivery city // data.toState — delivery state alert( 'Quote Callback Data:\n\n' + 'From: ' + data.fromCity + ', ' + data.fromState + ' ' + data.fromZip + '\n' + 'To: ' + data.toCity + ', ' + data.toState + ' ' + data.toZip + '\n' + 'Vehicle: ' + data.vehicleType + '\n' + 'Price: $' + data.price.toLocaleString() + '\n' + 'Distance: ' + data.distance.toLocaleString() + ' miles\n' + 'Estimated: ' + data.estimatedDays ); } </script>

Callback Data Fields

Field Type Example
fromZipstring"90001"
toZipstring"10001"
vehicleTypestring"suv"
priceinteger1250
distanceinteger2775
estimatedDaysstring"2775 miles, 4 days and 6 hours drive"
fromCitystring"Los Angeles"
fromStatestring"CA"
toCitystring"New York"
toStatestring"NY"