[Contribution] Recently Viewed Products(sales optimized)

Recommended Posts

The Recently Viewed Addon uses a session variable to store data. The box will disappear if session is lost. This is a serious problem with your store, since the customer's cart will also be lost if session is lost. Try adding something to the cart, without logging in, and see if the cart box disappears at the same time as the Recently Viewed box. If it does, the problem is loss of session. The usual cause of this is links that do not carry session, i.e. links that are not made with the osC tep_href_link() function.

Regards

Jim

No, I can add products that I viewed to my shopping not logged in, and they are not lost, but my Recently View box still disappears. As I click on other products, and add them to my shopping cart, the Recently View box will sometimes disappear, then reappear when view another product.

Share this post

Link to post

Share on other sites

Check that the code you added for Recently Viewed is not placing the box in a conditional statement that is not always on. The box is included catalog/includes/column_right.php.

If that is not the problem, you'll have to debug the session code. Start bt putting a print statement in the header to print out the session variable at the top of every page. If that variable comes up blank, that's where it's being lost.

Share this post

Link to post

Share on other sites

Check that the code you added for Recently Viewed is not placing the box in a conditional statement that is not always on. The box is included catalog/includes/column_right.php.

If that is not the problem, you'll have to debug the session code. Start bt putting a print statement in the header to print out the session variable at the top of every page. If that variable comes up blank, that's where it's being lost.

I just came across this contribution and I'm going to install your v2.0. I was just wondering, are you still installing this in your own sites and if so, are there any code changes since the time you updated it a while back that you might recommend? There are some 'updates' for tax calculations, invalid HTML codes, and compatibility with 'show soldout items', but I can't tell from this forum whether those others are really necessary or not. I'm running 2.2RC2a with all the bug and security fixes for 2.3.

After reading through the forum, I was able to get this to work. The confusion that I and maybe a couple of people back in early 2009 had was that this product check was taken out because of Spooks' Simple multi-image w/ FancyBox addon.

Everything seems to work great now, but since Spooks has left the building, could I ask if you foresee any hidden problems with reintroducing this code into product_info.php? I know that I'm asking you to comment on someone else's add-on, and if you can't, I understand.

Just one more question... For the bottom box, where in includes/modules/recently_viewed.php would I edit to change the class? I just need to change the background color of the box.

Thanks again for updating this contribution. This really should be a must-install for most people.

Share this post

Link to post

Share on other sites

Adding that code back in won't cause any major problems. It might be a bit faster to use the query from Spooks' addon and just count the number of rows it returns. Probably not a big enough difference to be worth worrying about unless you have a major site speed problem.

The box uses the stock osCommerce Content Box. See catalog/includes/modules/recently_viewed.php, Line 244 in the stock file. Changing the CSS class of that will change all of the content (module) boxes in osCommerce. To change just this one, you need to create a new box class modeled on the existing contentBox, with a different CSS class for the contents.

Regards

Jim

See my profile for a list of my addons and ways to get support.

Share this post

Link to post

Share on other sites

Adding that code back in won't cause any major problems. It might be a bit faster to use the query from Spooks' addon and just count the number of rows it returns. Probably not a big enough difference to be worth worrying about unless you have a major site speed problem.

The box uses the stock osCommerce Content Box. See catalog/includes/modules/recently_viewed.php, Line 244 in the stock file. Changing the CSS class of that will change all of the content (module) boxes in osCommerce. To change just this one, you need to create a new box class modeled on the existing contentBox, with a different CSS class for the contents.

Share this post

Link to post

Share on other sites

I would like to place a link in one of my left hand boxes and not showing the other boxes on the site (was thinking about putting it in my Categories box or Information Box) - But I would like that link only to appear once the customer has "Recently Viewed" something. Has anyone done this and if so would you mind sharing the code?

Share this post

Link to post

Share on other sites

Session is maintained by the cookie if a cookie exists. If the customer does not accept cookies the session is maintained by the osCsid. Using cookies alone would mean that some customers would not see the Recently Viewed items. It's up to you if you want that restriction.

Share this post

Link to post

Share on other sites

I've installed the mod and run smoothly but one thing still make me wandering. I thought the mod doesn't memorize the recently viewed record until that I found other site which installed the same mod has the function to recall the record even I shut down the computer and surf their web page (no Login though).

I realize that was my own problem. I found that my web site doesn't memory the recently viewed record even I'd only close the browser and reopen a new browser. Is there something wrong I missed or done wrong?

I just know a little php knowledge but not enough to figure it out, please anyone can help me out from this?

thanks

Jay

p.s. I wish this mod has the function, I mean a button to let the site viewer able to reset their recently viewed record to 0 (clear the history).

Share this post

Link to post

Share on other sites

You can always ask. Remember that the forum doesn't always tell me that someone has posted (it didn't this time) or I may be away from the computer, so have some patience.

This Addon stores the data in the server Session, so it needs a cookie or a SID to store the session data. A different browser won't have that cookie so the data will not be available there. If your browser is set to delete cookies when you shut down, then the data is lost when you shut down. I don't know any way to overcome this. Well, not without hacking your computer, which I refuse to do.

It should be possible to code a button that clears the data. It just needs to destroy the session variable. Let me think about this a bit.

Share this post

Link to post

Share on other sites

You can always ask. Remember that the forum doesn't always tell me that someone has posted (it didn't this time) or I may be away from the computer, so have some patience.

This Addon stores the data in the server Session, so it needs a cookie or a SID to store the session data. A different browser won't have that cookie so the data will not be available there. If your browser is set to delete cookies when you shut down, then the data is lost when you shut down. I don't know any way to overcome this. Well, not without hacking your computer, which I refuse to do.

It should be possible to code a button that clears the data. It just needs to destroy the session variable. Let me think about this a bit.

Regards

Jim

Jim, you are such pro and kind... many thanks!

I have been to a site (own by one of the member of this forum). The viewed data will show each time I back to their site even I reboot the computer. According to your clue, can I think that the problem were probably to my server? If so, what should I do?

Share this post

Link to post

Share on other sites

The Recently Viewed data is stored in the same place as the shopping cart data. If you can check out after a reboot/browser restart, then the Recently Viewed box should work as well. I just tried it and it worked for me. Maybe it's something in your browser?

Regards

Jim

See my profile for a list of my addons and ways to get support.

Share this post

Link to post

Share on other sites

The Recently Viewed data is stored in the same place as the shopping cart data. If you can check out after a reboot/browser restart, then the Recently Viewed box should work as well. I just tried it and it worked for me. Maybe it's something in your browser?

Regards

Jim

Hi Jim,

I did tried different computer by office and home, but still in same result..oh, I forgot to tell, I just test my site as guest and put something in to the cart. Then close the browser reopen it..cart is empty! But it's okay if I login as memeber to put something in the cart everything data may store but the recently viewed.

Sorry for wasting your time to this issue. Can you point me to some files or code that I can check if any mistake around?

best,

Jay

p.s. Please let me know if you need my server login name and password, as easy to run through...thanks