Web Address of Purchase Page?

ChockstoneChockstone Registered Users Posts: 37 Big grins
edited August 23, 2009 in SmugMug Pro Sales Support
Can anyone tell me the URL (web address) that will take the user directly to the photo purchase page for a given photo? ie, just like they had been looking at one of my galleries and clicked the "buy - this photo" menu option.

Thanks!
___________________________
Michael Boniwell
http://www.chockstonephotos.com
http://chockstone.smugmug.com

Comments

  • photokandyphotokandy Registered Users Posts: 269 Major grins
    edited August 23, 2009
    Chockstone wrote:
    Can anyone tell me the URL (web address) that will take the user directly to the photo purchase page for a given photo? ie, just like they had been looking at one of my galleries and clicked the "buy - this photo" menu option.

    Thanks!

    Boy, you came up with a hard one. Took me a while to figure it out, but it will involve some customization to your site.

    Add the following to your bottom javascript:
    function addToCart ()
    {
    	if (window.location.toString().indexOf("addToCart=yes") > -1 )
    	{
    		var uri = window.location.toString();
    		var hashLocation = uri.indexOf ("#");
                    if (hashLocation > -1)
                    {
      		    var qmLocation = uri.indexOf ("?");
    		    var img = uri.substring(hashLocation+1, qmLocation);
    		    var imgSplit = img.split ("_");
    		    addCartSingle(imgSplit[0],imgSplit[1]);
                    }
    	}
    }
    
    YE.onDOMReady ( addToCart );
    
    

    Now, when you link to an image in a gallery, add "?addToCart=yes" to the end. The cart should appear as the gallery and image are loading.

    For example:

    http://sm.photokandy.com/Album/Looking-Up/Clouds-and-Skies/9278082_aLYR3#624136900_FSXPN?addToCart=yes

    It should pop up the cart on my site with an option to buy a black and white sunset image. However, if you only use a link without the "?addToCart=yes" added, it should NOT display the cart, like so:

    http://sm.photokandy.com/Album/Looking-Up/Clouds-and-Skies/9278082_aLYR3#624136900_FSXPN

    Note: I have NO idea if this is even at all supported by SM, or if it will work flawlessly for every kind of image or URL imaginable. However, it does at least "appear" to work for me. I also have NO idea if it will break any of your existing customizations - it shouldn't, and doesn't any of mine, but I can't say for sure if it will break any of yours.

    Second Note: You MUST specify a valid image after the # mark. Otherwise the script is going to crash and burn if you ever add "?addToCart=yes" to the end of a SM url that doesn't involve a valid image. Fair warning if you try it... ;-)
    ~ Kerri, photoKandy Studios ( Facebook | Twitter )

    Need customization services? View our packages or see our templates.

    Note: I won't be offended if you edit my photo and repost it on dgrin -- I'm always open to new interpretations
    and ideas, and any helpful hints, tips, and/or critiques are welcome. Just don't post the edit anywhere else
    but dgrin, please.

    My Gear List
  • ChockstoneChockstone Registered Users Posts: 37 Big grins
    edited August 23, 2009
    photokandy wrote:
    Boy, you came up with a hard one. Took me a while to figure it out, but it will involve some customization to your site.

    Awesome! I've asked this question several times over the years and finally got a solution.

    I can now send people directly from my (non-smug) website to the smugsmug purchase page for the photo they are interested in. Works brilliantly.

    Thanks again!
    ___________________________
    Michael Boniwell
    http://www.chockstonephotos.com
    http://chockstone.smugmug.com
Sign In or Register to comment.