Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wishlist 2.0 Support Thread


defender39

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:

Link to comment
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.

Link to comment
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 //-->

Link to comment
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.

Link to comment
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...

Link to comment
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

Link to comment
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!

Link to comment
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.

Link to comment
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?

Link to comment
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;

Link to comment
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.

Link to comment
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 :'(

Link to comment
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

Link to comment
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!!!!

Link to comment
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.

Link to comment
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.

Link to comment
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.

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