Slettet Fra Ukjent mai 25 2020 09:42 a.m. Team; We run a small business where the delivery dates and times are important. We are a bakery and people can order cakes for specific dates and set delivery times (morning, afternoon ...). I have been messing about with the software and I can add a calendar to the Shipping modules, but it changes the module code dramatically. Not only that, but I had to change a CORE file, which I don't think is correct. - [i]I know on updates I will lose the changes done [/i]- Because a FORM is being used, and I didn't want to edit the database, the date is added as a "Customer comment" to the order. To complete this the CORE file [i]order_process.php[/i] was edited. This is what it looks like on the checkout screen [img]https://baiba.cafe/scheduled.png[/img] These are the changes done ... (1) On the shipping module the field for "description" was edited to allow a FORM to be installed; " <label for=\"day\">" . language::translate(__CLASS__.':title_day', 'Day') .": </label> <select id=\"day\" name=\"day\"> ". self::days(date('d')) ." </select> <label for=\"month\">" . language::translate(__CLASS__.':title_month', 'Month') .": </label> <select id=\"month\" name=\"month\"> ". self::months(date('d'), date('n')) ." </select> <label for=\"time\">" . language::translate(__CLASS__.':title_time', 'Time') .": </label> <select id=\"time\" name=\"time\"> <option value=\"09:30 - 11:00\">09:30 - 11:00</option> <option value=\"11:00 - 13:00\">11:00 - 13:00</option> <option value=\"13:00 - 15:00\">13:00 - 15:00</option> <option value=\"13:00 - 17:00\">13:00 - 17:00</option> <option value=\"17:00 - 19:00\">17:00 - 19:00</option> </select> ",``` There are two functions (days and months) to select the correct day in the calendar and set the correct month. No need to go over those in the post.... (2) The CORE file order_process.php was edited... ```if ( (!empty($_POST['comments'])) and (!isset($_POST['day'])) ){ $order->data['comments']['session'] = array( 'author' => 'customer', 'text' => $_POST['comments'], ); } elseif ( (!empty($_POST['comments'])) and (isset($_POST['day'])) ){ $order->data['comments']['session'] = array( 'author' => 'customer', 'text' => 'Delivery information: \n Day :' . $_POST['day'] . '\n Month :' . $_POST['month'] . '\n Time :' . $_POST['hour'] . '\n \n ' . $_POST['comments'], ); } elseif ( (empty($_POST['comments'])) and (isset($_POST['day'])) ){ $order->data['comments']['session'] = array( 'author' => 'customer', 'text' => language::translate('delivery_information', 'Delivery information') . $_POST['day'] . '-' . $_POST['month'] . ' @ ' . $_POST['time'], ); }``` in short, I took the single IF that processed the Customer's comment and now is 3 statements, to ensure the date is recorded. I believe creating a new Section "Scheduled" before "Shipping" and "Payment", where users can create modules, same as payment and shipping would be much better. If there are not "Scheduled" modules then is not presented on the screen; but user's can then created their own Schedule to match their own needs. This data should go in the Database to avoid Double-booking; i.e. a decorating company avoiding booking two customers on the same time. The way I have done these changes, it means that EVERY shipping module needs to be edited to show the calendar. I wanted to create a module for Calendar under "Shipping", but because it is a "Radio" option, only one shipping can be selected. Please let me know how best to help you on getting this option enabled, as I do believe these changes will improve the product.
tim Founder Fra Sweden Medlem siden mai 2013 tim mai 25 2020 08:02 p.m. Sorry, this is a lot of reading. Is there a question?
Slettet Fra Ukjent mai 26 2020 08:09 a.m. Let me summarize... We need a module "schedule" to be added to the unit on top of Shipping and Payment. The core files would need to be edited, for example... var updateQueue = [ {component: 'cart', data: null, refresh: true}, {component: 'customer', data: null, refresh: true}, {component: 'calendar', data: null, refresh: true}, {component: 'shipping', data: null, refresh: true}, {component: 'payment', data: null, refresh: true}, {component: 'summary', data: null, refresh: true} ];``` and many others....
tim Founder Fra Sweden Medlem siden mai 2013 tim mai 27 2020 12:06 a.m. I still don't understand the question. I can try to answer specific questions. But I can't provide a ready made solution for you in the forums.
alvaroespinola Developer Fra Paraguay Medlem siden mars 2020 alvaroespinola mai 27 2020 02:38 a.m. I think you should create a new table in your database, orders_calendar (order_id int, date_delivery datetime) or maybe add a new field to orders orders.date_delivery datetime and fill it in your module sm_home_delivery in the afterprocess method do your query Update dbprefix orders set date_delivery = 'yyyyMMdd HH: mm' There was no need to edit the order_process to save the comment, you could have done it in the same shipping module //This method is triggered after the order has been created, making it possible to automate e.g. booking of shipping. $order->data['comments'][] = array( 'text' => $this->notas, 'notify' => true, ); // Save order $order->save(); }```
Slettet Fra Ukjent mai 27 2020 12:05 p.m. @tim; This section is called "Feature Requests and New Ideas", I am NOT looking for help, but rather giving an option. Unit should have a new section where customers can schedule a time for delivery/pickup to get their order ready. My solution was to add a calendar option to the Shipping Modules, but this means ALL modules need to be edited. The correct NEW FEATURE would be a new Module "Calendar", to added to checkout page. This new Module would allow companies to install or not install, that depends on their needs and will allow customers to set a time/delivery. Because is a module, it will allow for custom Calendars to be created based on business needs; same as payment or shipping. These changes affect the CORE of the product; Database and Core files; so goes further than a simple Module. I hope this clears things for you.
Slettet Fra Ukjent mai 27 2020 12:09 p.m. @alvaroespinola Álvaro, I will try the 'after_process' function and remove the changes from the Core file. The plan here is NOT for me to edit the DB and Core file, but to submit this as an options that other users may see beneficial. I may be the only with this need, and this is OK too; but other business may see and advantage to set date/time for order delivery. Having this as a Module would allow for developers to create Calendars based on business needs.
alvaroespinola Developer Fra Paraguay Medlem siden mars 2020 alvaroespinola mai 27 2020 04:25 p.m. I think it can be done from the shipping module, the alter table you do in the install method, Then you need a create a new Admin page to show the calendar report, I dont know jet how to do it, i need to do something like this for my payments modules i'm developing, i need to show de payments details in a special reports (because it is a new table)
tim Founder Fra Sweden Medlem siden mai 2013 tim mai 27 2020 11:06 p.m. @user7577 The time of delivery is also dependending on the shipping vendor who would have the last word. Some of them offer APIs for delivery dates. I make use of the options field where I display the form data. I could then use i.e. after_process() to process the data.
Slettet Fra Ukjent mai 28 2020 08:08 a.m. @tim - This is why you need to read the post, even if long. - We are bakery - We don't use external shipping Modules - Customer order a cake for a birthday, so they want to collect from the shop on a set day - Adding the Calendar module would open the product to new customers Clothing shops (for now, in some EU countries) are run by appointment - This means a cloth shop can put their inventory on line, a customer can reserve the item set a time to visit the shop, try them buy them and leave.
mobgro LiteCart Fan Fra United States Medlem siden des. 2016 mobgro aug. 21 2020 11:21 p.m. I just came across this post. I was trying to do something similar with no success. I pay $29.00 a MONTH, just to have a form on my website to do this. My suggestion to anyone that can create "stuff" for litecart. Create it, add to the "add-ons" with a price. ( I personally am willing to pay for what I want for my site, I just want to click a button that says BUY ME and install it).