Hi, I updated my virtuemart from 3.4.2 to VirtueMart 3.6.0 10113 I have Joomla 3.9.11 I have a problem with my cart here are the images:
enable JOOMLA debug so you can see where the sql is being formed
also you can see the actual query if u do this:
Report db query error with query
Add the actual query to the error
\libraries\joomla\database\driver\mysqli.php ~ line 650
add this line after $this->errorMsg = $this->getErrorMessage();
$this->errorMsg = $this->errorMsg.' - '.$query;
here is the debug look at image
I added string as you say, now this happens (see image)
you have a syntax error
as the message says -- probably the $ missing
the query is coming from the states model
//Test if virtuemart_state_id fits to virtuemart_country_id
$q = 'SELECT * FROM `#__virtuemart_states` WHERE `virtuemart_country_id`= "'.$countryId.'" AND `virtuemart_state_id`="'.$stateId.'" and `published`="1"';
you need to see what $q is - add directly after line 127 administrator\components\com_virtuemart\models\state.php
print 'Debug Line '.__LINE__.' $q <pre>'; print_r ($q); print "</pre><br />\n"; die();
sorry I'm not very practical, can you send the correct files?
I tried to add your code, but it didn't solve the problem (see image)
Its not supposed to solve anything .. it is to give u information to find what is wrong
again your syntax is completely wrong -- please google some basic php skills
if(!isset($c[$h])){
//Test if virtuemart_state_id fits to virtuemart_country_id
$q = 'SELECT * FROM `#__virtuemart_states` WHERE `virtuemart_country_id`= "'.$countryId.'" AND `virtuemart_state_id`="'.$stateId.'" and `published`="1"';
print 'Debug Line '.__LINE__.' $q <pre>'; print_r ($q); print "</pre><br />\n"; die();
$db->setQuery($q);
$c[$h] = $db->loadResult();
}
hi, look at the picture, it doesn't work
It exactly works -- it shows the query ...
ah -- I think $db isn't set
do this
if(!empty($stateId)){
$h = $countryId.'.'.$stateId;
if(!isset($c[$h])){
// GJC add this
$db = JFactory::getDBO();
//GJC add this
//Test if virtuemart_state_id fits to virtuemart_country_id
$q = 'SELECT * FROM `#__virtuemart_states` WHERE `virtuemart_country_id`= "'.$countryId.'" AND `virtuemart_state_id`="'.$stateId.'" and `published`="1"';
//print 'Debug Line '.__LINE__.' $q <pre>'; print_r ($q); print "</pre><br />\n"; die();
$db->setQuery($q);
$c[$h] = $db->loadResult();
}
Hi, this is the result look image
then your still writing it wrong.. that is a simple syntax error.. chk your code
Write you, thanks, here's the file
try this
Hi, thank you very much! solved problem ;D
The fix is in vm3.6.1 http://dev.virtuemart.net/attachments/1177/com_virtuemart.3.6.1.10121_package_or_extract.zip
Hi , does not work cart quantity button
see image
regards
Antonio
hi, I did a local test, I can confirm that with the old version the button worked
you have to supply a live url if u want help with this ... the quantity works by JS and the error can only be found in the live console
I would assume it is your template so u should compare the code there with the standard sublayout cart buttons etc