WordPress.org

Ready to get started?Download WordPress

Forums

Cart66 Lite :: WordPress Ecommerce
[Plugin: Cart66 Lite] Add to Cart but stay on same page. (15 posts)

  1. joshuaiz
    Member
    Posted 3 years ago #

    Hi,

    When using Cart66 Lite I would like to set it so that when you click "Add To Cart" you stay on the same page and not be redirected to the "Cart" page but still update the widget cart.

    Is there a quick and easy way to do this?

    Thanks!

  2. petriknz
    Member
    Posted 3 years ago #

    This is what I am trying to do too. Did you get a solution.

  3. reality66
    Member
    Plugin Author

    Posted 3 years ago #

    You can take advantage of one of the hooks built into Cart66. Add a function to the functions.php file in your wordpress theme like this

    function backToProductPage($product, $qty) {
      wp_redirect($_SERVER['HTTP_REFERER']);
      exit();
    }
    add_action('cart66_after_add_to_cart', 'backToProductPage', null, 2);
  4. petriknz
    Member
    Posted 3 years ago #

    Thank you for this information.

    This is taking me to new depths in customization. I shall do some research in what this means and how this works.

    One question I have already is what does the "null" and "2" do in the "add_action". As I said this is taking me into unknown territory so sorry if this seems to be a stupid question.

    Thanks again.

  5. reality66
    Member
    Plugin Author

    Posted 3 years ago #

    Here is the function reference for add_action. The null parameter is in the place of priority which you can use to tweak when your function runs. Usually the default of 10 is fine. The last parameter means that your call back function should expect 2 parameters which, in this case, is an instance of the Cart66Product object that was added to the cart and the quantity of that product that was added.

  6. petriknz
    Member
    Posted 3 years ago #

    Can the functionality be changed so it does not reload the page.

    What we want to see happen is that there is a list of items with "add to cart" buttons on the page. The "cart" is in the side bar. When the "add to cart" button gets pressed for a product it updates the cart in the sidebar but does not reload the page as this solution is doing?

  7. reality66
    Member
    Plugin Author

    Posted 3 years ago #

    An ajax based add to cart feature is something we're working on and will provide the functionality you are describing but it's not available yet.

  8. petriknz
    Member
    Posted 3 years ago #

    Any idea when we can expect to see that? We are so close to purchasing the development version of Cart66 but just have this and a a few tax/shipping issues to sort out.

  9. martinavive
    Member
    Posted 2 years ago #

    hi

    i cannot even see the cart66 button on the wordpress editor page and the plugin is in installed and i have added products, any ideas?

  10. benjaminprojas
    Member
    Posted 2 years ago #

    martinavive,

    What theme are you using? Some themes hide the Cart66 button. Also, you need to make sure that you are in the WYSIWYG portion of the editor, not the HTML side. If you are using any other editor besides the default TinyMCE editor, the button will also not show up.

  11. AminkaOzmun
    Member
    Posted 2 years ago #

    Benjamin,

    In my case, the Lite version displays the button just fine while an upgrade to the Pro version removed it for some reason. I found out that having both Lite and Pro plugins activated at the same time solved this problem -- but that's not the way it's supposed to be.

    Any suggestions?

  12. benjaminprojas
    Member
    Posted 2 years ago #

    Aminka,

    That is a very unusual issue. I would recommend opening a support ticket through you Pro account so we (Cart66 Developers) can take a closer look.

  13. AminkaOzmun
    Member
    Posted 2 years ago #

    Hi, Benjamin,

    I've since noticed that the green button of Cart66 Lite has been replaced in Cart66 Pro by an icon up above the toolbars, where adding media functionality is, so the matter's moot!

    Everyone Else,

    I just want to note for the record something (wonderfully) weird that happened today...I was installing a bunch of plugins -- including Login Lockdown, Lockdown WP Admin, and Affiliate Link Cloaking -- and then noticed on my site that adding to the cart no longer redirects to the cart page!!!!

    I don't have any payment methods set up still so there may yet be problems down the road with this unexpected boon but FWIW the sidebar cart widget updates successfully despite there being no redirect!!

  14. AminkaOzmun
    Member
    Posted 2 years ago #

    Oops...spoke too soon: while the quantities do update, "view cart" and "checkout" on the widget do not work! Going to the regular cart page seems fine, though....

  15. AminkaOzmun
    Member
    Posted 2 years ago #

    Back to the original subject:

    Turns out that Cart66 actually does offer this very add-to-cart-but-stay-on-page-with-success-message functionality -- as a plugin for their plugin!

    It's entirely unsupported but it does work on my eponymous site. It's a beta release and apparently only available to paying members of the "pro" version of their cart, but it does work! Check it out at http://aminkaozmun.com (my site's still under construction so please don't laugh too hard!)....

    And for the record, this beta plugin for their plugin may be found on the members-only forums at https://cart66.zendesk.com/entries/20514067-add-to-cart-go-to-homepage-not-cart-page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic