Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Plugin Contributions
    0

    Default Pricing by cumulative hours in cart

    I'm setting up a store for a school. Pricing is done by the hour, but it is:
    1. Nonlinear - no formula; must be done via lookup table
    2. Cumulative - so the third 1.5 hour product has a different price than first or second


    For example:
    1.0 hour of classes = $100
    2.0 hrs of classes = $186
    3.0 hrs of classes = $263

    So if I set three 1 hour classes with price = $100, that's only correct if it's the only class in the cart. When adding the second one hour class, the price should be $86.

    Furthermore, if the first class is removed, the price of the second item needs to revert from $86 to $100.

    I'm assuming this can't be done without writing some custom code, which I'm fine to do -- but I'd like pointers on how to proceed, if anyone has any tips :-)

    Should I
    1. use the Notify/Observer framework to adjust prices as items are moved in/out of the cart... or
    2. modify whatever code does the cart totallling, or
    3. use a custom Payment or Order Total module?

    Thanks in advance,

    Mike

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Pricing by cumulative hours in cart

    Are these additional hours for the same class(product) or for separate classes(products) added to the cart?
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: Pricing by cumulative hours in cart

    These are for different classes/products, which need to remain distinct in the cart.

    I actually did a horrible hack in OSCommerce a while back, which was:
    • Each class priced @ $0
    • When a class item was added, another item called "Classes Total Rate" (or some such) was added automatically; that item was used to carry the price.
    • So in my earlier example, with 3 one hour classes, each would be priced @ zero, and a fourth item, "Classes Total Rate", uneditable by user, would be priced @ $263, the sum of (discounted) hourly rates.


    I'm hoping to have a cleaner solution w/ ZC. Partly because ZC itself looks much, much cleaner; also because I don't remember how I did it, what files I modified, etc. in OSC way back when... my docs & such were lost in the interim.

    Ideally:
    • In the product listing, class prices would show the next incremental cost, as a function of what's already in the cart.
    • Once in the cart, each item would show that cost too, so the customer sees the discounted price on the second item, rather than just a stark total, as in my earlier solution


    Are "Product Types" a way to do this??? Does a new ProdType allow associated pricing code to override the standard pricing?

    The classes must co-exist with conventional, fixed price items, btw....

    Thanks for the followup!

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Pricing by cumulative hours in cart

    In the product listing, class prices would show the next incremental cost, as a function of what's already in the cart.
    This one is gonna require too much coding to track and dynamically alter prices between products - Would have to be an item that one can just not live without to spend the time/money to create this
    Once in the cart, each item would show that cost too, so the customer sees the discounted price on the second item, rather than just a stark total, as in my earlier solution
    This also is a stretch as just as with OSC(which Zen Cart is based upon), each product is unique in of itself and doing discounts across products will require custom coding....

    shopping_cart.php is the most probable file to begin looking at how the products and resulting prices are summed up

    Not impossible but then again not easy nor a subject that can be covered in a couple of posts on a forum
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: Pricing by cumulative hours in cart

    Well, thanks for the input. Although it was even less encouraging than I had anticipated

    Actually, I had really been hoping for some sample code <jk>

    Most of what I do remember about my OSC endeavor is hacking away at it every free moment for a solid week to make something bare bones work, so I certainly wasn't expecting it to be easy.

    I'm mildly surprised that I haven't seen anyone else that seems to be selling services (vs products) using ZC. Is there another product out there that I should know about, more tailored to the service industry???

    Thanks again,

    xenophile

    Quote Originally Posted by kobra View Post
    This one is gonna require too much coding to track and dynamically alter prices between products - Would have to be an item that one can just not live without to spend the time/money to create this

    This also is a stretch as just as with OSC(which Zen Cart is based upon), each product is unique in of itself and doing discounts across products will require custom coding....

    shopping_cart.php is the most probable file to begin looking at how the products and resulting prices are summed up

    Not impossible but then again not easy nor a subject that can be covered in a couple of posts on a forum

 

 

Similar Threads

  1. Replies: 3
    Last Post: 20 Jan 2012, 10:52 PM
  2. add to cart only during physical store operating hours?
    By Jeff G in forum Managing Customers and Orders
    Replies: 20
    Last Post: 4 Jun 2010, 05:40 PM
  3. Cumulative Discounts
    By samurai-arts in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 26 Jan 2008, 02:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR