VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: giriga on August 30, 2019, 17:13:08 PM

Title: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 30, 2019, 17:13:08 PM
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:
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on August 30, 2019, 19:55:09 PM
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;
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 31, 2019, 10:19:31 AM
here is the debug look at image
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 31, 2019, 10:28:22 AM
I added string as you say, now this happens (see image)
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on August 31, 2019, 11:14:27 AM
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();

Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 31, 2019, 12:44:33 PM
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)
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on August 31, 2019, 15:06:12 PM
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();
               }
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 31, 2019, 16:06:42 PM
hi, look at the picture, it doesn't work
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on August 31, 2019, 16:54:17 PM
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();
               }
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 31, 2019, 17:08:58 PM
Hi, this is the result look image
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on August 31, 2019, 18:19:00 PM
then your still writing it wrong.. that is a simple syntax error.. chk your code
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on August 31, 2019, 19:42:58 PM
Write you, thanks, here's the file
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on August 31, 2019, 20:24:47 PM
try this
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on September 01, 2019, 10:44:14 AM
Hi, thank you very much! solved problem  ;D
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: Milbo on September 06, 2019, 20:21:17 PM
The fix is in vm3.6.1 http://dev.virtuemart.net/attachments/1177/com_virtuemart.3.6.1.10121_package_or_extract.zip
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on September 11, 2019, 18:45:43 PM
Hi , does not work cart quantity button

see image

regards
Antonio
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: giriga on September 11, 2019, 19:39:57 PM
hi, I did a local test, I can confirm that with the old version the button worked
Title: Re: aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113
Post by: GJC Web Design on September 12, 2019, 13:33:06 PM
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