I just noticed that some of the queries is does also need joomla to use the name jos.
For example tax:
SELECT tax_rate FROM jos_vm_tax_rate where tax_rate_id = (SELECT shipping_rate_vat_id FROM jos_vm_shipping_rate where shipping_rate_id = ".$order_shipping_rate_id.")
I just noticed that some of the queries is does also need joomla to use the name jos.
For example tax: rate_vat_ id FROM jos_vm_ shipping_ rate where shipping_rate_id = ".$order_ shipping_ rate_id. ")
SELECT tax_rate FROM jos_vm_tax_rate where tax_rate_id = (SELECT shipping_