Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wishlist 2.0 Support Thread


defender39

Recommended Posts

You got something wrong if it still added to the favs list when u push add to wishlist with that favs code taken out of app top. There is something else wrong... Are you querying the right table on favs.php? You have to overlooking something else for it to act that way.

 

-Dennis

Link to comment
Share on other sites

Actually now it works well :

 

- When I push on the button "add to wishlist" the product is added only to the wishlist.

 

- When I push on the button "add to favourites list" the product is added only to the favourites list.

 

The product is registered to the correct table.

 

wishlist and favourites list have separate distinct tables.

 

So.... what do you think?

OSC2.2

Link to comment
Share on other sites

Actually now it works well :

 

- When I push on the button "add to wishlist" the product is added only to the wishlist.

 

- When I push on the button "add to favourites list" the product is added only to the favourites list.

 

The product is registered to the correct table.

 

wishlist and favourites list have separate distinct tables.

 

So.... what do you think?

 

Sorry for the mistake...

 

Add to cart doesn't work from wishlist.php and favs.php pages...

 

I'm gonna check this and be back to post the results...

OSC2.2

Link to comment
Share on other sites

Well to avoid problems due to removing functions from application top, I just took of

      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;
             }
 }    

 

from application top to wishlist.php. Now :

 

- when I push on add to wishlist button the product is added to both wishlist & favs list

- when I push on add to favsbutton the product is added to favs list.

 

The add to cart & remove from the list functions works fine too!!!

 

It suits me as I can't have something perfect.

 

Thanks for your help Dennis!! :D

OSC2.2

Link to comment
Share on other sites

Jb:

 

First off Happy New Years! Secondly, thanks for adding that fix, it helped my problem of being redirected to the login page everytime I pressed 'Add to Wishlist.'

 

Now that I'm at the Wishlist, I can only see that I'm 'Displaying 1 to 5 (of 5 items on your wishlist)' . I can't seem to figure out why the products or the name of these products aren't showing. Although this doesn't matter too much, on the right column I can also see that I 'Currently 5 items are on your Wishlist.'

 

Hope you can help!!!

 

Bye,

 

 

Hi

 

I have the same problem aswell, it does not display the products only the quantity in the wishlist.

 

3960AD did you do anyrhing to register globals, like turn them off?

 

Did anybody manage to get a fix for this?

 

Thanks

 

Mike

Link to comment
Share on other sites

ok i have managed to find out what is going on.

 

The products ID is not being passed to the database, any ideas how i can fix this?

 

I installed another module for the wishlist and got rid of this wishlist. but the one of concern to me is better. if you find out how to fix this please send me a note...

 

thanks.

Link to comment
Share on other sites

I installed another module for the wishlist and got rid of this wishlist. but the one of concern to me is better.  if you find out how to fix this please send me a note...

 

thanks.

 

 

Hi

 

Do you have register globals turned off? let me know so then i can narrow down the problem, i am pretty sure it has got something to do with register globals.

 

Cheers

Link to comment
Share on other sites

Okay Guys and Gals -

 

Here's the code fix for the problems with new sessions being created whenever "Add To Wishlist" is clicked in Version 2.3 (and coincidentally the Attributes Handler Add-on).

 

Original Wishlist V2.3 Contribution Code in Products_info.php is this:

 

<?php echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. FILENAME_WISHLIST . '\';document.cart_quantity.submit();"'. ' action=add_wishlist'); ?>

 

You need to change to this:

 

<?php echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. tep_href_link(FILENAME_WISHLIST) . '\';document.cart_quantity.submit();"'. ' action=add_wishlist'); ?>

 

The solution is wrapping the FILENAME_WISHLIST in the tep_href_link() function - the default hyperlink function for passing all filenames in OSCommerce - please note for future when inserting any hyperlinks in your OSC stores they need this function to work properly.

 

I hope this fixes everybody elses prob's with sessions being lost from the Hidden form submission.

 

Just to note - this contribution defaults to log_in.php as default and you need to deprecate all instances of If Session is registered - not a small task for newbies like me.

 

Regards,

JB

 

Just to say - many thanks for your efforts. This certainly fixed it for me.

 

Cheers - and have a great 2005. :thumbsup:

Edited by Gwyn
Link to comment
Share on other sites

As far as i see, there is not globals for the wishlist, so what you will need to do is do a query of the customers id and the wishlist table to see if they have anything in the table, if they do show the wishlist, if not dont show it. Just like the wishlist.php page does when nothing is in there wishlist. That should get you started ;)

Link to comment
Share on other sites

That should get you started

:blink:

Because I'm a PHP newbie I have no idea how to get it done...

Would somebody be so kind to post the codeline :huh:

 

I think many people would like such a feature.

Don't we all agree empty boxes in a shop are ugly?

Link to comment
Share on other sites

Major pain, I have installed this contribution a few times in the last few days everything works except the wishlist.php doesnt show the products I have added to it, my info box does show a list of added products, but the link to wishlist shows nothing in it, why? :'(

 

My site is www.easypcs.co.uk very weird I ant see the problems I have added exactly what is needed but no joy, plz anyone any thoughts or previous problems with wishlist.php not showing added products?

Link to comment
Share on other sites

Major pain, I have installed this contribution a few times in the last few days everything works except the wishlist.php doesnt show the products I have added to it, my info box does show a list of added products, but the link to wishlist shows nothing in it, why? :'(

 

My site is www.easypcs.co.uk very weird I ant see the problems I have added exactly what is needed but no joy, plz anyone any thoughts or previous problems with wishlist.php not showing added products?

 

Joker

 

Do you have register globals turned off? I had the same issue, if you look at your wishlist table in the db has the product id been passed/stored?.

 

 

Has anybody got the wishlist button working from any other pages except the product_info page.. IE new_products or any page which shows multiple items. Have been trying to get it to work with no luck :angry:

 

Thanks

 

Mike

Edited by Mighty Mike
Link to comment
Share on other sites

Register globals on the server are off, however I have a php.ini file installed to the root of the site with register_globals = on in it which allows the site to work. :'(

 

This is the only thing I have wrong with the site now, which is not allowing me to launch the site, I may have to rmove it altogether, which isnt what I want.

 

Everuthing is being stored in sql as the infobox shows the stored wishlist items but not the wishlist page?

 

Thx for any help

Edited by j0ker
Link to comment
Share on other sites

Joker

 

Have a look at these two threads, if the server has register globals off and your php.ini is on this could/will cause problems.

 

I had the problem where my infobox would say you have 3 items on your wishlist, but when you go to the wishlist nothing was displayed.

 

http://www.oscommerce.com/forums/index.php?act=ST&f=7&t=93343

 

http://www.oscommerce.com/forums/index.php?act=ST&f=11&t=133331

 

Hope the above helps you out.

 

Thanks

 

Mike

Link to comment
Share on other sites

Ok I tried reinstalling this mod and I get this error now....

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-6, 6' at line 1

 

select * from customers_wishlist where customers_id = '2' order by products_name limit -6, 6

 

Any suggestions???

Link to comment
Share on other sites

what did you do to fix it??

 

The Solution I have found that works for me and to date I have seen any side effects is in: catalog/includes/application_top.php

 

Just below this code

      // performed by the 'buy now' button in product listings and review page
     case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {

Delete or stop these functions like this. (these lines in the Contribution says to put them in, but all I ever experience was trouble with them.)

                                // Wish List 2.3 Start
//                                if (tep_session_is_registered('customer_id')) {
//                                  tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id");
//                                  tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id=$products_id");
//                                }
                               // Wish List 2.3 End

Link to comment
Share on other sites

When someone uses the form "buy now" then if they have the product in there wishlist, it will remain there as that was the code to delete it out. I don't really know why that code would cause you any problems... But its just a small thing as most likely if people use there wishlist they will buy from that and not the product listing pages.

 

Dennis

Link to comment
Share on other sites

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...