__fabrice Posted June 15, 2010 Share Posted June 15, 2010 Hi,I would add a date field in the basket. I uploaded the page product.tpl, and I edit ajax-cart.js for the call to cart.php accepts a date.Then I see that uses prestashop / classes / Cart.php, but I do not see where to add code to manage a new date field. And besides, what tables are involved? ps_cart?, ps_order too (indeed) ?Thank you for your helpFabrice Link to comment Share on other sites More sharing options...
yodapt Posted June 15, 2010 Share Posted June 15, 2010 What's the objective of that date field? Link to comment Share on other sites More sharing options...
__fabrice Posted June 15, 2010 Author Share Posted June 15, 2010 Hi,I just want to add a field in the product table, a date field, that i could retreive in the shopping cart, and in the order.In my case, a product is a trip. And the customer must choose a date of his trip ( in a jquerye calendar for example).Regards,Fabrice Link to comment Share on other sites More sharing options...
yodapt Posted June 15, 2010 Share Posted June 15, 2010 In that case, you need to add an extra field to ps_orders, since a client can purchase more than a trip.This means that when a client decides to purchase a trip, you will need to get that date from him before adding his choice to the cart. Link to comment Share on other sites More sharing options...
__fabrice Posted June 17, 2010 Author Share Posted June 17, 2010 Hi,I've add a field in "ps_cart_product" table and update and insert it, ok.But, in the cart page 'order.php', I can't retreive this data (order.php::getSummaryDetails() and Cart::getSummaryDetails()).Thanks,Fabrice Link to comment Share on other sites More sharing options...
yodapt Posted June 17, 2010 Share Posted June 17, 2010 Around line 200 of cart.php (located in classes), you'll see a function named getProducts, as well as a big SQL query. You'll have to change the query in order to retrieve your table field in the result. Link to comment Share on other sites More sharing options...
__fabrice Posted June 17, 2010 Author Share Posted June 17, 2010 Thanks for your quick reply... and yes, i finally found it, in the getProducts() function.For now, i must find the way to add this field in the ps_orders table.Fabrice Link to comment Share on other sites More sharing options...
prestanesia Posted October 8, 2010 Share Posted October 8, 2010 Hi Fabrice,adding the field in ps_cart_product is sufficient, and as yodapt suggest you can include the date field in the query. Link to comment Share on other sites More sharing options...
__fabrice Posted October 8, 2010 Author Share Posted October 8, 2010 Hi,Ok, thanks. I'll try to do that.Fabrice Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now