I really like the built in cart functionality in Gallery 2. However I'm changing it a little for our needs. I'm simply renaming it to personal folder so users can use it to store their favorite files once they login. Then I plan to style it so it looks like a contact sheet. This module has been fairly straightforward to work with so far but now there is something I want to do that I can't figure out how to do since I'm not experienced with programming.
Since it's a personal folder, duplate items are useless. I figured out how to not show that but how do I make it so that when a user adds a photo that is already in their personal folder, it doesn't add it to the personal folder count? Meaning, if they already have the photo in their personal folder, it doesn't add a duplicate. Thanks
By the way, if anyone else is interested in using this once I'm done with it, I can post it here for others to use.
Posts: 32509
currently, the cart contents are stored in the session. so after logout, it will be gone.
so it's not a simple change, you'll have to add database tables etc.
@duplicate items:
well, just ignore it and don't increase the count.
all in all, i think you'll have to change quite a lot. the cart module might not be the best module to start with what you have planned there. but for a lack of a better prototype, you;ll have to stick with it.
Posts: 17
Not what I was hoping for but thanks for letting me know, Valiant.
Posts: 17
Valiant, I was just messing around to see if there might be any alternatives and I'm thinking I could possibly also use the User Albums module in this way. And then just change the wording for "create link" for photos to something like "add to user album". That way it's always there when they login and logout. I guess I could still keep the cart active also since then they can just add that entire user album or specific items to the cart and download as zip.
Or do you think that might be too many steps for the end user? I'm just thinking out loud to you on this since I'm not really sure how to go forward with this. Thanks
Posts: 32509
i think a "favorites" module would be a great thing.
but the implementation / design space is quite large, you can implement it in a lot of different ways.
- you could create something like useralbums, a favorite album for each user. and each item you add to your favorites album would be a link. you could set permissions, e.g. whether only you or all users could see your favorites
- advantage: organizing favorites would be as intuitive as organizing albums
- disadvantage: you can't add favorite albums to your favorites, only favorite items (photos, movies, ..). if you have installed the user contributed link album module, you could also add favorite albums. we plan to add the link album to the official release soon.
OR
- just create a new Map table
columns: userId, itemId (+ additional stuff, like columns for sorting, rating, ... whatever you can think of)
and just add / remove itemIds to / from this map when someone clicks "add to favorites" / "remove from favorites"
- advantage: no dependencies on other modules, quite easy / straight forward
- disadvantage: you'd have to create a view which shows your favorites (quite easy to do).
Posts: 17
thanks for the suggestions. I'll mess around with it more and see what I can come up with.
Posts: 9
Since I'd like to provide DIGITAL version of photos (those added to cart), I also do not need Quantity.
If you could please tell me:
How remove quantity column in the cart view, disable count and finally enable some kind of message popping when one is trying to add item already in cart.
Second: How to put some IPTC data instead of Summary field in cart view
I am absolute beginner, so would be greatful for detailed instructions (well, I know how to edit files ;))
Posts: 9
ANSWERED.
My friend has found the solution to the above question, so for those of you who can find this useful... How to remove quantity, avoid duplicates in cart, and disable count for already added items:
This hides Quantity column in cart;
in modules/cart/templates/local/ViewCart.tpl comment-out as below (in bold):
This eliminates duplicate count;
in modules/cart/classes/CartHelper.class you have to comment-out one line (here in bold):
It's good then to change Update Quantities to Remove Selected
Posts: 17
Hey thanks for that good info rexator!
Posts: 9
You're welcome!