Post by DonBasti1st » Wed Mar 06, 2019 10:50 pm

Hi folks
One of my dumb questions again, sry.
I want to develop some kind of booking tool where a user can book into an event (OC 3.0.2).
The concept is like this:
- The admin sets a Time for a special event (date, description, price, etc.) using a date picker in the backend (and defining description and so on)
- The user adds this event to his shopping cart and checks out after he did his shopping.
How would you go on in this?
Would you enhance the given product functionality (maybe by oc'ing the product.php)?
Or, would it be better to write a complete custom module (if yes, how much pain is it to implement this kind of product into the checkout/ cart - functionality)?
I am currently just playing around to find a good solution to walk through this. And after two days I am still not sure.
Do you have any advice, maybe? please?

Thanks in advance,




Fri Nov 16, 2018 6:47 pm

Post by straightlight » Sat Mar 09, 2019 11:48 pm

The solutions are simple.

1 - To look for an extension on the Marketplace that may match your request
2 - If option 1 do not match your requirements; to create a Service Request in the Commercial Support section of the forum to get this done as a custom job.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Straightlight Administrator / Quality Assurance Analyst / Programmer

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by DonBasti1st » Wed May 08, 2019 8:23 pm

Thank you straightlight for your reply.

Don't get me wrong, but pointing me to a sold service was not the answer I was expecting in an Open Source forum.
Being a Dev myself for some 20 years now and beeing active in a couple of other forums (mainly .net & game dev) I know there is plenty of people out there expecting to get a complete working custom solution only by asking for it.
But, I was not asking for anyone to do my homework. I was asking for an advice on how to go on with like this. I am willing to do the work on my own, but as a newbie in opencart and, to be honest, with a lack of good tutorials and documentation about module dev in oc, I just wanted to understand how to start with like this.

Anyways, for those who struggle with a similar kind of problem:
Working with the given logic makes it easier when it comes to product display, checkout, rewards and all this stuff.
So, for me, the best solution was to take the existing product logic and enhance it to fit my needs.
Therefor I OCModded the given product environment to get an additional field (calendar picker) for my needs. (Btw. debugging ocmod is still a pain for me).
I attached an early version of my mod, but beware! The Attached install.xml is a pretty early state of development and is just a prove of concept!
There also needs to be a database table to be created (which I did in the install function of the module)

function install() in my module (part of):

Code: Select all

public function install() {
		$sql = "CREATE TABLE `" . DB_PREFIX . "pd_booking_calendar` ( `id` INT NOT NULL AUTO_INCREMENT , `productid` INT NOT NULL , `startdate` 	DATETIME NOT NULL , `enddate` DATETIME NOT NULL , PRIMARY KEY (`id`)) ENGINE = MyISAM;";
After making these changes it was easy to develop a custom module which is grabbing and using the given data.
Feel free to grab the attached stuff and use it for your needs. Hope that helps anyone.

Best regards,





Fri Nov 16, 2018 6:47 pm
Who is online

Users browsing this forum: No registered users and 6 guests