Support » Plugins and Hacks » WP Photo Album Plus » [Resolved] [Plugin: WP Photo Album Plus] Using shopping cart code in photo descriptions.

[Resolved] [Plugin: WP Photo Album Plus] Using shopping cart code in photo descriptions.

  • Hi.
    This is a great plugin.
    I have an art site and would like to put an “Add to Cart” button on some of the pictures. I am using the cart66 lite plugin. When I put the code for the button into the description box it just makes the description read “undefined”. I have been fiddling with the code trying to get it to display the button but no luck so far.
    Is it a problem with displaying html in the description box?
    Does anyone know a decent, free e-commerce plugin that works with wppa+?
    Will Batman escape in time or will the Egghead’s acid bomb destroy the walls of the mutant chickens’ cage?
    Just how do they get a ship in a bottle?
    Let me know what you think.
    Thanks for such great support.


Viewing 12 replies - 1 through 12 (of 12 total)
  • You can use html in descriptions of albums and photos if you check Table IX item 4 in the Photo ALbums -> Settings admin page.

    Hey, sorry for the delay in replying.
    I have tried both allowing and not allowing html in the descriptions as per your suggestion but it didn’t seem to change anything.
    To add to my earlier post, what happens when I use the shortcode ([add_to_cart item=”343″]) is it will cause the picture to not be displayed and the description to read undefined.
    The button displays correctly in the “Custom content” box, but that’s not for specific pictures.
    Let me know your thoughts. I will try to see if other cart66 users have had this problem and what they did.
    Thanks again.

    Could you provide a link that shows me the problem, please?


    You can see the first three pictures have the shortcode added to the description.

    Just as a check, I reinstalled both cart66 and wppa+ but there was no change.

    I’ve been fiddling with it and it seems to be a problem with the quotes around the item number. If I change the item number to “343” instead of 343 the picture is displayed correctly but the add to cart button is not. It says “Could not load product information”, so at least it is getting that far.

    Try this:
    wppa-functions.php line 1002 reads:

    $result .= wppa_html(esc_js(stripslashes(wppa_get_photo_desc($id))))."','";

    change to:

    $result .= wppa_html(esc_js(wppa_get_photo_desc($id)))."','";

    I.e. remove stripslashes( and a )

    If you have the possibility to change the single quotes in the shopping cart code into double quotes, that might also help.

    On a second thought it might be better to change the line above into:

    $result .= wppa_html(esc_js(stripslashes(apply_filters('the_content', wppa_get_photo_desc($id)))))."','";

    i.e. adding apply_fiters(‘the_content’, and a )

    This will affect the layout a bit. If that is a problem, tell me.

    Removing the stripslashes didn’t work, let me try the other now.

    Hah, worked like a beauty.
    It’s not 100% perfect but it’s passable. That method puts the facebook button into the photo description and it makes the description box a bit bigger and filled with blank space, but you know, I’m not worried about it.
    That is such a huge thing off my mind. I’ve been thinking about that for months but I had no idea how to go about it. It was a good crash tutorial in basic php coding for me even though I couldn’t fix it.
    Anyway, I’m so glad you helped me out, I want to give you some money. I didn’t see a donation button on you page, do you have one? Or some other way that I could repay you?

    Plugin Author Jacob N. Breetvelt


    There is a donate link on the front page of this plugin, but here is also a link: (PayPal) Donate

    The feature will be standard available in the next version (in a few days) so you do not need to make the change again (Table IX-20: Foreign shortcodes). I know about the layout issues.

    Plugin Author Jacob N. Breetvelt


    Thank you for your donation

    Plugin Author Jacob N. Breetvelt


    Version 4.3.11 is in a beta release available. It will have the feature you requested for.
    Please read the changelog and instructions first.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] [Plugin: WP Photo Album Plus] Using shopping cart code in photo descriptions.’ is closed to new replies.
Skip to toolbar