WordPress.org

Ready to get started?Download WordPress

Forums

WP Photo Album Plus
[resolved] Using shopping cart code in photo descriptions. (13 posts)

  1. Coffeepot
    Member
    Posted 2 years ago #

    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.

    http://wordpress.org/extend/plugins/wp-photo-album-plus/

  2. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    You can use html in descriptions of albums and photos if you check Table IX item 4 in the Photo ALbums -> Settings admin page.

  3. Coffeepot
    Member
    Posted 2 years ago #

    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.

  4. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

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

  5. Coffeepot
    Member
    Posted 2 years ago #

    Sure,
    http://copiuscolor.com/?page_id=75

    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.

  6. Coffeepot
    Member
    Posted 2 years ago #

    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.

  7. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  8. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  9. Coffeepot
    Member
    Posted 2 years ago #

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

  10. Coffeepot
    Member
    Posted 2 years ago #

    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?

  11. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  12. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Thank you for your donation

  13. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic