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

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Hello VM fans,


This hack is based off the original wishlist hack by KMAN for vm1.0

I've modified the orginal hack, and added to it, to work for vm1.1 (vm1.1.4 tested) with J1.5 (J1.5.15 tested).

This was kind of a rush job. There are a few non XHTML vaild lines (missing alt or title attributes).

I did this hack revision after purchasing two different wishlists and was very unsatisfied.

This wishlist system is a hack to the core, but overall, the core hacks are minor, and are commented (search for "wishlist" in core hacked files if necessary). It includes a module as well, which installs via the regular Joomla mod install.
Wishlist system:
1. Logged in users can create wishlists.
2. Users can add items to wishlists via flypage, right next to add-to-cart-button. This is the only place it makes real  sense other than also on the cart page.
3. Users can use an entire cart to create or add to wishlist. That's right! Unlike other wishlists, users can just add all their items in a cart to a new or already created wishlist in one click! Button right under the cart so easily visible.
4. Users can share, via an email system, with non-registered users the items they have added to wishlists. Multiple emails per share.
5. Users can create UNLIMITED public and private wishlists. Wishlists become public when users share wishlist via email.
6. Users can delete, modify, share, unshare wishlists.
7. Wishlists are stored in database for user / visitor retrival at any time.
8. Wishlists show image of items, not just name.
9. Users may access wishlists anywhere on site via the module.
10. Users/visits can add singular products to cart  from wishlist, or the entire wishlist to cart with one click.
11. Users can adjust wishlist quantities, add, or alter products & quantities at anytime.
12. Only wishlists system with VM admin panel for administrator review of wishlists, popular wishlist products,  users using wishlists, etc.

Screenshots of admin panel wishlist tab Most Common Wishlist Items:

Screenshots of admin panel wishlist All Users for this Item:

Screenshots of admin panel wishlist tab All Wishlist from Users:

Screenshots of admin panel wishlist Specific Wishlist of User:


That's about it! PLEASE POST ANY ISSUES HERE.
Please post any feedback as well.

NOTE: If you are using VM router.php for SEF, you will want to make some additions to it for proper SEF functioning. Post questions here if you need help.

NOTE: ps_wishlist may need to be altered if you are having an array problem. While I didn't take the time to carefully fugure out why, it seems to be a PHP version issue with earlier php. Symptoms are what Roderick1 had with no product images and names being carried to wishlist. http://forum.virtuemart.net/index.php?topic=66530.msg226992#msg226992

UPDATE: Now v1.2 -> For SSL users (https)
  • Fixed error of non-registered users not being able to see sent wishlists.
  • Fixed email template for sharing wishlists.
  • Fixed login forms to include "Register" link, should users want to register.
  • Made login forms look the same.
  • Fixed public wishlist item template to look same as other item templates (100% width on table)
  • Files changed:
    • components/com_virtuemart/themes/vmj_genx/templates/wishlist/public/wishlist_item_list.php
    • components/com_virtuemart/themes/vmj_genx/templates/wishlist/emails/email_english.txt
    • administrator/components/com_virtuemart/html/wishlist.index.php
    • administrator/components/com_virtuemart/html/wishlist.save_cart.php
    • administrator/components/com_virtuemart/html/wishlist.share.php

UPDATE: Now v1.3 -> For NON-SSL (http) or SSL (but not forced)
  • Only download this version if you do not have SSL (https) and don't want to force the use of https during login or registration. My previous version used JRoute with SSL forced on, and for those without SSL, this will cause it not to work.
  • Files changed are:
    • modules/mod_vm_wishlist/mod_vm_wishlist.php
    • administrator/components/com_virtuemart/html/wishlist.add_item
    • administrator/components/com_virtuemart/html/wishlist.index.php
    • administrator/components/com_virtuemart/html/wishlist.save_cart.php
    • administrator/components/com_virtuemart/html/wishlist.share.php

UPDATE 03-07-10: Download v1.4
  • Minor Update; Just added files in .zip to uninstall wishlist easily. IE: Included original VM files, and an uninstall.sql
  • Files changed are:
    • No files changed, just added an uninstall folder and files

UPDATE 03-14-10: Download v1.5
  • Fix: URL redirect issue on 2 forms
  • Files changed are:
    • administrator/components/com_virtuemart/html/wishlist.index.php
    • administrator/components/com_virtuemart/html/wishlist.add_item.php

UPDATE 03-17-10: Download v1.6
  • Fix: templates for wishlist items was not getting correct image folder for add/delete/update buttons
  • Addition: Added updated router.php for those of you using router.php for SEF. router.php needs added functions to create proper SEF links. Please read README in file.
  • Files changed are:
    • components/com_virtuemart/themes/defalut/templates/wishlist/private/wishlist_item_row.php
    • components/com_virtuemart/themes/defalut/templates/wishlist/public/wishlist_item_row.php
    • README.txt

UPDATE 03-21-10: Download v1.7
  • Fix: Module link to Wishlists wasn't fully functional with SEF on
  • Fix: Found another 2 potential redirect errors based on Itemid missing
  • Fix: Non-Admin users cannot see or add products to cart that are UNPUBLISHED
  • Addition: Added price field in wishlist items templates, correctly reflecting user group price and discounts.
  • Addition: Added description field in wishlist items templates
  • Addition: Added short description field in wishlist items templates
  • Addition: Second wishlist items templates (public & private) to support new template field options
  • Addition: Added support for Ajax Add-To-Cart on wishlist items pages (if enabled in VM config)
  • Addition: Added Add-To-Wishlist for Category browse items
  • Addition: Added css class="wishlist_button" to browse and flypage links so you can format your look via css easily.
  • Files changed are:
    • all files changed, except SQL

UPDATE 04-04-10: Download v1.8
  • Fix: Update/Delete buttons not working
  • Fix: Missing icon for wishlist admin page headers
  • Fix: Incorrect list count on admin wishlist lists page causing faulty multi-page navigation
  • Fix: Added correct "Out of Stock" prompt when product check stock enabled and out of stock item is tried added.
  • Addition: Access to user details from admin wishlist lists
  • Addition: New admin reporting form, listing user names and emails for each wishlist item
  • Addition: When adding item to wishlist, "Continue Link" now appears in wishlist returning user to category of added item. Just add {continue_link} in your private wishlist_item_list.php template.
  • Files changed:
    • administrator/components/com_virtuemart/html/wishlist.add_item.php
    • administrator/components/com_virtuemart/html/wishlist.index.php
    • administrator/components/com_virtuemart/html/wishlist.list.php
    • administrator/components/com_virtuemart/html/wishlist.reports.php
    • administrator/components/com_virtuemart/classes/ps_wishlist.php
    • administrator/components/com_virtuemart/languages/common/english.php
    • components/com_virtuemart/themes/default/templates/wishlist/private/wishlist_item_list.php
  • Files added:
    • administrator/components/com_virtuemart/html/wishlist.list_users.php
    • components/com_virtuemart/shop_image/ps_image/wishlist.png

UPDATE 05-07-10: Download v1.9
  • Addition: Added print page function on wishlist items page(s).
  • Addition: Module change; Added ability for user to re-visit a sent wishlist from wishlist mod. In other words, if a visitor has entered the site through a "shared wishlist link", they may access that wishlist again from the wishlist mod during that session.
  • Files changed are:
    • administrator/components/com_virtuemart/html/wishlist.index.php
    • administrator/components/com_virtuemart/languages/common/english.php
    • components/com_virtuemart/themes/defalut/templates/wishlist/private/wishlist_item_list.php
    • components/com_virtuemart/themes/defalut/templates/wishlist/public/wishlist_item_list.php
    • modules/mod_vm_wishlist/mod_vm_wishlist.php
    • router.php


UPDATE 10-15-10: DUTCH TRANSLATION of wishlist for VM 1.1.5


Please take a minute of time to leave a review here: http://extensions.virtuemart.net/index.php?option=com_sobi2&sobi2Task=sobi2Details&catid=6&sobi2Id=331&Itemid=

If you like or found useful, please donate at http://www.paypal.com to forrestchamberlain@hotmail.com

[attachment cleanup by admin]

walter_moclear

  • Beginner
  • *
  • Posts: 27
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #1 on: February 03, 2010, 16:20:53 pm »
Hello Forrest,

This module sounds great and I have been looking for something like that for quite some time. I am newbie so can you explain how to proceed with the installation? I open the README file and I do not understand the bullet point #3 saying "Run the SQL file now located at (modify the 'jos_' prefix as is necessary): * sql.virtuemart.module.wishlist.sql
Can you guide me throught the installation?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #2 on: February 03, 2010, 19:12:51 pm »
You need to use PHPMyAdmin or similar to add the SQL file to your database. You probably don't need to worry about the jos_ renaming if you don't know what that is.

walter_moclear

  • Beginner
  • *
  • Posts: 27
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #3 on: February 03, 2010, 22:28:04 pm »
Thanks for your reply. So what should I install in order for the module to work fine? Is it possible that non registered member use 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 #4 on: February 03, 2010, 22:52:59 pm »
You must delpoy the sql and hack files before the mod will work. The mod is only a little addon making it easy for users to access their wishlists... and they can only access them if you have deployed the hack by replacing all the files included and running the sql to add the database tables/changes.

Non-registered users can SEE registered users wishlists that have been sent to them by the register user. This way non-registered can add these products to a cart before checkout/registration.

Non-registered users may add products to a cart, but will not see the "Add cart as wishlist" until they either 1. Register, or 2. Checkout (which causes registration 1st).

Non register users can see the Add-to wishlist on the product-flypages as well for each product, but when they click on it, it redirects them to login or create an account.

Pretty much, in order to HAVE a wishlist, you need an account. This is how we know WHO'S wishlist is WHO'S! We need a user ID to relate the wishlists to.

good luck!

walter_moclear

  • Beginner
  • *
  • Posts: 27
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #5 on: February 03, 2010, 23:13:50 pm »
It sounds terrific!

Ok let's try to install the module. I do not understand what you mean by deploy the sql and hack files (I am really a beginner). Can you guide me step by step through the process?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #6 on: February 04, 2010, 01:26:54 am »
Well I'll be frank is saying of you're this new, I don't recommend hacking until you are comfortable with the way Joomla/VM functions, and likewise, understand where the files are that you need to edit.

Having said that.

1. Backup your installtion.
   a) backup for files
   b) use PHPMyAdmin to backup your database.

2. Use PHPMyadmin to add/deploy the included SQL.
   a) You can do this by entering the PHPMyAdmin panel and clicking "Import" -> "Browse" (which you browse to the .sql)
   b) Once you have the file selected for import click "Go"
   c) This will execute the .sql file and add the needed databse tables/colums

3. Now you need to FTP over the newly hacked files.
   a) You can only do it this way if you are using VM1.1.4 and have not already hacked the files to be replaced with other hacks.... otherwise you will overwrite the hacks with this one. If you are not using VM1.1.4, but it is a 1.1.x version, then you would need to look at each file, and copy the code for the hack over to the original 1.1.x file.
   b) FTP the "administrator" folder over to your Joomla root... which will overwrite the original files with the hacked ones.
   c) FTP the "components" folder over to your Joomla root... which again, will overwrite the original files with the hacked ones.

4. Now install the module
   a) Log into Joomla (should be already) and go to Extensions -> Install/Unintall -> Browse
   b) Select the mod found in the hack (mod_mv_wishlist).
   c) Install it!

5. Go to Extensions -> Module Manager and make sure you publish the module, and it is the position you want.


Done. Hack is now working.

walter_moclear

  • Beginner
  • *
  • Posts: 27
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #7 on: February 04, 2010, 03:43:00 am »
Thank you so much for all the time you spent answering me. As you said, such modifications are kind of scary to the newbie I am so I will go step by step.

In the meantime, do you know where I can find a simple module for what I am trying to do. Your module looks great but much more elaborated compare to what I want to do. In my project, there is no cart, no check out, no price involved and no login required. It is just an online catalogue. I would like the user to be able to select products from the catalogue in a wishlist and to be able to save this wishlist on his computer.

Let me know if you know anything like that and thank you again for your help.
Wally


Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #8 on: February 04, 2010, 03:56:10 am »
IT seems to me the best thing to do is to keep Virtuemart NOT in catalog mode, but still have it work like a catalog.
See my posts here to make that part work:
http://forum.virtuemart.net/index.php?topic=66466.msg220054#msg220054
http://forum.virtuemart.net/index.php?topic=65510.msg219904#msg219904

Then instead of using the cart as a real cart, just change out the language files for it to say WISHLIST... and turn your checkout button into a link to execute an EXPORT of the products in the cart to a CSV file. A simple PHP code can make that work.

Good luck... at this point you are on your own! Search the forums :)

walter_moclear

  • Beginner
  • *
  • Posts: 27
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #9 on: February 04, 2010, 04:19:24 am »
I am going to try hard  ;D
Thank you so much for your help!

ptiang

  • Beginner
  • *
  • Posts: 1
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #10 on: February 05, 2010, 19:42:29 pm »
Hi Forrest,

I managed to implement your wihlist successfully, except that when I tried to share my wishlist and email to my friends, they cannot seem to view my wishlist, regardless whether they are logged in or not.

Perhaps you can enlighten me on this.

Thanks for the effort!

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #11 on: February 05, 2010, 20:23:55 pm »
Yep, good catch. Looking at it now.
 Likewise, there is added code in that needs to be removed:
components/com_virtuemart/themes/vmj_genx/templates/wishlist/emails/email_english.txt

Remove everything above "Hello!"

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #12 on: February 05, 2010, 21:12:23 pm »
UPDATE: Now v1.2 ->
1. Fixed error of non-registered users not being able to see sent wishlists.
2. Fixed email template for sharing wishlists.
3. Fixed login forms to include "Register" link, should users want to register.
4. Made login forms look the same.
5. Fixed public wishlist item template to look same as other item templates (100% width on table)

Files changed:
components/com_virtuemart/themes/vmj_genx/templates/wishlist/public/wishlist_item_list.php
components/com_virtuemart/themes/vmj_genx/templates/wishlist/emails/email_english.txt
administrator/components/com_virtuemart/html/wishlist.index.php
administrator/components/com_virtuemart/html/wishlist.save_cart.php
administrator/components/com_virtuemart/html/wishlist.share.php

berserker

  • Beginner
  • *
  • Posts: 38
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #13 on: February 06, 2010, 19:40:33 pm »
Ok, I did everything you said and I ended up getting this error message on my website, so I disabled the module until I could figure it out.  Here's the error message:


Warning: require_once(/home/pricein3/public_html/administrator/components/com_virtuemart/classes/ps_wishlist.php) [function.require-once]: failed to open stream: No such file or directory in /home/pricein3/public_html/modules/mod_vm_wishlist/mod_vm_wishlist.php on line 31

Fatal error: require_once() [function.require]: Failed opening required '/home/pricein3/public_html/administrator/components/com_virtuemart/classes/ps_wishlist.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/pricein3/public_html/modules/mod_vm_wishlist/mod_vm_wishlist.php on line 31

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: HACK Wishlist + Mod. Multiple wishlists per user. Share with non-users.
« Reply #14 on: February 06, 2010, 21:27:34 pm »
Sounds to me like you didn't extract the files (specifically ps_wishlist) to your ftp site root. Maybe you only installed the module? There is a whole bunch of files that need to be copied over.

Your error message in sitself states the problem!
Failed opening required '/home/pricein3/public_html/administrator/components/com_virtuemart/classes/ps_wishlist.php' No such file or directory.