Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recently Viewed Products


Guest

Recommended Posts

if you're having Warning:  :angry:

 

Warning: in_array(): Wrong datatype for second argument in C:\www\hkorg\includes\modules\viewed_products.php on line xxx

 

from

 

  if (!in_array($HTTP_GET_VARS['products_id'], '$items_ids_on_display')) {  

 

to

 

  if (!in_array($HTTP_GET_VARS['products_id'], $items_ids_on_display)) {  

 

try remove '  '  from '$items_ids_on_display'

 

I'm using Ask A Question contib also. After changing thre line above Warning disappeared.  :)

 

 

I installed the contrib and it works fine, except for the error described by expert.

 

Removing those '' from $items_ids_on_display doesn't help. The error only shows when the first product is entered in the history. So when a person visits the store, it is ok, but as soon as he visits the first product the error shows up. But when he visits more products or pages, the error goes away. Also when he clears the history, everything goes away but again when he visits the first product after clearing the history, the error shows up.

 

Does anybody know how to get rid of it?

Link to comment
Share on other sites

  • Replies 92
  • Created
  • Last Reply

Top Posters In This Topic

I installed the contrib and it works fine, except for the error described by expert.

 

Removing those '' from $items_ids_on_display doesn't help. The error only shows when the first product is entered in the history. So when a person visits the store, it is ok, but as soon as he visits the first product the error shows up. But when he visits more products or pages, the error goes away. Also when he clears the history, everything goes away but again when he visits the first product after clearing the history, the error shows up.

 

Does anybody know how to get rid of it?

 

 

 

try moving this statement :

 

$items_ids_on_display = array();

 

 

above this statement :

 

if ($viewed->count_viewed() > 0) { // displaying

 

 

 

 

 

I would suggest you set warnings/errors to log files not to the display.

You can set it in the php.ini file.

Treasurer MFC

Link to comment
Share on other sites

  • 1 year later...

Thanks biqiang and Amanda that fix worked to fix my:

"Wrong datatype for second argument in..." Error too!

 

It should be included in newer versions if there are any as the bug did not affect me until I upgraded my version of PHP, so it likely applies to everyone with newer versions of PHP.

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

  • 1 month later...

i don't know if it s the right thread for "Your Recent History V2.0" since its the same contribution updated and renamed , like other i got an error with this new contrib, where ever i place the requre in application top.php it says taht tep tep_session_is_registered is an unknow function

 

any help ?

 

by the way in the exemple website, we can see some image of the product in the history , anyone could provide the code added to show that ?

 

best regards ... my customers got some history at my website lol

MS2

Link to comment
Share on other sites

i don't know if it s the right thread for "Your Recent History V2.0" since its the same contribution updated and renamed , like other i got an error with this new contrib, where ever i place the requre in application top.php it says taht tep tep_session_is_registered is an unknow function

 

any help ?

 

by the way in the exemple website, we can see some image of the product in the history , anyone could provide the code added to show that ?

 

best regards ... my customers got some history at my website lol

for the error, make sure that this code:

 

if (!tep_session_is_registered('viewed')) {

 

 

begins after this code:

 

if (!tep_session_is_registered('languages_id')) {

tep_session_register(languages_id);

}

 

it looks like you include that code before :

require(DIR_WS_FUNCTIONS . 'sessions.php');

 

which is not good as that function is in there.

 

The V2.0 version is also not so very new, I currently run a more modified one which records the products, categories and searches and the ability to erase those individually, I might update the contrib with that a little later.

Treasurer MFC

Link to comment
Share on other sites

for the error, make sure that this code:

 

if (!tep_session_is_registered('viewed')) {

 

 

begins after this code:

 

if (!tep_session_is_registered('languages_id')) {

tep_session_register(languages_id);

}

 

it looks like you include that code before :

require(DIR_WS_FUNCTIONS . 'sessions.php');

 

i tried to place it after after require(DIR_WS_FUNCTIONS . 'sessions.php'); , got the same error !

and i got nowhere : if (!tep_session_is_registered('languages_id')) {

 

i got a ms2 version , do you use maybe a updated ms2 with -051113 upgrade

 

because on thsi version , applciation_top.php contains thsi code :

  function tep_session_is_registered($variable) {
return session_is_registered($variable);
 }

 

and taht is maybe why u got it and i don't !

MS2

Link to comment
Share on other sites

i tried to place it after after require(DIR_WS_FUNCTIONS . 'sessions.php'); , got the same error !

and i got nowhere : if (!tep_session_is_registered('languages_id')) {

 

i got a ms2 version , do you use maybe a updated ms2 with -051113 upgrade

 

because on thsi version , applciation_top.php contains thsi code :

  function tep_session_is_registered($variable) {
return session_is_registered($variable);
 }

 

and taht is maybe why u got it and i don't !

 

051113 upgrade has nothing to do with it.

 

and this code:

 

  function tep_session_is_registered($variable) {
return session_is_registered($variable);
 }

if inside the session.php file, not application_top.

 

so find this code in application_top:

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

 

and put it after that.

Treasurer MFC

Link to comment
Share on other sites

  • 2 months later...

Dear Amanda

 

A long time ago that someone posted with a question about this extremely nifty contribution! Certainly proof to its solid code!

 

My question is about the 'Do you remember this one?' product picture and product name. Somehow there is a stray product name (which is not a link) just left of the product picture but not related to it. Its always a random product name of one of the 'earlier viewed' list, but strangely enough not always there, say once every 5 times....

 

Installed is version 1.8 of John Berkedam on a fresh MS2.2, but your earlier version 4 also has the same problem. The server runs PHP 5 (and Mysql 5).

 

Hope you know what's going on and that you can help me.

 

PS: I heard a newer version in the pipeline?

 

Thanks for your help.

 

edit: sorry, somehow i am not able to upload a picture

Edited by Elegast
Link to comment
Share on other sites

Found a site to upload small pics!

 

viewedprod7zq.jpg

 

I hope this clarifies the problem a bit. The previously viewed product column is as nice as ever, it's just that one of the product titles is duplicated and placed next to the 'remember this one' picture, but not as a link. Only happens 1 in ~5 times though...

 

Thanks!

Edited by Elegast
Link to comment
Share on other sites

Found a site to upload small pics!

 

viewedprod7zq.jpg

 

I hope this clarifies the problem a bit. The previously viewed product column is as nice as ever, it's just that one of the product titles is duplicated and placed next to the 'remember this one' picture, but not as a link. Only happens 1 in ~5 times though...

 

Thanks!

 

not sure but try to find this code in the module:

 

echo TEXT_DO_YOU_REMEMBER . '<br><br>';

echo $items_on_display[$selected_product1]['name'];

 

then delete

 

echo $items_on_display[$selected_product1]['name'];

 

I think that is a stray statement.

 

Nothing is really in the pipeline, I just currently use a version which no longer shows this "remember" option as I limit the amount to 4 products for performance reasons and "remember" at that amount is kind of silly.

the performance became troubling as I also store the viewed category and performed searches history.

Next to those I either show the also purchased product or a random featured one.

 

Only thing on the agenda is to "re-normalize" this so that it would run on a default installation.

Treasurer MFC

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

I have read over this support thread. I have the recently viewed installed & viewing it as a box on the right column. Is there an update that I missed because this box looks nothing like the rest of the boxes. I don't even have a includes/boxes box file for this...it is listed in the modules folder.

Link to comment
Share on other sites

  • 2 months later...

I have also tried to install the My Viewed History 3.0 and while im not getting an error on it. Its just not working.

Im using BTS so not sure if that has something to do with it or not.

Any help would be greatly appreciated as we need this feature as well.

Thanks

Kaileen

Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...