Giter Site home page Giter Site logo

adammendoza / responsive_checkout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ultracart/responsive_checkout

0.0 2.0 0.0 1.5 MB

An UltraCart Javascript checkout designed to render well on all displays, especially mobile devices.

CSS 5.85% HTML 4.31% JavaScript 85.64% PHP 1.90% Handlebars 2.30%

responsive_checkout's Introduction

Most people find this demo helpful:

https://secure.ultracart.com/merchant/integrationcenter/checkoutapi_v3/demo1.html

It gives examples of the REST API calls used in the responsive checkout.

responsive_checkout (version 1.1)

An UltraCart Javascript checkout designed to render well on all displays, especially mobile devices.

This checkout using the UltraCart REST API. The documentation for the REST API is found on docs.ultracart.com. http://docs.ultracart.com/display/ucdoc/UltraCart+REST+Checkout+API

Change Log:


Version 1.1 (8/1/2014) backbone cart implementation:

  • Updated all javascript libraries to their latest versions.
  • Moved all handlebar templates into separate files and pre-compile them. The makes development an extra step, but solves strange errors we were seeing with the latest browsers doing aggressive javascript optimization and causing strange random errors with the handlebar templates.
  • replaced underscore.js with lodash.js

If you aren't using the precompiled handlebar templates, you should upgrade to avoid any issues with the latest round of browsers. See https://github.com/UltraCart/responsive_checkout/blob/master/cart_implementations/backbone/scripts/handlebars/readme_precompiling.txt for tips on setting up the precompiler using nodejs.

Quick Start:


  • Download the source code
  • The item.html is an item page. It was designed to be stand-alone (except for a few graphics). It's a very simple implementation since the item pages vary so.
  • There are going to be many reference implementations of shopping carts. Currently, there is only one: cart_implementations/backbone. It is built using backbone.js and handlebars.js. To use it, you'll want to copy it forward a few directories (your choice).
  • Install it in your web server. There are several versions of rest_proxy.php to allow the different pages to run standalone. You'll probably want to just use one, which may require you to search a modify a few references to it.
  • Test rest_proxy.php.
    Test #1: If you call it directly from the web browser, you should receive back this response: "UltraCart rest proxy script called incorrectly. _url query parameter is required. Test #2: adjust your url to call this:
   rest_proxy.php?_url=/rest/cart

you should receive back this response: "Missing Merchant Id." Test #3: call this:

   rest_proxy.php?_url=/rest/cart&_mid=DEMO 

you should receive back the json for an empty cart.

  • Edit cart.html Scroll to the bottom and look for a script tag. Change the following:

    merchantId: change this to your Merchant ID.

    continueShoppingUrl: change this to whatever your main product catalog or intro page is.

    accounting.settings: If you are not using USD currency, adjust this appropriately.

Architecture


Everything is fairly standard to a backbone.js/handlebars.js javascript application, with the exception of the Cart model. We created a mix between the DeepModel and a Nested Model. Had we used the standard backbone.js, we would have lost fine-grained management of 1) nested objects such as the Cart.CustomerProfile object and 2) collection properties such as items. We really wanted row level event notification for the items. So, within https://github.com/UltraCart/responsive_checkout/blob/master/scripts/backbone-uc-common-functions-1.3.js you'll see the models defined to give us detailed control of every part of the Cart object.

With a normal backbone.js model, all properties are access via the model.get('property') method. With our model, we follow this convention, but we also map the items as a direct property of the cart.

So, you'll see within the code app.data.cart.get('shipToFirstName') as well as app.data.cart.items where it lives as a backbone collection of CartItems instead of a normal array of CartItems. This allows for event binding, etc.

Just a head's up.

Release Notes:


11/01/2013 We're releasing this software as version 1.0. We've added the login/logout/register functionality, along with fields to display all customer information. Numerous bugs were fixed with the latest commit.

responsive_checkout's People

Contributors

perrytew avatar macbookandrew avatar johnsontb avatar yagerrealty avatar

Watchers

Adam J. Mendoza avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.