Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kingjamesI

    (@kingjamesi)

    harvoolio, there could be several things you might need to check.

    First, make sure the jQuery elements in my script matches your form i.e. <a class=”remove”, etc.

    Determine if the $ jQuery variable is recognized by substituting “jQuery” i.e. jQuery(‘a.remove, . Sometimes, other scripts and/or plugins commandeer the $ variable for their own use.

    Make sure your script is inside a jQuery(document).ready script or is inside a script file called after the form appears in the DOM (maybe before the footer).

    There could be other things, but these are the most obvious.

    Thread Starter kingjamesI

    (@kingjamesi)

    Ryan, if you’re unfamiliar with jQuery, you must become so to use my tactic. My situation is different than yours, so use the below as a guide and not verbatim:

    $('a.remove,input[name=update_cart]').on("click",function(){
      sessionStorage.removeItem("wc_fragments");
    });

    What this does is find elements in the cart html ( anchors(red Xs) with class remove and the update cart button )and assign a click event to them with a handler to remove the sessionStorage browser object as indicated. The reason this works is that the cart page refreshes when an item is removed or changed. The page refresh also rebuilds the wc_fragments object.

    To get a clearer picture of this, if you use Chrome Developer Tools (or similar), inspect and find the “Session Storage” item under the Resources tab. You should see your domain. Select that and then the particular objects will show (wc_fragments). Of course, you’ll need something in the cart. You’ll have to go into edit mode and then scroll all the way to the end to see the menu cart entry. If you keep manipulating your cart and then inspect repeatedly, you’ll see how the latter counts up but never down.

    Thread Starter kingjamesI

    (@kingjamesi)

    I suppose I should describe a work-around for this, but it’ll be very short. If anyone has questions about it, I can explain further.

    If indeed you are using woocommerce, that explains that you should provide a handler for your situation by adding a filter to woocommerce’s filter hook “add_to_cart_fragments.” Once that happens, then you’re locked into the ajax routines of woocommerce. Not a bad thing when adding items to a cart.

    On the other hand, if something is removed from a cart, there are no suggestions as to how menu cart is to update its count. So, after digging, I found that woocommerce creates/updates a sessionStorage object named “wc_fragments” that stores its cart widget info, AND, the menu cart stuff by means of the above filter. Problem was, this mechanism only adds items and not removes. Further, menu cart continues to somehow rely on the sessionStorage object to display a count (in my case).

    I promised a short story… So, by manually deleting the wc_fragments storage object, my items count began to work, but, when adding items again, the sessionStorage object is replenished and the symptom resumed.

    I ended up creating a small jquery script that removes the sessionStorage object whenever the delete item button was clicked. So far, I’ve not found any ill effects from this.

    I wonder if anyone is brave enough to reload/install the previous version. I may have to try it soon.

    Follow Up:

    I can’t prove this was my MailPress problem, but my client had renamed the default post category and then created a mailing list by the same exact name. Form what I could determine from the logs, no posts were ever found to be processed by the system.

    Well, with the mailing list as it was and the indexes and keys the way the were in the db tables, I assumed that was the reason MP could not find any posts to process.

    So, I set about to create another category for posts and create different mailing list, yada, yada, once I posted to the new cat, the newsletter arrived in my email.

    Lesson/Suggestion: don’t create a mailing list names exactly like a post category.

    I’m having a similar problem. I’m using the latest mailpress and WP 3.4.1, but no posts are sent out. The test function works fine, but there’s no auto sends happening.

    I haven’t tested featured images, but I know an email is not going out for a post without one.

    I’m also using a customized theme from MP, but as I said, the test emails are fine.

Viewing 6 replies - 1 through 6 (of 6 total)