简体   繁体   中英

WooCommerce – users to be able to purchase a product reservation

I'm setting up a car dealership website using this theme which is WooCommerce compatible. The dealer wants to offer a service where users can pay to reserve or place a hold on a car directly from the website. Using woocommerce, I'm wondering how we could set this up. Also, the hold needs to be set for a certain length of time before it is available again.

It Would work like this: User selects car and clicks 'reserve' which would function like an add-to-cart button but once the reservation is purchased, the front end listing would be marked as 'reserved.' However, the page where I'd like this reservation button to go is not a woocommerce product page: see here

I also don't know how I could update the listing to be marked 'reserved' once the reservation is purchased. ?

Maybe there's a better way to accomplish this? Open to suggestions. Thanks for any help!

What I understand from the question is, user/customer purchases the "holding" period or the "reservation" period of the car (and pays for it). I guess you would want the reserve button to be on the car listing page which (as you have mentioned) is not a woocommerce product page (may be this page). I guess this is a custom post type enabled through theme.

Well, I think what you have described can probably be achieved with customization / additional functionality. This is how I would go about it, if I had to do it.

  • Create custom product type (something as "reservation") for enabling the reservation
  • Enable/create additional field (someting as "duration") for the custom product type
  • Create seperate "Reservation" products for each car on display
  • While creating such products specify duration for each (something like 10 days)
  • Relate/link respective reservation product with listed car
  • Place "Reserve" or "Hold" button on respective car listing page (this will function like "Add to Cart" button). Technically this will be the add-to-cart form, which will also check the holding/reservation period.
  • When the this button is clicked, (additional javascript function will be required) reservation for respective car will be added into cart, purchased further via checkout.
  • When payment for this purchase is successful, purchase date of the resrvation will be added as additional meta key to the product.
  • While rendering the product's reservation button (on car listing page), duration specified for the same will be checked against the purchase date of the product. If it is with in the purchased period, the button will render as disabled and its text will read as "Reserved".
  • Once the reservation period is over, additional meta key of the product created while purchase will be deleted and button will render as normal and car is available for reservation
  • If the dealer wants to enable multiple reservations, (say 5) then while creating the car's respective reservation product, inventory of the same will be set to 5 and corresponding available count of reservations will be displayed along with the button. (which will also decrease with each new reservation)

This may not be the ideal solution to your scenario and may also not have covered all the technical aspects, but it seems possible.

I hope this gives you atleast some direction, if I have correctly understood your requirement.

You may want to read up about the Woocommerce Bookings extension.

http://woothemes.com/products/woocommerce-bookings/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM