segment-boneyard / analytics-magento

[DEPRECATED] The hassle-free way to integrate analytics into any Magento store.
15 stars 19 forks source link

camel case properties #4

Closed ianstormtaylor closed 10 years ago

ianstormtaylor commented 10 years ago

For these types of properties we want to use camel case everywhere, since it will be rendered in Javascript and camel case is common there.

yaro-atwix commented 10 years ago

Could you bring an example based on the code below, please:

"id: '%s',
 incrementId: '%s',
 created: '%s',
 grand_total: '%s',
 subtotal: '%s',
 shipping_description: '%s',
 shipping: '%s',
 discount: '%s',
 tax: '%s',
 "
ianstormtaylor commented 10 years ago

Sure thing. Here's what those should end up looking like in Javascript:

{
  id: '%s',
  created: '%s',
  total: '%s',
  subtotal: '%s',
  shippingDescription: '%s',
  shipping: '%s',
  discount: '%s',
  tax: '%s'
}

total is the field we use for the total amount instead "grand total", and then shippingDescription instead of shipping_description so that we keep everything camel case.