Added support for buy button in javascript