How to use the virtuemart.cfg, change defaults and use hidden options

Started by Milbo, March 22, 2015, 17:33:04 PM

Previous topic - Next topic

Milbo

The VirtueMart configuration has its defaults delivered in the virtuemart.cfg-dist. The configuration loader tries first to load the configuration from the virtuemart_configs table. If not accessible it tries to load the virtuemart.cfg, which is not in the installation package and therefore not overwritten. If there is no virtuemart.cfg available, the virtuemart.cfg-dist is copied as virtuemart.cfg.

So if you want to use an option for the installation like dblayoutstrict, dbpsdescsize, dbnamesize. Or an rarely used pro option which has no GUI, then you just need to get this into your configuration.

Just open the virtuemart.cfg (at /administrator/components/com_virtuemart/virtuemart.cfg) and you can preset any value used in VmConfig::get('myvalue',default). In the example it would be just the line myvalue=default. Save the file and enter the virtuemart backend.

If you use Vm3, just store the vm config 1 time. The configuration file is load first and overwritten by the form and you should keep all settings.
In Vm2, you must use the button in tools "udpate config by file", be aware that you loose your settings then.

Of course you could theoretically set all config defaults into the virtuemart.cfg (interesting for retailers actually).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/