Jump to content
defender39

Wishlist 2.0 Support Thread

Recommended Posts

Problem:

 

Displaying 1 to 2 (of 2 items on your wishlist) Result Pages: 1 and the Wishlist is empty

 

 

/includes/application_top.php

 

change code to:

 

case 'add_wishlist' :  if (ereg('^[0-9]+$', $HTTP_GET_VARS['products_id'])) {

                              if ($HTTP_GET_VARS['products_id']) {

                                tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_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("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $HTTP_GET_VARS['products_id'] . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )");

                              }

                            }

                            tep_redirect(tep_href_link(FILENAME_WISHLIST));

                            break;

 

 

regards

rainer :unsure:

Share this post


Link to post
Share on other sites
Hey all,

 

  I have just upload an update to Wishlist 2.0 which allows you to send a link to your wishlist instead of the individual links to products. Your friend can now simply add your items right to their cart. I also included my shopping_cart.php which places the wishlist right below the cart total.

 

Let me know what you think, or of any problems in the process...

 

Love the fact that the e-mail is written up automatically. The origional sends nothing to the friend if there are no comments.

 

However, there was a server error when trying to look at the person's wishlist. Doesn't seem to be able to bring it up at all.

Share this post


Link to post
Share on other sites
Love the fact that the e-mail is written up automatically. The origional sends nothing to the friend if there are no comments.

 

However, there was a server error when trying to look at the person's wishlist. Doesn't seem to be able to bring it up at all.

 

 

desireden,

 

 

Sorry about that, I had created the link for my store which at the time was using search engine friendly URL's. Use the below code instead...

 

catalog\wishlist_email.php

 

<!-- header_eof //-->
<?
 $wishliststring = FORM_FIELD_TEXT_AREA;

 $wishliststring .= HTTP_SERVER . DIR_WS_CATALOG . "wishlist.php?customers_id=" . (int)$customer_id . "\n\n";
?>
<!-- body //-->

Share this post


Link to post
Share on other sites

P.S. If you would like to see it in action, take a look here. Keep in mind this is a live store.

 

User ID: email@yahoo.com

Password: joeuser

Share this post


Link to post
Share on other sites

Uploaded your code again, and changed the snippet of code that wasn't working. I'm now getting 25 items on the wishlist that were not put there, nor are able to be deleted or moved???

Share this post


Link to post
Share on other sites
desireden,

  Sorry about that, I had created the link for my store which at the time was using search engine friendly URL's. Use the below code instead...

 

Not getting that error anymore. Thanks. ;) However I have noticed that using your wishlist.php, I am getting 25 or 26 items showing up in the wishlist.php, and nothing in there that I selected. However, the box on the side show the appropriate wish list.

Share this post


Link to post
Share on other sites
desiredin,

 

are you getting these 25 on my site or yours?

 

I'm getting them on my site. Works fine with the other wishlist codes, but for some reason, it is not working with your's. Heh. But your's is the only one I want. ;)

Share this post


Link to post
Share on other sites
I am using 2.2-MS 2 and contribution posted on 7 May 2004 (Wish List v22c MS2.zip).

 

So...how can I fix this? Am I totally missing something? I've read this thread what seems like a million times...

 

Any help is appreciated.

 

I was also getting lost with those line separator. In fact, they were adding extra </td></tr> tags that were messing my display up.

 

in includes/boxes/wishlist.php find:

 

' <a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b></td>' . "\n" .

tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td></tr>' . "\n";

 

I changed it to just:

 

' <a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b></td>' . "\n";

 

and everything seemed to work. I didn't get any SQL errors while doing this though...

Share this post


Link to post
Share on other sites

I was wondering if the wishlist contribution could be fixed to work with clients that do not sign in. Maybe using the "Purchase Without Account" contrib. i'm guessing not, but might as well ask...

Share this post


Link to post
Share on other sites
Problem:

 

Displaying 1 to 2 (of 2 items on your wishlist) Result Pages:  1 and the Wishlist is empty

/includes/application_top.php

 

change code to:

regards

rainer  :unsure:

 

 

amspo,

 

I am having a problem getting anything to show in the wishlist. It does as everyone else's does, and displays the line showing 1 to 2 of 2 etc...

 

I tried your code change amspo, but still nothing working. Does anyone have a solution for this? I would really love to get this working as I think it will be a great addition.

 

Everything else about the contrib "seems" to be in good order, I haven't tested it much since I can't see the stuff in the wishlist.

 

Thanks for the help,

Doug


A man who works with his hands is a laborer

A man who works with his hands and his brain is a craftsman

But a man who works with his hands and his brain and his heart is an artist. - Charles Dickens

Share this post


Link to post
Share on other sites

I've installed the WishList 2.0 at http://www.audiocave.com.au But I have a big bug.

 

If someone is logged in and they goto the product page and add a product to their wish list, it works fine.

 

BUT if they add it once their session has timed out, they are redirected to login. Then they can login again and the product is in their wish list. Here's the problem: you can't delete this item or move it to the shopping cart. After further investigation, ALL users will now have this item in their wishlist, and cannot delete/move to cart.

 

I looked at the SQL table, and the customer_id field in the customer_wishlist table is set to 0.

 

Does anyone know how to get around this bug? Thanks heaps!

Share this post


Link to post
Share on other sites
If someone is logged in and they goto the product page and add a product to their wish list, it works fine.

Here's the problem: you can't delete this item or move it to the shopping cart.  After further investigation, ALL users will now have this item in their wishlist, and cannot delete/move to cart.

 

I looked at the SQL table, and the customer_id field in the customer_wishlist table is set to 0.

 

Does anyone know how to get around this bug?  Thanks heaps!

 

 

My guess is that you need to add an extra check before displaying it. Maybe in includes/column_right.php (or column_left.php, wherever you have it)

 

if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'wishlist.php');

becomes:

if ((tep_session_is_registered('customer_id')) and ('customer_id'>0)) include(DIR_WS_BOXES . 'wishlist.php');

 

I don't have time to test it right now, but you can try. Maybe it's $customer_id instead of 'customer_id'. I don't know. Hope this is a good starting point for your solution.

Share this post


Link to post
Share on other sites

jorgeo

 

Thanks for the help...but it won't work. Basically because when the user loads the page, they will already be logged in. All customers already have an ID of greater than 0 so the wishlist will display. If the session times out, exactly the same thing is going to happen, they will be diverted to the login page and the SQL entry will have a customer_id of 0.

 

Any other ideas?

Share this post


Link to post
Share on other sites

worked it out :D

 

Used jorgeo's idea but put it into application_top (where the process actually occurs). This is my new coding for case 'add_wishlist':

 

// Add product to the wishlist

      case 'add_wishlist' :  if (ereg('^[0-9]+$', $HTTP_GET_VARS['products_id'])) {

                                if ($HTTP_GET_VARS['products_id']) {

                                if ($customer_id > 0) {

                                  tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_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_redirect(tep_href_link(FILENAME_WISHLIST));

                              break;

Share this post


Link to post
Share on other sites

Just wondering if there's any way to incorporate attributes into the wishlist? So you can select what colour you want the product on the product page, and then add it to the wishlist. On the emails it would include these attributes too. Also when you move the product to the cart.

Share this post


Link to post
Share on other sites
Just wondering if there's any way to incorporate attributes into the wishlist?

 

I think that would include creating a new table wishlist_products_attributes, extremely similar to orders_products_attributes (if not exactly the same). Then you would replace the field "orders_id" with "wishlist_id". This involves putting an identifier colum in the table customers_wishlist, it currently doesn't have a field "wishlist_id" (or any row identifying field in any case)

 

Instead of having the button add a product to the wishlist, you would have a form (maybe make the "add to wishlist" button be another submit button inside the product's already created form?) with all the product attributes.

 

Then, on wishlist.php (the target of the currently implemented wishlist button) you add an entry for the product in the customers_wishlist table as usual, retrieve the wishlist_id identifier for the entry you just added, and then fill up the wishlist_products_attributes table with any attributes sent by the form and that identifier.

 

When displaying or sending wishlist emails, you would make a bunch of cross-table select statements to relate the products in the wishlist with their respective attributes.

 

Maybe I should just try to implement it instead of coming up with instructions :P But I have a digital signal processing exam coming up pretty soon :'(

Share this post


Link to post
Share on other sites
I think that would include creating a new table wishlist_products_attributes, extremely similar to orders_products_attributes (if not exactly the same). Then you would replace the field "orders_id" with "wishlist_id". This involves putting an identifier colum in the table customers_wishlist, it currently doesn't have a field "wishlist_id" (or any row identifying field in any case)

 

Instead of having the button add a product to the wishlist, you would have a form (maybe make the "add to wishlist" button be another submit button inside the product's already created form?) with all the product attributes.

 

Then, on wishlist.php (the target of the currently implemented wishlist button) you add an entry for the product in the customers_wishlist table as usual, retrieve the wishlist_id identifier for the entry you just added, and then fill up the wishlist_products_attributes table with any attributes sent by the form and that identifier.

 

When displaying or sending wishlist emails, you would make a bunch of cross-table select statements to relate the products in the wishlist with their respective attributes.

 

Maybe I should just try to implement it instead of coming up with instructions  :P But I have a digital signal processing exam coming up pretty soon  :'(

 

 

 

jorgeo,

 

1st let me say good luck on the exam,

2nd I would love it if you could implement this, I know I would be the 1st to try it out, as my website is all about the different attributes you can have on your product.

 

If you decide to do this, and need a tester PLEASE let me know!

 

Doug


A man who works with his hands is a laborer

A man who works with his hands and his brain is a craftsman

But a man who works with his hands and his brain and his heart is an artist. - Charles Dickens

Share this post


Link to post
Share on other sites

PHP newb here. I bet you love hearing those words :P

 

I'm not totally new, I am getting better with PHP so I might not be a lost cause.

 

Anyway, I would like to have the add to wishlist button displayed even when you're not logged in. Of course when they click on it I would want them redirected to the log in page.

 

Can someone give me a hand with that?

 

PS-Great contrib by the way, even if I can't get the above done it's still great as is.

Edited by xPATRIOTSx

Go New England Patriots!!!!

Share this post


Link to post
Share on other sites

Well, it seems that the store I'm working for mostly deals with downloadable products, which are implemented as attributes in oscommerce, so I might do the Wishlist with attributes addition to this contribution anyways. I'll keep you guys posted.

Share this post


Link to post
Share on other sites
Well, it seems that the store I'm working for mostly deals with downloadable products, which are implemented as attributes in oscommerce, so I might do the Wishlist with attributes addition to this contribution anyways. I'll keep you guys posted.

 

 

 

Jorgeo,

 

Please keep us posted, if you need testers I am there. My PHP skills are ummm...well lets just not go there LOL, but I am more than willing to try anything out.


A man who works with his hands is a laborer

A man who works with his hands and his brain is a craftsman

But a man who works with his hands and his brain and his heart is an artist. - Charles Dickens

Share this post


Link to post
Share on other sites

Ok guys, I have the first alpha version of Wish List with Attributes running.

 

Done so far:

- Move product with attributes to wish list from the products page

- Move product with attributes from wish list infobox to Shopping Cart

 

Still to do:

- List product attributes in My Wish List page

- Move multiple products from My Wish List page into cart

- Delete multiple products from My Wish List page

- Document all changes in a human-readable way (as opposed to scribbles in a stained piece of paper)

- Step by step instructions on adding changes AND/OR

- Step by step instructions to install from scratch

 

Might not do:

- Support multiple instantiations of same product with different attributes inside wish list (currently only 1 product type, overrides previous attributes)

- Include attributes in email (I'm not using the "make your friend's wishlist your own wishlist" for the store I'm working on though)

 

 

Some oddities:

-"Buy now" and "Order History - In cart" buttons for products with attributes still takes you to the product page for you to select them.

 

 

Oh, and I did pretty well on my exam :thumbsup: Thanks for the support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×