Show Order Count on Order Screen
- Dragon41673
-
Topic Author
- Offline
-- Joomla version -- : 3
Is there a way to add to the orders page a listing of how many purchases a customer has done? I ask because currently, I have to manually go look to see if the purchase is by a new customer or not, as it is...it's a major pain in the butt and takes a lot of time.
Just an extra column, showing an order number total, would be perfectly fine with me.
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
In which order listing do you want to display it, on the back-end or the front-end ? Can you show us a screenshot of where you want to display it ? Thank you.
Kind regards,
Mohamed.
Please Log in or Create an account to join the conversation.
- Dragon41673
-
Topic Author
- Offline
Mohamed Thelji wrote: Hello,
In which order listing do you want to display it, on the back-end or the front-end ? Can you show us a screenshot of where you want to display it ? Thank you.
Kind regards,
Mohamed.
I apologize...I would want this on the back end, like the picture below. If possible, in the red highlighted area would be perfect!
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.
Edit the file order / listing for your backend template via the menu Display>Views.
There, after the line:
Please Log in or Create an account to join the conversation.
- Dragon41673
-
Topic Author
- Offline
nicolas wrote: Hi,
Edit the file order / listing for your backend template via the menu Display>Views.
There, after the line:add the code:Code:if(hikashop_isAllowed($config->get('acl_user_manage','all'))) echo $row->user_email.' <a href="'.$url.$target.'"><i class="fa fa-chevron-right"></i></a>';Code:$db = JFactory::getDBO(); $db->setQuery('SELECT count(order_id) as number_of_orders FROM #__hikashop_order WHERE order_user_id = '.$row->user_id.' AND order_status IN (\'confirmed\',\shipped\')'); echo ' ('.$db->loadResult().')';
Ok...I did that...and the whole display for my orders went blank. Attached is a Notepad File of the change I made. Did I not do it right?
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.
Try with that code instead:
Note that I didn't test the code. If you get an error or blank page, please activate the "error reporting" and "debug system" settings of the Joomla configuration and try again and you'll should get more information about the issue. Please provide the full error message so that I can correct the code.
Please Log in or Create an account to join the conversation.
- Dragon41673
-
Topic Author
- Offline
nicolas wrote: Hi,
Try with that code instead:Code:$db = JFactory::getDBO(); $db->setQuery('SELECT count(order_id) as number_of_orders FROM #__hikashop_order WHERE order_user_id = '.$row->user_id.' AND order_status IN (\'confirmed\',\'shipped\')'); echo ' ('.$db->loadResult().')';
Note that I didn't test the code. If you get an error or blank page, please activate the "error reporting" and "debug system" settings of the Joomla configuration and try again and you'll should get more information about the issue. Please provide the full error message so that I can correct the code.
This too did not work...I turned on Error Reporting and Debug...but I simply don't understand what you are needing here. I'm sending log in details so you can see the test site backend yourself. I'll leave this above code in the listing you mentioned and also leave debug & error reporting on so you can see what's going on.
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.
If you check your modified order listing, you can see that the area of the listing is empty, without any error, even with the debug activated.
And if you check the modifications of order / listing, you can see that the view file is completely empty (without any HTML/PHP code). and that's why the listing is not displaying anymore.
This has nothing to do with the modification I proposed. This comes from a security extension which filters out the HTML/PHP of the view file in the HTTP request when you click on the "save" button of the view file.
Looking a bit at the extensions of your website, I found it comes from the JHackGuard Plugin. I've disabled it temporarily via the Joomla plugins manager while doing the change in the view file as explained and it works fine:
i.imgur.com/GOBLLqn.png
Please Log in or Create an account to join the conversation.
- Dragon41673
-
Topic Author
- Offline
So in keeping Jhackguard...how do I go about getting this to work? While it was a long time ago...my previous site manager said to never uninstall that.
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.
As I said, just disable the Jhackguard plugin when you need to do a view override.
Please Log in or Create an account to join the conversation.
- Dragon41673
-
Topic Author
- Offline
nicolas wrote: Hi,
As I said, just disable the Jhackguard plugin when you need to do a view override.
No problem Nicolas, thank you. I just spoke with Siteground (the maker of that plugin) and they no longer support it anyways. In your professional opinion...do you know of another plugin like it that would be good to use?
Thank you very much
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.
I know that RS firewall is used a lot on Joomla websites and I think both do roughly the same thing.
And it seems to be well maintained.
Please Log in or Create an account to join the conversation.
- Dragon41673
-
Topic Author
- Offline
nicolas wrote: Hi,
I know that RS firewall is used a lot on Joomla websites and I think both do roughly the same thing.
And it seems to be well maintained.
Fantastic, thank you very much for the referral. I was actually looking at that, but having someone in your position recommend it tends to put a different light on the plugin.
Owner - Aries Games & Miniatures
Please Log in or Create an account to join the conversation.