Guest Posted April 26, 2003 Share Posted April 26, 2003 Here's what it took to get it working for me in Version 2.2-MS1.... the first is an entire change of the mod to product_info.php, the second only a slight change to the 'add' in application_top.php.... all other changes remain the same other than the missing curly bracket in column_right.php... Enjoy! //changes to Wishlist by JOHNSON - version 2.2-MS1 //product_info.php <?php } ?> <tr> <td><br><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="left" class="main"><a href="<? echo tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS); ?></a></td> <td align="center" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></form></td> <td align="right" class="main"><?php echo tep_draw_form('wishlist_quantity', tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist')); ?> <?php if (tep_session_is_registered('customer_id')) echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST); ?> </form></td> </tr> </table></td> </tr> <tr> <td><br> // application_top.php // Add product to the wishlist case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); } } break; Quote Link to comment Share on other sites More sharing options...
iamcanadian2 Posted April 28, 2003 Share Posted April 28, 2003 Was anyone able to solve this problem?? 1064 - You have an error in your SQL syntax near '' at line 1 delete from customers_wishlist WHERE customers_id=17 AND products_id= [TEP STOP] This is the error I get when logged in and trying to use the "Buy Now" or when I try to delete from the wishlist. The "Buy Now" works fine when not logged in. Thanks Quote Link to comment Share on other sites More sharing options...
ptrau Posted April 28, 2003 Share Posted April 28, 2003 Thank you......Thank you......Thank you......Thank you......The thing FINALLY works now. Here's what it took to get it working for me in Version 2.2-MS1.... the first is an entire change of the mod to product_info.php, the second only a slight change to the 'add' in application_top.php.... all other changes remain the same other than the missing curly bracket in column_right.php... Enjoy! //changes to Wishlist by JOHNSON - version 2.2-MS1 //product_info.php <?php } ?> <tr> <td><br><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="left" class="main"><a href="<? echo tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS); ?></a></td> <td align="center" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></form></td> <td align="right" class="main"><?php echo tep_draw_form('wishlist_quantity', tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist')); ?> <?php if (tep_session_is_registered('customer_id')) echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST); ?> </form></td> </tr> </table></td> </tr> <tr> <td><br> // application_top.php // Add product to the wishlist case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); } } break; Quote "Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!" Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2003 Share Posted June 7, 2003 Does anyone know away that the Wishlist box will only appear if you add a product to the wish list rather then always be present? something along these line that I got from Linda McGrath for my shopping cart -- in includeds/column_right.php so my cart only shows on screen once a product has been added........ if ($cart->count_contents() >= 1) { require(DIR_WS_BOXES . 'shopping_cart.php'); } Im guessing something along these lines: if (tep_session_is_registered('customer_id')){ if ($wishlist->count_contents() >= 1) include(DIR_WS_BOXES . 'wishlist.php'); } but that dont work because $wishlist in not a function, and im clueless. can this be done? Quote Link to comment Share on other sites More sharing options...
Scotty Posted April 25, 2004 Share Posted April 25, 2004 Was anyone able to solve this problem?? 1064 - You have an error in your SQL syntax near '' at line 1 delete from customers_wishlist WHERE customers_id=17 AND products_id= [TEP STOP] I have the exact same problem. But it only happens when I try to delete a product from the wishlist. Any ideas on how to solve this problem? Otherwise a great and useful contrib. TIA, Scotty Quote Link to comment Share on other sites More sharing options...
ned Posted March 29, 2005 Share Posted March 29, 2005 I've found this contribution most useful but there is one small feature I'd like to see. At the moment the wishlist shows the price of an item without tax, is there any way to make it show the tax inclusive price? Thanks Neil Quote Link to comment Share on other sites More sharing options...
Guest Posted April 12, 2005 Share Posted April 12, 2005 I am getting this error because of wish list. Can someone tell me what file it is coming from and what they think will fix it? 1064 - You have an error in your SQL syntax near '' at line 1 delete from customers_wishlist WHERE customers_id=3 AND products_id= [TEP STOP] Thanks George Quote Link to comment Share on other sites More sharing options...
surajk42 Posted April 16, 2005 Share Posted April 16, 2005 I am getting this error when i click on "view my wihslist". I searced everywhere but cant solve this. Please help 1064 - You have an error in your SQL syntax near 'select * from customers_wishlist WHERE customers_id=2 order by products_name) as' at line 1 select count(select * from customers_wishlist WHERE customers_id=2 order by products_name) as total [TEP STOP] Quote Link to comment Share on other sites More sharing options...
Guest Posted August 1, 2005 Share Posted August 1, 2005 Since I added QT Pro 4.1, product attributes don't get added into the wishlist created using Wishlists. This leads to all kinds of havoc. Thanks to osCommerce, I'm learning a lot about PHP and getting pretty good at customizing the store. But QT Pro's under-the hood stuff is bewildering to me -- I'm only good enough to realize that my array and regular expression chops aren't nearly good enough to figure out how it works. Has anyone figured out how to update the customers_wishlist_attributes table using the QT Pro engine? --Mike Quote Link to comment Share on other sites More sharing options...
Guest Posted August 1, 2005 Share Posted August 1, 2005 Since I added QT Pro 4.1, product attributes don't get added into the wishlist created using Wishlists. This leads to all kinds of havoc. Aha! In the QT Pro forum I found this: In catalog/includes/application_top.php, replace this: $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); // Read array of options and values for attributes in id[] if (isset ($id)) { foreach($id as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } } break; with this: $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); //++++ QT Pro: Begin Changed code $attributes=array(); if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); foreach ($attrlist as $attr) { list($oid, $oval)=explode('-',$attr); if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) $attributes[$oid]=$oval; } } if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { foreach ($HTTP_POST_VARS['id'] as $key=>$val) { if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) $attributes=$attributes + $HTTP_POST_VARS['id']; } } // Read array of options and values for attributes in id[] foreach($attributes as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } break; The one over there had an extra closing brace before the break that I had to remove, but once that was done the problem was fixed. Thank God for ralphday because I can't make head or tail of how QT Pro works. --Mike Jennings 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.