Smarter Per-Album Pricelists in Photo Shop? Smarter Per-Album Pricelists in Photo Shop?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Smarter Per-Album Pricelists in Photo Shop?

Started by ApplePie, June 15, 2007, 03:04:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ApplePie

Is it possible to make albums adopt the Per-Album Settings of their parent album (or even better, based on the category?).

I set up separate albums for each customer's pictures. I have a variety of portrait types (such as weddings, senior portraits, family sittings, etc.), and each type naturally has different products and prices.
   

For example, presently, if I were to start adding new albums for families it would give them all the default global items/prices (which has to contain everything, like Wedding albums and Class composites), so the correct Per-Album Settings would have to be re-entered manually for each family.

Instead, it would be better for say the Smith Family's album to automatically adopt the Shop settings of it's parent album, Family Portraits, or its category, Families.

Anyway, I'm running Photo Shop v1.3.5 on my test gallery and thought I'd ask in case I've overlooked something or if someone else has solved this problem or has any suggestions as to how I might.




ApplePie

Erm.. Sorry, I think I was mistaken about the albums (I'm new to Coppermine, obviously  :-X ). I just realized that albums appear to not have any heirarchy of their own, only categories do. Please ignore that part, it would have to be just with the categories, since their are no parent or child albums.

Stramm

There's no out of the box solution for that. As you've seen yourself, albums don't have subalbums but categories have subcotegories and contain albums.

Therefore if you do a per album settings, then there are no subalbums that are able to inherit these settings. Of course one could do some coding to find out the category the album is in and then to check if this category contains any other albums...
However I'm somehow reluctant atm to code that. It doesn't seem to be that complex (if one stays within the subcategory) but needs again modifications of the shops config. Still I keep that addition in mind.

A temporary solution may be to directly modify the database. But that's only recommended if you're familiar with databases and a backup is mandatory.


Stramm

Attached is a modified photo_shop_config.php
I've added a checkbox above the submit button that allows it to change all albums in the (sub)category of the current album (no nested categories).

This isn't tested that much. Use it at your own risk and it would be nice if you report back.


ApplePie

Thank you, Stamm. I'll take a look at your modification.

ApplePie

Your modification does seem to work for me so far. However, it would be inherently unsafe in the hands of other users who might do it by mistake.

Now I'm wondering, since it seems making the prices fully category-dependent would be too hard, maybe it would be easier if I tried to make a small plugin that has preset pricelists, and hooks in wherever new albums are created, and at that point feeds your plugin the appropriate per-album settings for new albums based on their category.

And maybe I could also add a little drop-down menu to the Per-Album Settings area of the Shop config page loads preset pricelists for existing albums.

I'm not expert on this and I know its a rather obtuse hack, but that would suit my needs and sounds easier given my level of experience with PHP and Coppermine. Does it sound plausable to you?

Stramm

easiest would be to modify the above file. Most things are already coded and you can use some functions of include/functions.inc.php too (to get the categories and albums). For the above hack I've written two lil functions, but that's not really necessary. Basically you just have to code the html and put all functions together.