-
Notifications
You must be signed in to change notification settings - Fork 58
Sharp_Edges
We'll try and keep this short and to the point.
This is a guide of places other people have gotten stuck, and how to avoid getting stuck, or at least how to get unstuck.
There is no particular order to this guide, if you skim it - you'll miss detail.
Using Quickstart
For some reason a lot of people skip the quickstart tutorial, or steps in the quickstart. About 95% of the questions we are routinely asked are addressed in quickstart. The quickstart tutorial is ALWAYS based on the latest SDK from Github.
Uh Oh! It appears you are not using the Asynchronous version of Google Analytics. It is required to use this checkout.
add
var _gaq = {};
the code above, insert into the script tag should be enough to trick the checkout extension into thinking you have google analytics installed. HINT: It's best to NOT use production google analytics when developing since that will create bad statistics for the site owner.
Uh Oh! Something went wrong with our app. We apologize for any inconvenience. (err: convertSessionToOrder extension did not pass init)
In the quickstart.html file you'll find a reference to a checkout extension.
Depending on the stores business rules (ex: do customers need to login) a different checkout extension may be required.
The checkout extension referenced by the app must match the business rules estabished by the store.
To fix this simply uncomment one checkout extension and comment out the other. Ex:
// {"namespace":"convertSessionToOrder","filename":"extensions/checkout_passive.js"}, /* checkout_passive does not require buyer to login */
{"namespace":"convertSessionToOrder","filename":"extensions/checkout_nice.js"}, /* checkout_nice prompts buyer to login */Even if you've done a project previously, the project will need to be upgraded to the latest build to pass quality-assurance testing.
The qa people enjoy nothing more than saying "wrong SDK version" and sending the whole thing back.
If you're making changes to an existing project you should always upgrade that to the latest SDK.
We strive to provide excellent forward compatibility, check the gitHub commit log to see what's changed.
In the 'examples' folder in the SDK there is an app called 'site-analyzer'. When it loads it will prompt you for the config.js file URL and then it will let you browse the data in the store. This is great for seeing if a category doesn't exist, or viewing which fields are in a product. So let's just say - it is absolutely possible the person who wrote the build notes made a typo and typed $best_sellers instead of $bestsellers as the source. Don't spend an hour trying to figure out why you're code isn't working - instead fire up site analyzer and see if the data that you're looking for even exists and is structured properly.
In every store there should be a product entitled "TEST", it should be purchasable and have unlimited inventory. It probably has lorem ipsum in the data, but it should be representative of a "standard product" with all fields configured. While TEST is the de-facto standard, there MUST always be one at least ONE reference products for testing identified by the build notes.
Use relative images, leaving off the leading slash (/). This will make local testing easier and once deployed, the base tag will handle the rest.
When running the app from a hosting server delegate a subdomain, don't run it within a subdirectory. If you're running the app from a directory on the local disk the browser will automatically chroot to the directory you ran it from.
The URL rewriting can be a bit of a pain to work around, at some point we'll make this a parameter that can be turned off for development. Normally a shopping app will be deployed into a virtual hosted environment with an SEO compatibility layer.
/product/productid/this_is_the_product_title.html
/category/full.path.to.category
The SEO compatibility layer will dump an SEO friendly, very lightweight HTML page for a search engine and provide enough code to bootstrap the application and tell it which view to display. This is approach allows developers to build very fast highly interactive applications, and also maintain compatibility for search engine optimization, cost-per-click advertising, google sitemap, etc. The seo layer will also add the meta tags, so you should NOT hard code any into the view.
This usually happens when people skip the quickstart. The most common cause is that homepage is likely embedded in the view, instead of being loaded within homepageTemplate