Forum

Thread tagged as: Question, Shop

Additional order information per item

Hi!

I'm making a website for a hotel and I'm using the perch shop app to accomplish that. Being a hotel I need to be able to rent a room. For that, I obviously need to know how many people will be in it and the check in and check out dates. So far I seen that I can use the perch_shop_form() to add this sort of information, but as far as I understand it is per order and not per item.Not only that, I'm not sure if it is the best approach to this problem, considering that perch_shop_form seems more suitable for minor information that I can add just before checkout, in my case, its essential for me to access this sort of information before the checkout so I can check if the room is available and to calculate prices. Is there a way to save extra information per item? and In your opinion what would be the best approach ?

Gustavo Bica

Gustavo Bica 0 points

  • 3 months ago
Drew McLellan

Drew McLellan 2578 points
Perch Support

I'm not sure Shop is really suitable for that sort of task.

I noticed while adding to the cart,that the checkin/checkout dates are store in the DB Table: perch3_shop_cart_data in the field cartData, am I correct to assume that there is no function that allows me to fetch it?

Drew McLellan

Drew McLellan 2578 points
Perch Support

The life of a cart ends when an order is created - so what's in the cart is inconsequential for a completed order. Do you see the data you want against the order?

I didn't go there yet, I'm going to make the whole flow, from cart to order ,to see if can link the data from to cart to the order, and then I will come back to you ;)

Just to let you know, I was able to achieve what I wanted. Basically I added an extra field where I keep a json with all the information I needed (for each item on the cart and as a whole after checkout), by doing that I can then fetch it and do whatever I want. Now that I have all the work flow working, I can say it wasn't that hard to integrate this few changes with perch, so congrats for having such a well organised and comment code, it really helped :)