Author Topic: [SOLVED] How to disable AJAX in order list?  (Read 250 times)

gba

  • Jr. Member
  • **
  • Posts: 224
[SOLVED] How to disable AJAX in order list?
« on: October 31, 2017, 10:36:24 am »
Hi!

When I click on an order number in frontend order list, the order is loaded below via AJAX.
I do not want this, because if the list is long, the user does not see the order loaded and just thinks, nothing happened.
In the code of list.php I noticed a VM config setting 'ajax_order'.
But I can find this setting neither in VM backend config nor in virtuemart.cfg file.

Sure, I could create an own list layout without the AJAX loading code and add a hidden config 'layout_order_list=mylist'.
But to me it seems this is a VM config setting.
So where can I disable AJAX loading in order list?

Thank you very much in advance for any useful hints!

Kind regards,
Gerald

gba

  • Jr. Member
  • **
  • Posts: 224
Re: How to disable AJAX in order list?
« Reply #1 on: November 02, 2017, 16:56:42 pm »
No one any idea?
Even not VM team?
 ???

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 605
  • Software Developer {PHP, JavaScript, jQuery, ...}
    • www.virtueplanet.com
  • VirtueMart Version: 3.2.4
Re: How to disable AJAX in order list?
« Reply #2 on: November 03, 2017, 06:20:12 am »
Are you using any 3rd party template? Check using a standard template like Protostar, Beez3 etc.

gba

  • Jr. Member
  • **
  • Posts: 224
Re: How to disable AJAX in order list?
« Reply #3 on: November 03, 2017, 06:49:30 am »
Hi!

Thank you for your reply.
The 3rd party template is not relevant in this case.
As I wrote, the list.php of VM itself (/components/com_virtuemart/views/orders/tmpl/) contains the config setting mentioned.
For example at line 25:
Code: [Select]
if(VmConfig::get ('ajax_order', TRUE)){
$ajaxUpdate = 'data-dynamic-update="1"';
}

I just need to find the config setting 'ajax_order'.
But where?

Kind regards,
Gerald

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2333
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: How to disable AJAX in order list?
« Reply #4 on: November 03, 2017, 11:46:13 am »
Change
if(VmConfig::get ('ajax_order', TRUE)){
   $ajaxUpdate = 'data-dynamic-update="1"';
}
To
if(VmConfig::get ('ajax_order', FALSE)){
   $ajaxUpdate = 'data-dynamic-update="1"';
}
This is then deactivate by default.

gba

  • Jr. Member
  • **
  • Posts: 224
Re: How to disable AJAX in order list?
« Reply #5 on: November 03, 2017, 20:13:46 pm »
Hi!

 ;D
Thank you for your code.
What exactly do you recommend me - hacking the core, what will be overwritten by the next VM update, or creating an override using the hidden config I mentioned at the very beginning of this thread?

Actually I asked for the place where I can deactivate that setting itself - not deactivating code that uses this setting.

Kind regards,
Gerald

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2333
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y

gba

  • Jr. Member
  • **
  • Posts: 224
Re: How to disable AJAX in order list?
« Reply #7 on: November 07, 2017, 11:53:20 am »
Hi!

Thank you for that link (actually the list of hidden config parameters is not up-to-date).
I added
Code: [Select]
ajax_order=falseto virtuemart.cfg and saved the VM configuration in the backend.
Now 'ajax_order' has the default value I set.
But it is a string. How can I set a boolean in the hidden config?

Kind regards,
Gerald

EDIT:
I found out now:  Instead of
Code: [Select]
ajax_order=false I need to add
Code: [Select]
ajax_order=0 to the hidden config file.