Why
When using Fotomoto in "API mode", Fotomoto doesn't automatically insert the Buy Buttons as it normally would in "Automatic mode", so you need to insert them yourself. You can do this simply by calling the showToolbar function for the image, but if you prefer to insert your own custom Buy Buttons, you should first confirm that the seller has not disabled the product associated with the button. For example, if the seller has disabled Cards, then you should not show a "Buy Cards" button.
How
In order to determine which products are enabled and disabled, use the FOTOMOTO.API.getImageProducts(img ID,callbackFunction) function. You can read more about it on the Fotomoto API Function reference page.
getImageProducts returns a hash with a product code as the key, and enabled/disabled as a boolean value, like this:
Image Products: {"100":true,"101":true,"102":true,"103":false,"104":false,"105":false,"200":true,"300":false,"400":false,"500":false}In this example, Prints and Cards are enabled while eCards, Files and Sharing are disabled, so you only want to display the Buy Buttons for prints and cards.
Here are the product codes:
FOTOMOTO.API.PRINT = 100 (Any Print)
FOTOMOTO.API.PREMIUM = 101
FOTOMOTO.API.FINEART = 102
FOTOMOTO.API.CANVAS = 103
FOTOMOTO.API.FRAMED = 104
FOTOMOTO.API.STICKY = 105
FOTOMOTO.API.ECARD = 200
FOTOMOTO.API.CARD = 300
FOTOMOTO.API.FILE = 400 (Digital Download)
FOTOMOTO.API.SHARE = 500The API function calls to display the buy prints and buy cards pages of our shopping cart Widget are
FOTOMOTO.API.showWindow(FOTOMOTO.API.PRINT, "mainPhoto")and
FOTOMOTO.API.showWindow(FOTOMOTO.API.ECARD, "mainPhoto")respectively, where the first parameter is simply the product constant from the list above and mainPhoto is the ID of the image in question.