_g_ Posted December 27, 2004 Share Posted December 27, 2004 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. :) <{POST_SNAPBACK}> 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? Quote Link to comment Share on other sites More sharing options...
boxtel Posted December 27, 2004 Share Posted December 27, 2004 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? <{POST_SNAPBACK}> 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. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
_g_ Posted December 27, 2004 Share Posted December 27, 2004 Thanks a lot. It did work :) Quote Link to comment Share on other sites More sharing options...
homewetbar Posted January 17, 2006 Share Posted January 17, 2006 (edited) 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 January 17, 2006 by homewetbar Quote 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 More sharing options...
azer Posted March 11, 2006 Share Posted March 11, 2006 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 Quote MS2 Link to comment Share on other sites More sharing options...
boxtel Posted March 11, 2006 Share Posted March 11, 2006 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. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
azer Posted March 11, 2006 Share Posted March 11, 2006 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 ! Quote MS2 Link to comment Share on other sites More sharing options...
azer Posted March 11, 2006 Share Posted March 11, 2006 I might update the contrib with that a little later. well you ll make some people happy :-) and what about thumbnails of the product visited Quote MS2 Link to comment Share on other sites More sharing options...
boxtel Posted March 11, 2006 Share Posted March 11, 2006 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. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
Elegast Posted May 21, 2006 Share Posted May 21, 2006 (edited) 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 May 21, 2006 by Elegast Quote Link to comment Share on other sites More sharing options...
Elegast Posted May 22, 2006 Share Posted May 22, 2006 (edited) Found a site to upload small pics! 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 May 22, 2006 by Elegast Quote Link to comment Share on other sites More sharing options...
boxtel Posted May 23, 2006 Share Posted May 23, 2006 Found a site to upload small pics! 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. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
Elegast Posted May 23, 2006 Share Posted May 23, 2006 Hit the nail on the head there! Thank you very much. This is a contribution to love... Quote Link to comment Share on other sites More sharing options...
Kalivy Posted August 14, 2006 Share Posted August 14, 2006 I installed this contribution but it does not work. Please help me! Thanks Notes: I use STS Quote Link to comment Share on other sites More sharing options...
Guest Posted February 3, 2007 Share Posted February 3, 2007 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 7, 2007 Share Posted February 7, 2007 I am not trying to bump this question, but it has been a week & no response. I still need help with this... Quote Link to comment Share on other sites More sharing options...
Guest Posted April 11, 2007 Share Posted April 11, 2007 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 Quote Link to comment Share on other sites More sharing options...
samaceb Posted November 23, 2007 Share Posted November 23, 2007 How do you control the image size? I want them to have a height of 100 per se. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.