4

I need to set up a checkout system when certain products say, a camera, can be either purchased OR rented.

I understand how this could be accomplished with separate entries for purchase/rental options. Using price modifiers will handle the different rental options nicely.

Obviously I don't want site admins to have to enter this content multiple times however. Anyone know the best way to approach this?

6
  • 1
    If the only difference between rentals and purchases is price, a suggestion would be to just have them both as price modifiers. Jan 7, 2013 at 3:53
  • 1
    What would be the difference to you for the rental item vs purchasing? Is it simply a flag in the order channel with a 'rental' or a 'purchase' (and of course using a price modifier to update the price)? Or is more complex, with a purchase counting down available stock (but not counting if it's a rental item)? Obviously there would also need to be different fields for rental vs purchase (ie if it's a rental, there will probably be the rental dates. Could you maybe provide an example site that does something similar, or some extra details about what you need to be different. Jan 7, 2013 at 5:37
  • Thanks for the feedback! @JasonVarga's suggestion of running all pricing (product/sale/rental) as price modifiers might be the way to go I'll put somethign together and see. I also have to account for differing stock at two locations i.e. Sydney/Melbourne for both rental and sale items. Being new to CT (more familiar with Store & BR) I was/am confused about how best to approach all this. I'd initially used the default price/original price fields and then added a rental price modifier with options for 24hr/weekend/week. That's not ideal as you need to essentially offset the inital price.
    – Andy Homan
    Jan 8, 2013 at 0:10
  • So yeah I think @JasonVarga's approach will work but it still seems a little cumbsy from a content admin perspective. It's great to be able to use presets on the price modifiers but it would be so much easier if they could be pre-populated somehow.
    – Andy Homan
    Jan 8, 2013 at 0:12
  • 1
    I put some jQuery in the instructions for that field if I want to pre-populate stuff. Jan 8, 2013 at 3:31

2 Answers 2

1

You could do a few things, all of which include having one entry per product (not needing to separate them).

  • Manage rental and purchase prices as a Cartthrob price modifier field.
  • Pre-populate matrix or modifier field rows by using some JavaScript in the instructions area.
  • Set up fields for purchase prices and rental prices, use a checkbox to indicate whether the product is available for purchase or rent. Then apply the appropriate price on the front-end using the allow_user_price="yes" parameter on the {exp:cartthrob:add_to_cart} tag, a hidden price input field, and some jQuery.

The downside to using the allow_user_price parameter solution, is that if someone really wanted, they could enter their own price by modifying the hidden price field's value using devtools or firebug.

1

I've set up rentals before of digital goods by writing a simple extension that set the 'Purchased Product' entry to have a expiration date of one week (or any time length really) from the date of purchase. You could do the same for a physical product. I'd share the code with you for this, but unfortunately I am unable to due to licensing restrictions.

I'm guessing you may be dealing with a quantity limitation when renting physical products. Similar to the above suggestion you could have a entry for each instance of a rentable product and change the entry date (via a hook) to a future date each time it's purchased. Possibly better yet you could change the status of the purchased product to 'rented' and once the product is returned you could manually revert it back to 'open'. I don't have any code to support this example - but it's definitely possible.

Good luck!

1
  • Thanks @PhillipZaengle. Yes, I was initially looking at doing somethign with the rental inventories to keep track of stock levels/product availability. However, after having further discussed the requirements with the client I may be able to dodge that bullet.
    – Andy Homan
    Jan 8, 2013 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.