Author Topic: HACK: Wishlist + Mod. Multiple wishlists per user. Share with non-users.  (Read 195707 times)

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #15 on: February 06, 2010, 22:00:17 pm »
Yea, thats probably it.  All I did was install mod_vm_wishlist and the sql file sql.virtuemart.module.wishlist.sql.  Was I supposed to install the files in the folder mod_vm_wishlist?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #16 on: February 06, 2010, 22:04:57 pm »
Yes, this is a core hack, which means you will be over-writing/adding-to a few VM1.1.4 files with the hacked versions I have included.

So yes, FTP over the 2 folders, "administrator" and "components", to your site root... in your case /home/pricein3/publichtml/

Then you can re-enable the mod, and your off an running.

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #17 on: February 06, 2010, 22:06:56 pm »
But wont that overwrite the com_virtuemart folder I already have?

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #18 on: February 06, 2010, 22:09:29 pm »
Well I backed up my files so I'll give it a shot and see what happens.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #19 on: February 06, 2010, 22:10:59 pm »
FTP replaces files within folders... not overwrite folders... you'll be ok!

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #20 on: February 06, 2010, 22:40:10 pm »
Ok, it worked now.  I can see the wishlist module.  However, I can't add products in my store to the wishlist.  Did I miss something?

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #21 on: February 06, 2010, 22:48:50 pm »
Ok, it was working but now I see this error message whenever I have the wishlist module enabled: 

Fatal error: Call to a member function query() on a non-object in /home/pricein3/public_html/administrator/components/com_virtuemart/classes/ps_wishlist.php on line 1616

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #22 on: February 06, 2010, 22:50:36 pm »
Actually I think I messed that part up by reuploading the shopping cart module because I never uploaded it to begin with.  I was using my site as a catalog.  I'll go back and reinstall the files that I overwrote, however I still would like to know how I can add products to the wishlist; that doesn't appear to be working for me.

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #23 on: February 06, 2010, 23:02:57 pm »
Nope, I reuploaded the files and I'm still getting the same error message:


Fatal error: Call to a member function query() on a non-object in /home/pricein3/public_html/administrator/components/com_virtuemart/classes/ps_wishlist.php on line 1616


I looked at the code and it's this line:

   $result = $db->query( $q );

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #24 on: February 07, 2010, 00:19:27 am »
Ok... so it's just the module that is not working correct?

Everything else is functioning ok? You can add products to a list, share it, etc, right?

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #25 on: February 07, 2010, 01:58:24 am »
the wishlist works when I'm not logged in, but if I'm logged in as a user then it shows the error message that I posted.  However, what I need is a site that requires people to be registered to see the wishlist. 

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #26 on: February 07, 2010, 02:10:45 am »
I understand you get an error when you are logged in.

WHERE are you getting this error... in the module? or on the content of the page? I am tying to understand if the error is ONLY IN THE MODULE, or if it is somthing within the HACK files when you are logged in.


Quote
However, what I need is a site that requires people to be registered to see the wishlist.
That can be done pretty easily. You just need to edit administrator/components/com_virtuemart/html/wishlist.index. Look for the lines:

Quote
// no user specified -- wishlist code?
if ($result === false && isset( $wishlist_code ) && !empty( $wishlist_code ) && trim($wishlist_code) != '')
{
   // convert wishlist_code to wishlist_id
   $return_value = ps_wishlist::wishlist_code_to_id( $wishlist_code );
   if ($return_value !== false)
   {
      // this will take precedence over any wishlist id that might have been passed
      $wishlist_id = $return_value;
   }
}

The way it works right now, when users get an email with the wishlist code, it allows users to access the wishlist because it see's the code. I would recommend you redirect users to the wishlist login form instead:

Something like replacing the code above with this:

Quote
// no user specified -- wishlist code?
if ($result === false && isset( $wishlist_code ) && !empty( $wishlist_code ) && trim($wishlist_code) != '')
{
      show_login( $output, $wishlist_id, $wishlist_code, $sent_user_id );
}


Now, I have not tested this, but that would be my first stab at it.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #27 on: February 07, 2010, 02:19:37 am »
Likewise, one of the downfalls to my hack (at least for now) is that when someone clicks on a wishlist link sent to them, it takes them straight to the wishlist page for the user that sent them the link.

Problem being, is once they leave this page (say to register) they cannot get back to the wishlist without going back to the email and following the link again. In other words, there is no link within the wishlist module that give them access to OTHER users wishlists that have been sent to them.

Two ways to handle this.
1. (THE HARD WAY) Make sure the wishlist code is always passed along in J1.5 registration, and use that as an identifier in login to redirect them to the wishlist page of that user. Requires hacking J/VM registration, and possibly J login

2. (Slightly Easier) Still requires passing the wishlist code in J/VM registration (hacking it to do so), but instead of redirecting after login to the wishlist page of user who sent it, have the wishlist MODULE check for the wishlist code within the URL and provide a link from the module.


Either way, it's a tough one to deal with. If that is what you wanted, which is what I DID NOT WANT, you may want to look at the few other wishlists for VM around.

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #28 on: February 07, 2010, 06:17:29 am »
I understand you get an error when you are logged in.

WHERE are you getting this error... in the module? or on the content of the page? I am tying to understand if the error is ONLY IN THE MODULE, or if it is somthing within the HACK files when you are logged in.



It is in the content of the page.  My page appears completely white with only an error message at the top.  For some reason though, whether I'm logged in or not, I can see my pages and the wishlist module when I'm only viewing my product catalog pages, but if I try to view any other pages on my site it goes to the blank page with the error message. 

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #29 on: February 07, 2010, 06:21:04 am »
I have a feeling this has something to do with the fact you are in catalog mode within VM.

Just for kicks, try turning off catalog mode and see if it makes a diff. Just a guess.