Tell me more ×
SmugMug Stack Exchange is a question and answer site for SmugMug developers and end users. It's 100% free, no registration required.

I'm writing an app that has an option to show pictures from SmugMug on another site, I use smugmug.images.getURLs to get the image URL and link to it from the other site and everything just works.

I want to add a buy link to the photos displayed on that site, I do not want to write a shopping cart or anythng like that - I just want a link to SmugMug that will let customers buy prints.

The site the pictures are displayed on is under my full control, I can change anything in the html, css, javascript and even in the backend.

share|improve this question

2 Answers

You may not have to do this via the API. Check out the share button > get a link on any photo. In the photo links tab you can find the buy link like this: http://cmac.smugmug.com/buy/2504559_TrBCmb/131481399_ZnZmK/

and in the gallery links tab there's the batch buy link: http://cmac.smugmug.com/buy/2504559_TrBCmb/

2504559_TrBCmb is the gallery ID and gallery key. 131481399_ZnZmK is the image ID and image key. With the API you should be able to easily create such links for any gallery or photo. Note that I'm not familiar with the API and therefore won't try to go into details on how to do that.

share|improve this answer

The API does not include buy-links as of now, so your sole option would be to fake them. This approach is somewhat discouraged however, as it might break without warning if the good chaps decide to change something... That said, the formula to create them programmatically would be something like:

For single images, http://cmac.smugmug.com/buy/ALBUMID_ALBUMKEY/IMAGEID_IMAGEKEY/

For complete albums, http://cmac.smugmug.com/cart/batchadd/?url=ALBUMID_ALBUMKEY

That's how I do it anyway :) It does not seem to redirect, so you are not relying on the "brains" of SmugMug to interpret it too much...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.