WordPress.org

Ready to get started?Download WordPress

Forums

eShop
Dynamic Display price (8 posts)

  1. fangonk
    Member
    Posted 3 years ago #

    Has anyone ever found a way to dynamically display option set + product option price on the actual product page? That is if a user selects a product option and an option from the option set, I want to be able to display the new total without reloading the page. Is there a way to do this?

    http://wordpress.org/extend/plugins/eshop/

  2. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    Not currently, and probably not possible with a lot of fancy javascript to extract the price. Beyond my abilities.

  3. fangonk
    Member
    Posted 3 years ago #

    Im pretty comfortable with JS but less so with PHP. I am looking at eshop/eshop-add-cart.php but I can't seem to figure out which variables contain the price values. If you could point me in the right direction or just tell me where to look I would love to put the JS together and share it for the next version.

  4. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    for the option sets look for the variable $opsets['price'] (ala line 87)
    for standard options look for the variable $price (ala line 163).

  5. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    due to queries elsewhere I'm about to write a quick function that will return an array with all the details, that may or may not help.

  6. fangonk
    Member
    Posted 3 years ago #

    Oh man, that would be sick. Let me know if you get it ready.

  7. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    Only managed to get half of it done so far... still hoping to finish it before the next release, but not sure I can get this part finished in time.

  8. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    well it's been added... whether it is of any use is another matter.

    You'll need to print out what it returns to have an idea of what is in there, but basically use:
    get_eshop_product($id); if an $id of the page/post isn't supplied it will try and use the current $post->ID;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags