♥Tsimi 525 Posted February 6, 2015 This is a Wish List Addon for osC 2.3.4 BS GOLD based on the following addonhttp://addons.oscommerce.com/info/8665 I didn't really "improve" the addon I just bootstrapped it and tested it with osC 2.3.4BS GOLDI couldn't find the support topic for it if anything should arise just post here.Download: (*Please read BUG message further below before using this on a real shop.) Current known bugs BUG 1: On my local shop (XAMPP) everything runs just fine but when I test it on a real server I have the following issue. When you add products to the wish list and then try to update the qunatity I get this Array ( [formid] => 0f133d9343e623936d1934485bec227e [quantity] => Array ( [28] => 1 [26{3}8] => 2 ) [wlaction] => update_qty [your_name] => [your_email] => [friend] => Array ( [0] => [1] => [2] => [3] => [4] => ) => Array ( [0] => [1] => [2] => [3] => [4] => ) [message] => )Array ( [0] => Array ( [id] => 28 [name] => Samsung Galaxy Tab [products_status] => 1 [model] => GT-P1000 [image] => samsung/galaxy_tab.gif [price] => 749.9900 [quantity] => 1 [weight] => 1.00 [final_price] => 749.99 [tax_class_id] => 1 [attributes] => ) [1] => Array ( [id] => 26{3}8 [name] => Microsoft IntelliMouse Explorer [products_status] => 1 [model] => MSIMEXP [image] => microsoft/imexplorer.gif [price] => 64.9500 [quantity] => 1 [weight] => 8.00 [final_price] => 64.95 [tax_class_id] => 1 [attributes] => Array ( [3] => 8 ) [3] => Array ( [products_options_name] => Model [options_values_id] => 8 [products_options_values_name] => PS/2 [options_values_price] => 0.0000 [price_prefix] => + ) ) ) I have no clue why and how. There is no error message or number. Something is not working properly with the update function. Again this happens only on my real server. On my local server everything runs just fine. BUG 2: This is not really a big issue (IMO) but there is a redirect function that can be switched on or off in the admin. This redirect "should" do the following; when a customer adds a product to the wish list he's supposed to be redirected back to the product_info.php. That doesn't happen. For me that is not a big issue but others might find this annoying. One solution would be to remove that setting from the admin area. If anyone could take a look at it I would appreciate it. Thanks. Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 7, 2015 (edited) UPDATE: OK Bug 2 is not a bug per se. The explanation in the admin area is a bit confusing. I changed it to say the following; Display Wish List After Adding ProductDisplay the Wish List after adding a product (or stay on product_info.php) in catalog/application_top.php find if (WISHLIST_REDIRECT == 'Yes') tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id'])); change to if (WISHLIST_REDIRECT == 'No') tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id'])); the SQL should be changed to INSERT INTO configuration_group ( configuration_group_id , configuration_group_title , configuration_group_description , sort_order , visible ) VALUES ( '12954', 'Wish List Settings', 'Settings for your Wish List', '25', '1' ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Max Wish List', 'MAX_DISPLAY_WISHLIST_PRODUCTS', '10', 'How many wish list items to show per page on the main wishlist page', '12954', '', now(), now(), NULL , NULL ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Max Wish List Box', 'MAX_DISPLAY_WISHLIST_BOX', '4', 'How many wish list items to display in the infobox before it changes to a counter', '12954', '', now(), now(), NULL , NULL ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Display Emails', 'DISPLAY_WISHLIST_EMAILS', '5', 'How many emails to display when the customer emails their wish list link', '12954', '', now(), now(), NULL , NULL ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Display Wish List After Adding Product', 'WISHLIST_REDIRECT', 'Yes', 'Display the Wish List after adding a product (or stay on product_info.php page)', '12954', '', now(), now(), NULL , 'tep_cfg_select_option(array(\'Yes\', \'No\'),' ); If you don't want to run the SQL again just search for WISHLIST_REDIRECT and edit the text to the above and change "No" to "Yes". That should now take care of "BUG 2". Edited February 7, 2015 by Tsimi Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 7, 2015 (edited) Regarding BUG 1: Here is the update code part just in case someone wants to take a look at it without downloading the package. /******************************************************************* ****************** UPDATE WISH LIST QUANTITY *********************** *******************************************************************/ if (isset($_POST['wlaction']) && $_POST['wlaction'] == 'update_qty') { for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (isset($_POST['quantity'][$products[$i]['id']]) && is_numeric($_POST['quantity'][$products[$i]['id']])) { $qty = (int)$_POST['quantity'][$products[$i]['id']]; if ($qty < 1) { // remove if quantity is 0 or less $wishList->remove($products[$i]['id']); } elseif ($qty != $products[$i]['quantity']) { // update if quantity has changed $wishList->update_quantity($products[$i]['id'], $qty, $products[$i]['attributes']); } } } print_r($_POST); echo '<br><br><br><br>'; print_r($products); tep_redirect(tep_href_link(FILENAME_WISHLIST, $pg)); // reload updated wish list } and further above is this code $pg = (isset($_GET['page']) ? 'page=' . $_GET['page'] : ''); Edited February 7, 2015 by Tsimi Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 7, 2015 UPDATE: I think i solved BUG 1 or at least I know now why it is showing the array stuff that i posted above. in the wishlist.php is the following code print_r($_POST); echo '<br><br><br><br>'; print_r($products); deactivating that like this //print_r($_POST); echo '<br><br><br><br>'; print_r($products); solves the issue and I can update the products quantity. I just don't know how vital that piece of code is and if it is OK to deactivate or even delete. I have tested other functions of the wish list and so far everything seems to be fine. I will keep testing a bit more just to make sure though. Share this post Link to post Share on other sites
♥Dan Cole 546 Posted February 7, 2015 @@Tsimi I think those print_r statements were likely just there for debugging purposes so whoever put them there could see the data in the arrays. That would be my guesss... Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 7, 2015 (edited) @@Tsimi I think those print_r statements were likely just there for debugging purposes so whoever put them there could see the data in the arrays. That would be my guesss... Dan @@Dan Cole Hi Dan Thanks for the input. :thumbsup: Yeah I think so too. Did more research on that print_r matter and it seems like this is mostly used to debbug or test code. Probably forgotten by the previous coder. I didn't delete it just deactivated it with // just in case. I tested all functions that I can think of and the wish list works just fine on my local and real server now. I repacked everything and uploaded it to the addons area. This includes the bug fix 1 and 2 and small adjustments to the wishlist.php code. http://addons.oscommerce.com/info/8665 Edited February 7, 2015 by Tsimi 2 Mort-lemur and altoid reacted to this Share this post Link to post Share on other sites
razgre 3 Posted February 9, 2015 I installed your package and works fine except when customer has items in wish list and logged in. When add 1 item to cart and return it doesn't show the other items and say for item is added to chat "NO longer is available and item is in chart" I will try to find the problem but any help will be appreciated. images attached to understand better. Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 9, 2015 (edited) Which package did you download and install? The package from the addons area or the one posted in the first post here? Did you download the Bootstrap version? The reason i ask is in your image the pagination is not bootstrapped. I have the same issue in one of my test shops. I have a custom mini shopping cart inside the header and the wishlist addon recognizes that and does the same thing as in your case. Edited February 10, 2015 by Tsimi Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 Another thought, do you have the shopping cart box installed in the left or right column? If yes try to deactivate the box once and see if that solves the issue. Share this post Link to post Share on other sites
razgre 3 Posted February 10, 2015 Thanks for answer. I downloaded for http://addons.oscommerce.com/info/8665 ( Wish List revision 3 for osC 2.3.4 BS GOLD) for your info, my site is bootstrapped but not GOLD. 1 Tsimi reacted to this Share this post Link to post Share on other sites
razgre 3 Posted February 10, 2015 I have a custom mini shopping cart inside the header Share this post Link to post Share on other sites
razgre 3 Posted February 10, 2015 I just message (IMed) you the shop that I am working with. You can create an account or check it out. Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 I have a custom mini shopping cart inside the header That will be probably the reason why the wishlist shows that message. I am working on a workaround but i am not done yet. As soon i get back at the office today i will see what i can do. Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 for your info, my site is bootstrapped but not GOLD. That doesn't matter as long it is a Bootstrap version. Share this post Link to post Share on other sites
razgre 3 Posted February 10, 2015 That will be probably the reason why the wishlist shows that message. I am working on a workaround but i am not done yet. As soon i get back at the office today i will see what i can do. Thank you so much. I am trying to find if there is something i can change. If I find any I will share with you. 1 Tsimi reacted to this Share this post Link to post Share on other sites
grandpaj 25 Posted February 10, 2015 (edited) @@Tsimi Hi Lambros Just added your wishlist (well done) to my site and get the following message when uploaded SQL Error SQL query: INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function )VALUES ( '', 'Max Wish List Box', 'MAX_DISPLAY_WISHLIST_BOX', '4', 'How many wish list items to display in the infobox before it changes to a counter', '12954', '', now( ) , now( ) , NULL , NULL ); MySQL said: #1062 - Duplicate entry '0' for key 'PRIMARY' Do I need to do anything or should everything be OK. Many thanks John Edited February 10, 2015 by grandpaj Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 @@grandpaj Hi John Try to run the SQLs separately. Make sure you got the customer_wishlist and customer_wishlist_attributes table already. Go to your configuration_group table and look if there is a new field with the configuration_group_id 12954. If yes then leave it as is and check your configuration table for anything that has been added today and contains the word WISH. Delete those fields and run the following SQL INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Max Wish List', 'MAX_DISPLAY_WISHLIST_PRODUCTS', '10', 'How many wish list items to show per page on the main wishlist page', '12954', '', now(), now(), NULL , NULL ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Max Wish List Box', 'MAX_DISPLAY_WISHLIST_BOX', '4', 'How many wish list items to display in the infobox before it changes to a counter', '12954', '', now(), now(), NULL , NULL ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Display Emails', 'DISPLAY_WISHLIST_EMAILS', '5', 'How many emails to display when the customer emails their wish list link', '12954', '', now(), now(), NULL , NULL ); INSERT INTO configuration ( configuration_id , configuration_title , configuration_key , configuration_value , configuration_description , configuration_group_id , sort_order , last_modified , date_added , use_function , set_function ) VALUES ( '', 'Display Wish List After Adding Product', 'WISHLIST_REDIRECT', 'Yes', 'Display the Wish List after adding a product (or stay on product_info.php page)', '12954', '', now(), now(), NULL , 'tep_cfg_select_option(array(\'Yes\', \'No\'),' ); Share this post Link to post Share on other sites
grandpaj 25 Posted February 10, 2015 (edited) @@Tsimi Hi Lambros Thanks for your reply. Here's what Ive got. 0 Max Wish List MAX_DISPLAY_WISHLIST_PRODUCTS 10 How many wish list items to show per page on the m... 12954 0 2015-02-10 16:28:02 2015-02-10 16:28:02 NULL NULL Installed Modules MODULE_ACTION_RECORDER_INSTALLED ar_admin_login.php;ar_contact_us.php;ar_reset_pass... List of action recorder module filenames separated... 6 0 2015-01-29 10:03:33 2014-12-31 14:21:35 NULL NULL 697 Enable Wish List Box Module MODULE_BOXES_WISHLIST_STATUS True Do you want to add the module to your shop? 6 1 NULL 2015-02-10 16:28:40 NULL tep_cfg_select_option(array('True', 'False'), 698 Content Placement MODULE_BOXES_WISHLIST_CONTENT_PLACEMENT Left Column Should the module be loaded in the left or right c... 6 1 NULL 2015-02-10 16:28:40 NULL tep_cfg_select_option(array('Left Column', 'Right ... 699 Sort Order MODULE_BOXES_WISHLIST_SORT_ORDER 5000 Sort order of display. Lowest is displayed first. 6 0 NULL 2015-02-10 16:28:40 NULL NULL 700 Minimum Minutes Per E-Mail MODULE_ACTION_RECORDER_WISH_LIST_EMAIL_MINUTES This whats in the SQL Config. Should I leave or delete and use the code you posted above. Love the addon. Cheers John Edited February 10, 2015 by grandpaj Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 (edited) Remove/Drop only the MAX_DISPLAY_WISHLIST_PRODUCTS field and re-run the SQL i posted above. Edited February 10, 2015 by Tsimi Share this post Link to post Share on other sites
grandpaj 25 Posted February 10, 2015 @@Tsimi Hi Lambros All seems to be good now. No red "panels" after upload. Just a thought, would it be possible to place the Wish List box in the Footer. Cheers John Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 You mean the whole contents of the box inside the footer? or just the My Wishlist link? Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 10, 2015 (edited) @@grandpaj Here is the content module for the footer area. Just place the files in there place and install the content footer module in the admin area Modules -> Content -> "Install Module" button Please test this before using in a live store, i just created it quickly and didn't had time to test it thoroughly. Download: Wishlist_Footer_Module.zip Edited February 10, 2015 by Tsimi Share this post Link to post Share on other sites
grandpaj 25 Posted February 10, 2015 @@Tsimi Hi Lambros Cheers for that. Seems to work OK. Will try further Kind regards John Share this post Link to post Share on other sites
razgre 3 Posted February 10, 2015 Thank you so much. I am trying to find if there is something i can change. If I find any I will share with you. @Tsimi Have you had a chance to find any answer? I couldn't be able so far ... Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 11, 2015 (edited) @@razgre Hi Raz Sorry, no solution that works yet. Still trying to figure out how the wishlist is build up. Not really sure but i think the catalog/includes/classes/wishlist.php might be the key. The wishlist is build up in a similar if not same fashion as the shopping cart page it uses the same checking function. example this one ($wishList->count_contents() > 0) the shopping cart uses ($cart->count_contents() > 0) i guess the wishlist and the shopping cart cannot be called on one page otherwise we end up with the situation that we have now. I will keep looking to find a way to get this working since it is also in my interest since i use also a mini cart inside the header. There is a "temporary" solution though. Not beautiful but it does the trick "for now". Inside your header.php you could change the cart icon into a button that redirects to the shopping cart if clicked. Example; <?php if ($PHP_SELF == 'wishlist.php') { echo '<a class="btn btn-block btn-lg" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><i class="icon-basket-1 icon-large"></i></a>'; } else { SHOW YOUR MINI CART CODE } ?> That should fix it till we get a better solution. Edited February 11, 2015 by Tsimi Share this post Link to post Share on other sites