The pop-up is also suitable if you have 0 as a minimum price because it will give the visitor the option to go directly to the downloads.
Let’s see it in action, first we’ll add a button that will be our buy button:
<button id="buy_button">Buy My Game!</button>
Next, we’ll add something like the following, updating the
game to be your username and the slug from the game you wish to sell.
Now when someone clicks on the button a pop-up will appear giving the visitor an opportunity to purchase your game.
Try it out:
Attaches a buy button to a DOM element on the page.
element is a DOM element. (If you’re using jQuery make sure you pass in the
DOM element and not the jQuery object)
options is an object of options:
- user: Required The username of the game seller
- game: Required The slug of the game, the slug is the name of the game
from the URL of the game. For example, if your game’s URL is
http://leafo.itch.io/x-moon then the slug is
- with: The width of the pop-up, defaults to 650
- height: The width of the pop-up, defaults to 400