News:

Looking for documentation? Take a look on our wiki

Main Menu

"No shop currency defined" error

Started by dmb, January 12, 2019, 13:03:56 PM

Previous topic - Next topic

EsSa55


EsSa55

So, I did a local install of the latest JM/VM combo and, no problem.

Not sure what that means, but a fresh installation for a Live site is hardly an option.

jjk

Just a guess: It's not visible in your screenshots, but looking at your site it seems that you are using the third party 'PayPal Pro Plugin' which hasn't been updated since 30 April 2018. Do you get the same error if you use the original VirtueMart PayPal plugin?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

EsSa55

Hello jjk

Thanks but the plugin version is as current as Today. So, wherever you have seen April 2018 is not correct.

Also, the issue does apply to Every payment plugin, 'indigenous' and 3rd party

TIA

jjk

Quote from: EsSa55 on September 09, 2019, 20:01:06 PM
Thanks but the plugin version is as current as Today. So, wherever you have seen April 2018 is not correct.
I did see that here: https://plugins.online-store.co.uk/paypal_payments_pro/changelog.html

And btw - my Firefox Inspector shows a javascript error and a parsing error on your site. Probably not related to your currency problem, but maybe you should look into those, too.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

EsSa55

Yes, the changelog is rather out of date.

The current version is actually 1.3.25, dated within the last few days and for VM3.6

Thanks for the advice re the issue

Milbo

What delivers this query?


$q = 'SELECT *  FROM `#__virtuemart_currencies` AS c
LEFT JOIN `#__virtuemart_vendors` AS v ON  c.virtuemart_currency_id = v.vendor_currency
WHERE v.virtuemart_vendor_id = "' . (int)$_vendorId . '"';


you may execute it per phpmyadmin, of course replace the #__ with your prefix.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

EsSa55

1 errors were found during analysis.

Ending quote ' was expected. (near "" at position 219)

Position 219?

Anyway, added ' at end:

SELECT * FROM `u84uz_virtuemart_currencies` AS c LEFT JOIN `u84uz_virtuemart_vendors` AS v ON c.virtuemart_currency_id = v.vendor_currency WHERE v.virtuemart_vendor_id = "' . (int)$_vendorId . '"';'

Result:

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0008 seconds.)

Result is the same on any of my other databases where the same tables exist so was desired result achieved?

Milbo

#38
Then you must look in your tables. The query is correct and works. You must of course also replace this part ' . (int)$_vendorId . ' against your vendorId, usually 1.
lets debug the vendorId.

Do not use this nonsense here

print 'Debug Line '.__LINE__.' $_vendorCurrencies <pre>'; print_r (self::$_vendorCurrencies[$_vendorId]); print "</pre><br />\n";


just use instead

vmdebug('my vendor id and currencies',$_vendorId, self::$_vendorCurrencies);


and enable the vmdebug. Maybe your vendorId is zero, or some unexpected number.[/code]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

or lets try that one


static function getVendorCurrency ($_vendorId) {
if(empty($_vendorId)){
vmTrace('getVendorCurrency vendor Id empty');
$_vendorId = 1;
}
......(rest of function)


So if an empty VendorId is the problem, we see where it is called and the vendorId is set to 1, so it should work (for singlevendor stores).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

EsSa55

Sorry, I'm lost now.

I had not changed your original code to include vendorid=1

Kindly let me now have the complete correct code, with vendorid =1

TIA

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

EsSa55

Whether for this reason, or not, updating to:

http://dev.virtuemart.net/attachments/1181/com_virtuemart.3.6.1.10144_package_or_extract.zip

solved the issue for me, for all payment plugins.

Thanks

Milbo

Please tell us the result of the vmTrace. You must enable the debug for that, maybe just for admin.

It works now, because there is a fallback to vendorId=1.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

stAn99

hello, i get the same error:
COM_VIRTUEMART_CONF_WARN_NO_CURRENCY_DEFINED

i've traced mine down to:

if(empty($this->_cache->virtuemart_vendor_id)){
$this->_cache[$this->_id]->virtuemart_vendor_id = vmAccess::getVendorId('paymentmethod.edit');
}


which incorrectly returns FALSE instead of the single vendor which is being used.

so commenting this seems to fix the problem at
\administrator\components\com_virtuemart\models\paymentmethod.php


further debugging of vmaccess:
- when a 3rd party plugin loads VM at backend too early such as backtrace1 below
- virtuemart incorrect recognizes vmDefines::$_appId=='site' OR it's altered by 3rd party

i suggest to remake acl not to cache statically the state of the application, i.e. to replace all

if(self::$_site === null) {
//all occurances
}


with non-cached version:

$app = JFactory::getApplication();
self::$_site = $app->isSite();


especially in manager function which triggers this.


backtrace:
administrator/components/com_virtuemart/helpers/config.php 85
administrator/components/com_virtuemart/helpers/config.php 468
administrator/components/com_awocoupon/helper/estore/virtuemart/class-awocoupon-helper-estore-virtuemart-currency.php 22
administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-helper.php 441
administrator/components/com_awocoupon/helper/awocoupon.php 88
plugins/system/awocoupon/awocoupon.php 32


stan
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart