Page 1 of 1
HTML Content adding placeholder for "Total Orders"?
Posted: Wed Nov 08, 2017 12:10 am
by Monarchy Catering
Is it possible to display the current number of "Total Orders" inside an HTML Content Module please?
Thanks.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Wed Nov 08, 2017 5:51 pm
by sachin6609
Monarchy Catering wrote: ↑Wed Nov 08, 2017 12:10 am
Is it possible to display the current number of "Total Orders" inside an HTML Content Module please?
Thanks.
Hello
please share a screen shot on which page you want to Show Total Orders.??
Thanks
sachin
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Wed Nov 08, 2017 6:49 pm
by Monarchy Catering
sachin6609 wrote: ↑Wed Nov 08, 2017 5:51 pm
Monarchy Catering wrote: ↑Wed Nov 08, 2017 12:10 am
Is it possible to display the current number of "Total Orders" inside an HTML Content Module please?
Thanks.
Hello
please share a screen shot on which page you want to Show Total Orders.??
Thanks
sachin
Hello, and thanks for the reply.
It would be on the Home page, in any module or code format that would work.
Thank you.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Wed Nov 08, 2017 10:47 pm
by straightlight
If you mean by using a parsed tag, it would require some coding into your admin/view/javascript/summernote/summernote.js file along with the font keys but instead of font keys, you'd return your total orders results with your used parsed tag key inside your HTML module. From the catalog-end, you'd need to convert this parsed tag key back into the total orders text.
With that being said, you'd need to re-capture the total orders from the catalog-end in order to obtain the total order results. In other words, it could be done but would not be the most simplistic approach to use. Rather to create a separate row in your catalog-end page that would simply display the total orders for that particular element you've selected would be much simplistic.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Sat Nov 11, 2017 6:21 pm
by Monarchy Catering
straightlight wrote: ↑Wed Nov 08, 2017 10:47 pm
If you mean by using a parsed tag, it would require some coding into your admin/view/javascript/summernote/summernote.js file along with the font keys but instead of font keys, you'd return your total orders results with your used parsed tag key inside your HTML module. From the catalog-end, you'd need to convert this parsed tag key back into the total orders text.
With that being said, you'd need to re-capture the total orders from the catalog-end in order to obtain the total order results. In other words, it could be done but would not be the most simplistic approach to use. Rather to create a separate row in your catalog-end page that would simply display the total orders for that particular element you've selected would be much simplistic.
Yikes, I thought the OC technology would be more mature and the page generation has basic access to overall sales / catalog data
I must admit that I am a convert to OC being a Magento developer, much more intutitve and robust.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Sat Nov 11, 2017 11:15 pm
by straightlight
The technology is there in Opencart. You just need to know how to combine those basic features all together.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Sun Nov 12, 2017 5:57 am
by Qphoria
Monarchy Catering wrote: ↑Wed Nov 08, 2017 6:49 pm
Is it possible to display the current number of "Total Orders" inside an HTML Content Module please?
Thanks.
Are you asking for total orders that the customer has placed?
Or are you asking for total site orders ? Do you want this visible for all to see?
Either are quite easy to display.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Sun Nov 12, 2017 3:08 pm
by Monarchy Catering
Qphoria wrote: ↑Sun Nov 12, 2017 5:57 am
Monarchy Catering wrote: ↑Wed Nov 08, 2017 6:49 pm
Is it possible to display the current number of "Total Orders" inside an HTML Content Module please?
Thanks.
Are you asking for total orders that the customer has placed?
Or are you asking for total site orders ? Do you want this visible for all to see?
Either are quite easy to display.
Hello,
I am looking to display "TOTAL SITE ORDERS", as we are moving from our old site which has been active for almost 10 years now.
I love the term "Easy"
Thanks.
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Mon Nov 13, 2017 9:24 am
by Qphoria
It's just odd that you'd want to show private information like that on the homepage but yea easy..
You have a few options.
1. You can create a module
This means you need to create all the supporting files for a module (at least 6 files, (admin side controller, language, view) (catalog side controller, language, view). This will then let it use the module system. But might be more than you need for displaying just some simple data.
2. Create a simple vQmod to alter the homepage or header and have the data shown there.
I'll explain this method as you like the "Easy" term. And I'll assume you want it shown in the header so that it shows on all pages. But if you only want it on certain pages, you can swap out the header controller for a different controller that you want to show it on. Controllers are basically the base page. So the "home" controller controls whats on the home page, the account controller controls whats on the account page.. and so on.
Controller:
a. EDIT: catalog/controller/common/header.php
b. Find:
c. After, add:
Code: Select all
$data['order_count'] = $this->db->query("SELECT count(*) FROM `" . DB_PREFIX . "order`")->row['count(*)'];
View:
In 2.3 you could edit the theme files directly. In 3.0, you use the admin theme editor. This will override the default.
a. Goto Admin->Design->Theme Editor
b. Load common/header.twig
c. Find:
d. After, add:
Code: Select all
Total # of Orders: {{ order_count}}
That will show you the order count as shown in the screenshot attached. Obviously you'll want to style this better and likely move it to another location but this should give you a bit of understanding how to do it. It is really quite easy.... ignore the dramatic folks.
Ideally you'd create this as a vQmod (or ocmod) file so that you don't need to edit core files. But baby steps...
Re: HTML Content adding placeholder for "Total Orders"?
Posted: Tue Nov 14, 2017 4:29 am
by Monarchy Catering
Total Sales is not really private as such and the number of sales will highlight have successful the website is and give the prospective customer some confidence in the website
I really want to show the totals sales as part of the introductory text regarding the business on the Home Page.
Thank you for taking the time. It actually seems extremely straightforward and I'll try my first OCMOD file.
Will let you know.
Thank you and best wishes.