Jump to content
defender39

Wishlist 2.0 Support Thread

Recommended Posts

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,

 

Yes - strange that - the penny only dropped for me when my server was upgraded and all my old style poorly coded "Relative Pathway" links (ie a <href"\login.php">)  started breaking sessions - very stressful as my modified quick search box (in a form) automatically logged the user out - not very cool for customer appreciation !

 

It just seemed to change overnight coz my server provider neglected to tell me about the upgrade !!

 

Anyway using the tep_href_link() function is good programming so better to be a good coder than wing it !

 

The learning curve sometimes seems vertical, eh !

 

Regards

JB

Share this post


Link to post
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,

 

Log into phpmyadmin, and manually delete the blank products out of your wishlist table that have been added. Once you do that you will be fine.

Share this post


Link to post
Share on other sites
Log into phpmyadmin, and manually delete the blank products out of your wishlist table that have been added.  Once you do that you will be fine.

 

 

blake:

 

i did the following....went to the 'customers wishlist' table in phpmyadmin. then ran this query.. SELECT * FROM `customers_wishlist`.... then I deleted all 5 entries....and it still didn't work.... did i delete the correct data. also, when i added 2 more entries to wishlist and did that same query i seem to get a '?' in the column with a ' <-- T ---> ' on top . This column is right before the 'product id' one, which btw is empty. any advice??

 

thanks for your prompt response...

Share this post


Link to post
Share on other sites
Ok I am just throwing this together so if it doesn't work let me know and I will fix it.

 

On the top of your wishlist page you have some code that sets a snapshot. The  Using that code where going to add code into login.php.

 

Add this code just below

 ?if ($error == true) {
? ?$messageStack->add('login', TEXT_LOGIN_ERROR);
?}
// Added for wishlist.php
if ($navigation->snapshot['page'] == FILENAME_WISHLIST) {
? ? $messageStack->add('login', TEXT_WISHLIST_ERROR);
}
//End add for wishlist.php

 

Obviously the "TEXT_WISHLIST_ERROR" you will have to set to whatever you want in your language file.

 

-Dennis

 

Great code David - just for Clarification - the second part shoul go wherever you want it to appear in the Login.php file - am I coorrect - this is what I needed to do to make it appear when I was referred from the wishlist page.

 

 

Many Thanks

 

 

 

JB

Share this post


Link to post
Share on other sites
Ok I am just throwing this together so if it doesn't work let me know and I will fix it.

 

On the top of your wishlist page you have some code that sets a snapshot. The  Using that code where going to add code into login.php.

 

Add this code just below

 ?if ($error == true) {
? ?$messageStack->add('login', TEXT_LOGIN_ERROR);
?}
// Added for wishlist.php
if ($navigation->snapshot['page'] == FILENAME_WISHLIST) {
? ? $messageStack->add('login', TEXT_WISHLIST_ERROR);
}
//End add for wishlist.php

 

Obviously the "TEXT_WISHLIST_ERROR" you will have to set to whatever you want in your language file.

 

-Dennis

 

Great code David -

 

Just for clarification - the second part of the code -

 

// Added for wishlist.php

if ($navigation->snapshot['page'] == FILENAME_WISHLIST) {

$messageStack->add('login', TEXT_WISHLIST_ERROR);

}

//End add for wishlist.php

 

Should go wherever you want it to appear in the Login.php file - am I coorrect - this is what I needed to do to make it appear when I was referred from the wishlist page.

 

 

Many Thanks

 

 

 

JB

Share this post


Link to post
Share on other sites

HHhmmmm....

 

Here is a curious issue. If it was mentioned earlier I missed it. I was not having the problems mentioned with the sessions, or attributes. Everything seemed to be working fine. But here is the problem I now encounter....

 

When you send the wishlist to a friend and include a personal note... everything is fine when the recipient gets the e-mail. BUT... if you DO NOT include a personal note, the wishlist contents ARE NOT shown in the recipients e-mail.

 

Anyone have any suggestions or seen this before? Suggestions on how to fix this issue?

 

Thanks in advance!


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites

Same problem here;

No note = no content :'(

 

Anybody a solution Plz?!?

 

Also I would like to use the same trick as I've used with my shopping cart.

Contri Hide shopping cart when its empty

I'm a PHP newbie :huh:

 

How to implement the code to this line?:

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

 

Thanks in advance

Share this post


Link to post
Share on other sites

Here is the fix.

 

ON wishlist_email.php look for

if (tep_not_null($HTTP_POST_VARS['yourmessage'])) {

 

Below that you should have something like

$email_body .= $HTTP_POST_VARS['yourmessage'] . "\n\n";

 

Then i believe the next line was something like this

$email_body .= $wishliststring . "\n\n";

 

Take that line OUT OF the {}. So your end result will look like this:

 

if (tep_not_null($HTTP_POST_VARS['yourmessage'])) {

$email_body .= $HTTP_POST_VARS['yourmessage'] . "\n\n";

}

$email_body .= $wishliststring . "\n\n";

[/code]

 

-Dennis

Edited by dblake

Share this post


Link to post
Share on other sites

Thanks dblake but that part is outside of the { }

Here's my code

      if (tep_not_null($HTTP_POST_VARS['yourmessage'])) {
       $email_body .= $wishliststring.$HTTP_POST_VARS['yourmessage'] . "\n\n";
     }

     $email_body .= sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n"). "<A HREF=\"".
 HTTP_SERVER . DIR_WS_CATALOG ."\"><h3><i>".STORE_NAME."</A> "."\n";
                    "\n\n" . $mywishlist .= $wishlist_query_array[1] ."\n";

Share this post


Link to post
Share on other sites

<_< , $email_body .= $wishliststring is between { }

But if I move the } before that line there's nothing between the { }

Share this post


Link to post
Share on other sites

I see the problem

 

Change this

      if (tep_not_null($HTTP_POST_VARS['yourmessage'])) {
      $email_body .= $wishliststring.$HTTP_POST_VARS['yourmessage'] . "\n\n";
    }

 

 

To this

 

      if (tep_not_null($HTTP_POST_VARS['yourmessage'])) {
       $email_body .= $HTTP_POST_VARS['yourmessage'] . "\n\n";
     }
 $email_body .= $wishliststring . "\n\n";

Share this post


Link to post
Share on other sites
Also I would like to use the same trick as I've used with my shopping cart.

Contri Hide shopping cart when its empty

I'm a PHP newbie  :huh:

 

How to implement the code to this line?:

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

If I have this and a mod to show option names with the products send in the e-mails this contri would be even more then perfect!

Share this post


Link to post
Share on other sites

Hi Dennis!!

 

You seem to be able to solve every problem with this contribution. Could you have a look to my code and tell me what's wrong with it. I intended to use the wishlist contribution twice : one for the wishlist and the other one for the favourites list.

 

Thanks!

Hi everybody!

 

Need some help with this contribution! I have installed it twice as I use it as a wishlist and as a favourite list.

 

The problem is that when I put an item to my wishlist it is registered to the the wishlist AND to the favourite list! :'(

 

It works the same way when I add a product to my favourite list it is registered both to the favourite list & the wishlist.

 

Here's the piece of code from my application top.

 

 

[COLOR=green]
 case 'cust_order' :    if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
                             if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;
                            
                             //// module viewed products
   case 'viewed_remove' : $viewed->remove();
         break;

/// contrib buy two
 case 'buy_tinn' :   
       if (isset($HTTP_GET_VARS['products_id'])) {
       if (BUY_TWO_DISCOUNT_BUNDLE == 'normal') {
       if ($HTTP_GET_VARS['buy_tinn_add']) {
       $cart->add_cart($HTTP_GET_VARS['buy_tinn_add'],  $cart->get_quantity($HTTP_GET_VARS['buy_tinn_add']) +1);
     }
       if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
       tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .$HTTP_GET_VARS['products_id']));
     } else {
       $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id']) +1);
     }
       } elseif (BUY_TWO_DISCOUNT_BUNDLE =='discount') {
       $bundle_products_id = tep_set_bundle($HTTP_GET_VARS['products_id'],$HTTP_GET_VARS['buy_tinn_add'],BUY_TWO_BUNDLE_DISCOUNT_RATE);
       $cart->add_cart($bundle_products_id, $cart->get_quantity($bundle_products_id) +1);
     }
     }
       tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
     break;
    
/// contrib buy two

// Wish List 2.3 Start
// *****************************************
     // Remove item from the Wish List
     case 'remove_wishlist':
                             tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
                             tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id= '" . $HTTP_GET_VARS['pid'] . "'");
                             tep_redirect(tep_href_link(FILENAME_WISHLIST));
                             break;
                            
       // Remove item from the Favoris List
     case 'remove_favoris':
                             tep_db_query("delete from " . TABLE_FAVORIS . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
                             tep_db_query("delete from " . TABLE_FAVORIS_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id= '" . $HTTP_GET_VARS['pid'] . "'");
                             tep_redirect(tep_href_link(FILENAME_FAVORIS));
                             break;
                            
   } // end switch $HTTP_GET_VARS['action']
 } // end if is set $HTTP_GET_VARS['action']


 // Shopping cart actions through POST variables from forms
 if (isset($HTTP_POST_VARS['wishlist_action'])) {
   // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
   if ($session_started == false) {
     tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
   }

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

     case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
                               if ($HTTP_POST_VARS['products_id']) {
                               if ($customer_id > 0) {
                                 // Read array of options and values for attributes in id[]
                                   if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                                     $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                                   }
                                   tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                   break;
                                 }
                               }
                             }
                             break;
                            
    
                            

     // Wishlist Checkboxes
     case 'add_delete_products_wishlist':
                                     if (isset($HTTP_POST_VARS['add_wishprod'])) {
                                       if ($HTTP_POST_VARS['borrar'] == 0) {
               // 'borrar' form variable refers to deleting products in array $add_wishprod[] from wishlist
                                             foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {
                                                   $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]);
                                                   }
                                             }
                                           tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                       }
                                       if ($HTTP_POST_VARS['borrar'] == 1) {
                                             foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {   
                                                   tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'");
                                                   tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'");
                                                 }
                                             }
                                           tep_redirect(tep_href_link(FILENAME_WISHLIST));
                                       }
                                     }
                                     break;
                                    
      
   }
 }
// end switch ($HTTP_POST_VARS['wishlist_action'])

// *****************************************
// Wish List 2.3 End

// Favoris begin
 //////////////////////////////

 // Shopping cart actions through POST variables from forms
 if (isset($HTTP_POST_VARS['favoris_action'])) {
   // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
   if ($session_started == false) {
     tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
   }

   $goto = basename($PHP_SELF);
   switch ($HTTP_POST_VARS['favoris_action']) {
  
    
     // Customer wants to update the product quantity in their shopping cart
     case 'add_favoris' :  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_FAVORIS . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                                   tep_db_query("insert into " . TABLE_FAVORIS . " (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_FAVORIS_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_favoris_attributes table
                                       tep_db_query("insert into " . TABLE_FAVORIS_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )");
                                     }
                                   }
                                 }
                               }
                             }
                             break;
                            
                            
                            

     case 'favoris_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
                               if ($HTTP_POST_VARS['products_id']) {
                               if ($customer_id > 0) {
                                 // Read array of options and values for attributes in id[]
                                   if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                                     $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                                   }
                                   tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                   break;
                                 }
                               }
                             }
                             break;
                            
    
                            

     // favoris Checkboxes
     case 'add_delete_products_favoris':
                                     if (isset($HTTP_POST_VARS['add_favorisprod'])) {
                                       if ($HTTP_POST_VARS['borrar'] == 0) {
               // 'borrar' form variable refers to deleting products in array $add_favorisprod[] from favoris
                                             foreach ($HTTP_POST_VARS['add_favorisprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {
                                                   $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]);
                                                   }
                                             }
                                           tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                       }
                                       if ($HTTP_POST_VARS['borrar'] == 1) {
                                             foreach ($HTTP_POST_VARS['add_favorisprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {   
                                                   tep_db_query("delete from " . TABLE_FAVORIS . " where products_id = $value and customers_id = '" . $customer_id . "'");
                                                   tep_db_query("delete from " . TABLE_FAVORIS_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'");
                                                 }
                                             }
                                           tep_redirect(tep_href_link(FILENAME_FAVORIS));
                                       }
                                     }
                                     break;
                                    
      
   }
 }

// favoris End

// include the who's online functions[/COLOR]

 

 

... and also the piece of code I use in my product_info, hope someone would be able to bring me some help. Thanks in advance :

 

product info

[COLOR=green]<tr>
                 <td>
                 <div align="right">
                   <?php echo tep_draw_hidden_field('favoris_action', 'add_favoris')
                   . tep_image_submit('button_bookmark.gif', IMAGE_BUTTON_ADD_FAVORIS, 'onClick="document.cart_quantity.action=\''
                   . FILENAME_FAVORIS . '\';document.cart_quantity.submit();"'. ' action=add_favoris'); ?></div>
                 </td>
               </tr>
               <tr>
                 <td>
                 <div align="right">
                   <?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'); ?></div>
                 </td>
               </tr>[/COLOR]

Edited by mujina

OSC2.2

Share this post


Link to post
Share on other sites
What is your problem that your having?

 

When I add a product (from the product_info.php page) to my wishlist, it is placed in the wishlist and in the favourites list.

 

Thus, the product is placed in the two listes instead of being placed only in the wishlist.

 

Thanks for your help Dennis! :D


OSC2.2

Share this post


Link to post
Share on other sites
If you add it to the fav list does it only show up in the favs list?  Or does it show up in both?

 

It's the same problem! If I add a product to the favourites list it shows up in both.


OSC2.2

Share this post


Link to post
Share on other sites

Well the only error I see is your FILENAMES's

 

They just need to be wrapped like this

 

tep_href_link(FILENAME_WISHLIST)

 

Unless I am overlooking something??? You can take out the add to favs list action out of app top and add it str8 into the favs.php page. That might be better but I don't see why its not working the way you have it.

 

Sorry I can't be of more help :(

 

Dennis

Share this post


Link to post
Share on other sites
Well the only error I see is your FILENAMES's

 

They just need to be wrapped like this

 

tep_href_link(FILENAME_WISHLIST)

 

Unless I am overlooking something???  You can take out the add to favs list action out of app top and add it str8 into the favs.php page.  That might be better but I don't see why its not working the way you have it.

 

Sorry I can't be of more help :(

 

Dennis

 

Thanks Dennis!!!

 

Where exactly do you find erros with filenames, sorry I don't really understand. :blush:

 

I'm gonna move the favs list action from application top to favourites page and I'll be back!!

 

Thankssssssssss!


OSC2.2

Share this post


Link to post
Share on other sites
Not errors, just not done properly ;)

 

Allright Dennis!

 

Now it works but I had to take the whole following code from appl_top to wishlist.php and do the same for favs code. It doesn't work if I don't do it for both.

 

Here's the code I moved to wishlist.php and placed just after

 $breadcrumb->add(NAVBAR_TITLE_WISHLIST, tep_href_link(FILENAME_WISHLIST, '', 'SSL'));

 

 

 

:

// Wish List 2.3 Start
// *****************************************

 // Shopping cart actions through POST variables from forms
 if (isset($HTTP_POST_VARS['wishlist_action'])) {
   // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
   if ($session_started == false) {
     tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
   }

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

     case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
                                if ($HTTP_POST_VARS['products_id']) {
                                if ($customer_id > 0) {
                                  // Read array of options and values for attributes in id[]
                                   if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                                      $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                                   }
                                   tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                   break;
                                 }
                               }
                             }
                             break;
                             
     
                             

      // Wishlist Checkboxes
      case 'add_delete_products_wishlist': 
                                     if (isset($HTTP_POST_VARS['add_wishprod'])) {
                                        if ($HTTP_POST_VARS['borrar'] == 0) { 
                // 'borrar' form variable refers to deleting products in array $add_wishprod[] from wishlist
                                              foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {
                                                   $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]);
                                                   }
                                              }
                                            tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                        }
                                        if ($HTTP_POST_VARS['borrar'] == 1) {
                                              foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {    
                                                    tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'");
                                                   tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '$value' and customers_id = '" . $customer_id . "'");
                                                  }
                                             }
                                            tep_redirect(tep_href_link(FILENAME_WISHLIST));
  }
                                    
//// share wishlist
 if ($HTTP_POST_VARS['borrar'] == 2) { 
                // 'borrar' form variable refers to deleting products in array $add_wishprod[] from wishlist
                                              foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
                                                   if (ereg('^[0-9]+$', $value)) {
                                                   $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]);
                                                   }
                                              }
                                            tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                                        }
                                     }

//// end share wishkl


                                     
                                     break;
                                     
       
   }
 } 
// end switch ($HTTP_POST_VARS['wishlist_action'])

// *****************************************
// Wish List 2.3 End

 

I was wondering if will lead to problems with other functions that were placed after this code in application_top and which now are put before it....

 

Hope you understand my english :D


OSC2.2

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

×