Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Smarter Per-Album Pricelists in Photo Shop?  (Read 4959 times)

0 Members and 1 Guest are viewing this topic.

ApplePie

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Smarter Per-Album Pricelists in Photo Shop?
« on: June 15, 2007, 03:04:49 am »

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.



Logged

ApplePie

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Smarter Per-Album Pricelists in Photo Shop?
« Reply #1 on: June 15, 2007, 03:23:17 am »

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.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Smarter Per-Album Pricelists in Photo Shop?
« Reply #2 on: June 15, 2007, 09:21:52 am »

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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Smarter Per-Album Pricelists in Photo Shop?
« Reply #3 on: June 15, 2007, 10:38:50 am »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Smarter Per-Album Pricelists in Photo Shop?
« Reply #4 on: June 15, 2007, 07:13:35 pm »

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

ApplePie

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Smarter Per-Album Pricelists in Photo Shop?
« Reply #5 on: June 16, 2007, 01:31:03 am »

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?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Smarter Per-Album Pricelists in Photo Shop?
« Reply #6 on: June 18, 2007, 10:28:09 pm »

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.
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.