Populating Attributes Help

General ShopSite user discussion

Populating Attributes Help

Postby vwdforums » Mon Dec 07, 2009 12:54 pm

I have a Javascript that a 3rd party company gave us so that they can track when sales are coming in for them from one of our clients website. They ask me to put the code in the shopping cart on the confirmation page. I did that. However, I don't know how to popluate the attributes. Here's a sample of the attributes part of the code.

// This is where you put information about which items were purchased
items: [
{
name: "",
sku: "",
quantity: "",
price: ""
},
{
name: "",
sku: "",
quantity: "",
price: ""
}
]
}

The instructions say the most important attribute for you will be the 'items' attribute, which is populated from the list of products that were sold to your customer. It is an array of hashes, where each hash can have a 'name', 'sku', 'quantity' and 'price' attribute. This can be easily
generated using any standard JSON encoder.

Does anyone know how to help me with this? It's not working correctly. I don't know what a JSON encoder is or how it works. I need to get this resolved ASAP. Thanks so much!
VWD
vwdforums
 
Posts: 44
Joined: Fri Jun 13, 2008 7:37 pm

Shopsite makes data available on confirmation page

Postby mjbrunelle » Tue Dec 08, 2009 5:38 am

If you look at the source of your confirmation page. You will see that ShopSite through the Javascript Extras outputs all this information into arrays.

Can you edit the Javascript from the third part to read these variables.

ie: ss_name[0]="product name here";

If you can't, you can use Javascript to produce the needed output in there reqeusted format.

MarkB
mjbrunelle
 
Posts: 147
Joined: Sun Jun 21, 2009 5:09 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 115 guests