Cart Bubble is incorrect until page refreshes

Not only the cart, notifications don't show up unless you leave or refresh the page you are on.  Is that just the way it is or is there some kind of cron job or javascript that checks and/or updates as needed?

Quote · 24 Sep 2013

that's the way it is..

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 24 Sep 2013

Hmmm. Someone should javascript that.  

Speaking of which - when I do a location.href='specificsitepageurl' in javascript, it loads the page but I guess that page is still cached.  

Is there a javascript load function that forces the target page to do a real load so any changes on the page are visible?  

I've tried .assign with no luck.

Quote · 24 Sep 2013

So what does the bxdolmembermenu file do? Located in inc/classes. Surely there is something that will check for new messages or notifications and update the page without having to completely reload the page?  What's this class do:

 

class BxDolMemberMenu

    {

        // contain all registered menu's bubbles;

        var $sBubbles = null;

 

        // contain current menu possition (allowed values : top, bottom, fixed)

        var $sMemberMenuPosition = null;

 

        var $iBubblesUpdateTime  = 30000; // in milliseconds;

 

        var $iNotifyDestroyTime  = 3000; // in milliseconds;

 

        // page that will procces all ajax queries from member menu ;

        var $sQueryPageReciver = 'member_menu_queries.php';

 

        var $sBubblePrefix = 'bubble_';

        var $oCacheObject;

        var $iKeysFileTTL = 600; //cache life time

        var $sMenuCacheFile = 'sys_menu_member';

        var $sMenuMemberKeysCache = 'mm_sys_menu_member_keys_';

Quote · 25 Sep 2013

its odd, cause when you get a new mail, it instantly shows the red bubble with a 1 (or however new mails you have). I would think that all bubbles would react the same and instantly update.

caredesign.net
Quote · 25 Sep 2013

Good luck getting someone to help with the code.  I asked for someone to walk me through the rather complex BxPhotoSearch or something like that, search function for photos so I could learn how to do my own searches and display them but no one answered.

Geeks, making the world a better place
Quote · 25 Sep 2013

LOL. Andrew P has been kind enough to answer at times. He's good.  Have faith Geek Girl. 

It's also an opportunity for another 'good' at coding to establish or reaffirm his or her reputation as such.

Quote · 25 Sep 2013

 

its odd, cause when you get a new mail, it instantly shows the red bubble with a 1 (or however new mails you have). I would think that all bubbles would react the same and instantly update.

 
Reason is performance.

The more that's added that has to run in the background, the more powerful a server is needed to run the site.

It's a fine line that has to be walked.


https://www.deanbassett.com
Quote · 25 Sep 2013

So, let's say I have a more powerful server.  How would I go about replicating the way the mail is updated for at least the cart.  I mean it displays incorrect until the page is reloaded. That's not logical. Or it doesn't seem it to me.

Quote · 25 Sep 2013

Well that i can't tell you. I have never looked into it.

https://www.deanbassett.com
Quote · 25 Sep 2013

No worries deano. Respect. I know you are 'good'. 

Quote · 25 Sep 2013

just a thought to throw out there, as there have been issues i needed to display instantly and my javascript knowledge is pretty much non-eexistant. What if there is a way to reload the page after an item is added to the cart, this would efffectively bring up the bubble correctly? Its a thought but i do not know how practical it would be or if possible as I do not have a store installed on my sites. will add to a test site and see what I can come up with - unless deanos or someone else beats me to it.

caredesign.net
Quote · 25 Sep 2013

Ya, I played with trying to do that this afternoon but I just couldn't get it to work.  I even tried ajaxing through a temp page with a php header relocate but it just wouldn't change the number unless I refreshed. Crazy.  I'm a pseudo novice programmer though just trying to teach myself a little php and maybe javascript.

In other words, any programmers know the syntax to force a page refresh after the cart data is posted?

Quote · 25 Sep 2013

I was assuming that this was deliberate by boonex, But it appears it is not.

According to all of the research i just did, any member menu item that has bubble code should auto update live time. For some reason the cart is not, and for the life of me, i cannot figure out why.


https://www.deanbassett.com
Quote · 25 Sep 2013

Well certainly don't risk your life for an answer but should you stumble across pertinent info about this topic, please share.

Quote · 25 Sep 2013

I suppose that it maybe just too long update time. By default it is 30 seconds - so bubbles in main menu (including shopping cart) updates every 30 seconds. 

You can try to change this value in inc/classes/BxDolMemberMenu.php file:

var $iBubblesUpdateTime  = 30000; // in milliseconds;

Rules → http://www.boonex.com/terms
Quote · 25 Sep 2013

 

I suppose that it maybe just too long update time. By default it is 30 seconds - so bubbles in main menu (including shopping cart) updates every 30 seconds. 

You can try to change this value in inc/classes/BxDolMemberMenu.php file:

var $iBubblesUpdateTime  = 30000; // in milliseconds;

 
I did that.

The other bubbles work. The cart for some reason does not.

If you watch the calls to member_menu_queries.php in the firefox console, the id for the cart is never called.




https://www.deanbassett.com
Quote · 25 Sep 2013

Hi Alex, thanks for joining in. Ya, I tried dropping that all the way down to 5k and it just won't update the count.  I've let it set for a few minutes even.  Is that membermenu class file where I need to focus my attention? 

A click on the cart icon correctly itemizes the purchases and displays the correct total count at the top of the list, but the red bubble count display is incorrect until the page refreshes or another page is loaded.  It 'feels' like a cache thing and I even tried to put no-cache metas in the headers just to test but it made no difference.

I'm now thinking that somewhere there is a piece of javascript that updates that particular bubble element on an event and maybe the field name is wrong or something but I can't find that piece of code anywhere.  Ideas?

Quote · 25 Sep 2013

LOL.

None of mine are updating live time. Just tested by sending myself messages, invites, ect via a different browser from a different account on a different computer to the account logged on my main computer, and nothing. Not until i move to a different page, or refresh.

So right now i am chasing a ghost. I cannot verify with my site as it is either broken, or it never worked live time to begin with.

Arggg. i have to call it quits on this one. I have wasted to many hours.

https://www.deanbassett.com
Quote · 25 Sep 2013

I hear ya deano. I bet I put in 8hrs either trying to figure out how it works or finding a hack way to make it work and I thought I had it but I'm gonna say no.

So if anyone else out there has noticed that when someone buys something via the cart and the user's red alert bubble for their cart is displaying the WRONG quantity amount, let us know here.  Better, if you fixed it - share you magical fix. :)

Thanks everyone.

Quote · 25 Sep 2013

http://www.boonex.com/trac/dolphin/ticket/3302

Rules → http://www.boonex.com/terms
Quote · 2 Oct 2013

Just wondering if this ticket item is getting close to being solved.

Quote · 17 Jan 2014

FYI, I made a code tweak to the BxPmtModule.php file that will make the shopping cart bubble go away that displays even when the cart is empty.

The issue is that unlike the other member menu item bubbles, the shopping cart bubble stays or goes away based on a page refresh.  Using header Location to send the user back to the cart does not reload a fresh page for some reason?  Odd.  So this is a bit of a hack admittedly, but I changed this:

header('Location: ' . $this->_oConfig->getReturnUrl());

to this:

header('Refresh:0; url=' .$this->_oConfig->getReturnUrl());

For me, I'd rather add a second to the page load than have a page displaying something is in the cart when really it is empty.  A 'ghost' shopping cart button is confusing to a user methinks.

If someone knows of a way to force refresh a page using header location (I thought it did actually), let me know.  I messed around with cache stuff to see if that was it but no luck.

Also, I changed the redirect URL in BxPmtConfig.php from:

$this->getBaseUri() . 'cart/';

to:

$this->getBaseUri() . 'history/';

which is only a preference for me.  It seems more logical to send the customer back to view what he/she just paid for than more often than not, a page showing the cart is empty.

Quote · 27 Jul 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.