Support » Plugin: NextGEN Custom Fields » [Plugin: NextGEN Custom Fields] custom fields/cart 66 /pay pal buttons

  • I think I may have inadvertently posted this on the wrong board initially, but I was wondering if the Custom Fields plugin will allow me to place either pay pal buy now buttons or Cart66 purchase button so that if folks are seeing the picture they can buy a print? Is this something that might be able to be coded if its not part of the custom fields functionality?

    Thanks in advance for any insight.


Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author shauno


    Just create a text extra field (long or short, doesn’t really matter), and paste the button’s embed code for each image.
    Then you can show the custom field as per the FAQ.

    That should do it. Let me know if you have any problems

    Im going to get into all this…if I use the NGN gallery image viewer option to display the gallery, so it gives me each of the images in that gallery as a thumbnail..can I add a title to EACH image in that image viewer display.

    I guess I’m having a hard time finding where I need to place the code to get a special field to appear with the thumbnail

    I’m starting to think I may not be smart enough for this


    Plugin Author shauno


    What exactly is the problem? This is the process:
    1) Capture a URL per image
    2) Display that URL for each image

    NGG Custom fields allows you to create an extra input to capture the URL per image. Can you get that working?
    Then you output that URL in the displaying of the image. Is this the problem?

    Have a look at this old thread. The info is a little dated, but should be more than enough to figure it out:

    Hey there, Thanks for bearing with me…

    For testing purposes, I have a page with a gallery on it and it has two pictures in it.

    I created a custom field called “purchase option”

    when I load the page, I see the two thumbnails on the page and when I click one of them the lightbox effect opens the picture up and I get the image description at the bottom above the image 1/2 text.

    I wanted to put the custom purchase field in line somewhere there, preferably off the the right.. I suppose I just needed to know what php template I am adding that custom field to, so when I assign a purchase short code to each image it will show up for each.

    I am still reading the FAQ and Forums…I do appreciate you taking the time.



    Plugin Author shauno


    You can’t reliably add info into the popup unfortunately. That requires hacking javascript files as they create the actual markup for the popups.

    shauno – Thanks for all the help. I can see by what your saying that my initial thought on my presentation is going to be a bit dicey to achieve. You mentioned custom hacking on the js….is this something that you are familiar with, or if not perhaps you know someone who does that kind of customization. Clearly this would be something customized and as such would be a paid engagement. Thanks again for your thoughts and your time.


    Plugin Author shauno


    So I finally made some time to check out the JS popups. If you are using the NGG defaults: the [nggallery id=x] shortcode, and you haven’t altered NGG options, you will be using the ‘Shutter’ effect.
    This by default takes what’s in the title attribute of the <a> surrounding the thumbnail images (line 42 of nextgen-gallery/view/gallery.php`) to show as the image caption.

    Simply change line 42 to:
    <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?><br /><?php echo $image->ngg_custom_fields["Your Field Name Here"]; ?>" <?php echo $image->thumbcode ?> >
    All that’s done is add a line break after the current caption, and add your custom field.

    [ Signature moderated. ]


    Thanks again, when I enter that code into line 42, essentially replacing: The line I had there:

    imageURL ?>” title=”Image Name:<?php echo $image->description ?>” <?php echo $image->thumbcode ?> >

    with the code you added, the gallery doesn’t display at all.

    I can see where it “should” what its supposed to do, but I am not sure why its breaking the image gallery: Im using pages to display one gallery each. using [nggallery id=1]

    Do you know any folks who can customize these pages so I can set these buttons in the custom fields. I’m totally willing to pay, just need to find someone who codes this stuff.

    If your interested or know someone, please let me know my reg email is

    thanks again

    Plugin Author shauno


    Paste the code between code tags (backticks).

    Thanks man,

    it doesn’t work. I’d love to know why, perhaps this is just not an application for the nextgen gallery or cart66. Im not sure what Im doing wrong. But it will take me 3 years to figure it out at this rate.

    may need to throw my hands up and find someone to help implement it, IF it can even be implemented. When I add the code to gallery…the galleries don’t show up anymore..


    I appreciate all your help, I know your busy and answering dumb questions like this is a hassle

    Plugin Author shauno


    Dude, all I asked was to paste that code in code tags, so your post doesn’t get borked by the forum.

    I gave you the code and the line to paste it. What went wrong?
    Did you change the “Your Field Name Here” to your field name? Describe the problem. This aren’t voodoo and witch craft. It’s simple stuff. Let’s slowly step through the problem, and get it sorted…

    I got ya….no problem here. Its a classic case of “I can SEE how this is supposed to work, but it isn’t!”

    Just to clarify – One each page that has a gallery on it, I am using the NEXTGEN code:

    [nggallery id =*] This is resulting in a page of 20 thumbnails which when you click on one of them we get the lightbox effect. You are correct, the default “effect” choice is selected, using the SHUTTER option.

    The custom field name I have created for test purposes is “Purchase” and each image in the gallery I am viewing in the manager have Purchase field text area visible.

    In that area I am adding a short code for CART66

    [add_to_cart item=”AW-1001″ quantity=”user:1″ ]

    Just a test product purchase button.

    The code for /view/gallery.php: after adding the code above: (line 40-57)

    <!– Thumbnails –>
    <?php foreach ( $images as $image ) : ?>

    <div id=”ngg-image-<?php echo $image->pid ?>” class=”ngg-gallery-thumbnail-box” <?php echo $image->style ?> >
    <div class=”ngg-gallery-thumbnail” >
    imageURL ?>” title=”<?php echo $image->description ?>
    <?php echo $image->ngg_custom_fields[“Purchse”]; ?>” <?php echo $image->thumbcode ?> >
    <?php if ( !$image->hidden ) { ?>
    <img title=”<?php echo $image->alttext ?>” alt=”<?php echo $image->alttext ?>” src=”<?php echo $image->thumbnailURL ?>” <?php echo $image->size ?> />
    <?php } ?>


    <?php if ( $image->hidden ) continue; ?>
    <?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
    <br style=”clear: both” />
    <?php } ?>

    <?php endforeach; ?>

    <!– Pagination –>

    When this is added to the gallery.php sheet and updated, none of the gallery’s appear on the pages. When I set it back to the default PHP page, they are there.

    I Went ahead and posted what I did because I feel pretty sure I am posting something incorrectly.

    Thanks for looking!


    Plugin Author shauno


    Look above the little textarea you type in to create a reply. You will see there is a button labelled code. When you click it, it puts a little back tick in the editor, and changes the button label to /code. Click it again and the editor puts another back tick in. You need to paste your code between those 2 little things.

    If you have more than 10 consecutive lines of code, the moderators frown on that. You can use Pastebin to paste your code instead.

    Back to the question. It seems you actually want to have a shortcode as the custom field value. That will be tricky, as the popup is processed by javascript, and that has no access to the shortcode system. It might be possible to convert the shortcode to whatever it is in the gallery template, but guess is that will not be allowable inside the title attribute.

    I will do some testing when I get some time, but I have no idea what the shortcode generates, as you have to pay $89 for a license of cart66. Maybe they should be the ones figuring this out…

    Sorry for that…don’t usually post to forums very often. My apologies. After some thought, I was kind of thinking the same thing. I am going to test that special field with just some plain text to see what it does. If it doesn’t “break” the gallery I think its a safe bet that the short code is causing the JS to get wonky.

    The other option I was thinking of would be to make the “custom field” a hyperlink, I could add a specific hyperlink for each image which would allow me to add specific information on the image as well as all possible purchase options, and just use the Cart66 (or any cart short code) there.

    Thanks for looking into with me, I do appreciate it. It’s a learning process sometimes, so I am grateful.

    Thanks dude

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: NextGEN Custom Fields] custom fields/cart 66 /pay pal buttons’ is closed to new replies.