Post by AdieB » Tue Jan 15, 2019 9:09 pm

I have installed v3.0.2 on localhost. I have designed a single product that uses data (from a form in view) from a MYSql DB and returns up to 6 possible results. The user may then select one result and head off to checkout. Basically the form accepts shipping data for courier, calculates weight and shipping town and returns the 6 possible shipping options from data received. The "product" works fine as standalone and is made up of 6 files, namely,
a View file - consisting of HTML/PHP with a form and will also ultimately display the results - I still have to convert to TWIG.
a Model - which interacts with the DB and does the number crunching
a Controller - which GETs form info and converts to usable info - and interacts with the view
3 X Class files made up of Methods which the model uses to interact with the DB etc.
So, now that I have this "calculator" working in a simple MVC (all in one directory) I need to adapt it to the Opencart MVCL structure.
I am just really looking at some ideas for a starting point and some guidance. There will only ever be the one product in the site, so I am most likely going to completely replace the product.php and not use ?OCMOD?
Before I dive into OC, just a gentle nudge in the right direction would really help please.
My previous and very alive site using OC v1.5.4 can be seen at www.ic-express.co.za and is long overdue for an update (our developer has disappeared and hence the development in-house), but uses a very similar concept.
Many thanks in advance.

New member

Posts

Joined
Mon May 19, 2014 9:01 pm

Post by straightlight » Wed Jan 16, 2019 6:24 am

My previous and very alive site using OC v1.5.4 can be seen at www.ic-express.co.za and is long overdue for an update (our developer has disappeared and hence the development in-house), but uses a very similar concept.
Create a new service request in the Commercial Support section of the forum to get this done as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by AdieB » Wed Jan 16, 2019 2:45 pm

Thanks for replying, but I specifically didn't place in the developers section as we are attempting to do the project inhouse. I was hoping for a few pointers before diving into OC. I have read a lot about the route and directory structure, but have not found much documentation available on OC.
Outsourcing to a developer is a last resort at this stage, as we would rather obtain the skills inhouse.

New member

Posts

Joined
Mon May 19, 2014 9:01 pm

Post by pprmkr » Wed Jan 16, 2019 4:13 pm

Diving into OpenCart is the only way to learn the differences between the versions.

Compare code and change the lines and add some text and variabeles. Most work will go into the template files / code, from php to twig.

A few examples of changes:

Code: Select all

$this->language->load('product/product'); -> $this->load->language('product/product');
$this->data['breadcrumbs'] = array(); -> $data['breadcrumbs'] = array();

<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a> -> <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
When your mod is done by vQmod, change it to OCMod.
Needs just a few changes, like :

Code: Select all

<file name="system/startup.php,system/engine/*.php,system/library/*.php,admin/controller/extension/*.php"> -> <file path="system/{engine,library}/{action,loader,config,language}*.php|system/library/template/template.php">

<search position="replace" ->  <add position="replace"

<id> -> <name>
 
And addition of <code> to identify it ...

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by straightlight » Wed Jan 16, 2019 6:47 pm

When your mod is done by vQmod, change it to OCMod.
For the most recent OC versions, it is more recommended to use the Events than OCMod according to GitHub.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 262 guests