News:

Looking for documentation? Take a look on our wiki

Main Menu

aggiornamento da 3.4.2 a VirtueMart 3.6.0 10113

Started by giriga, August 30, 2019, 17:13:08 PM

Previous topic - Next topic

giriga

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:

GJC Web Design

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;
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

giriga


giriga

I added string as you say, now this happens (see image)

GJC Web Design

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();

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

giriga

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)

GJC Web Design

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();
               }
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

giriga


GJC Web Design

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();
               }
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

giriga


GJC Web Design

then your still writing it wrong.. that is a simple syntax error.. chk your code
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

giriga


GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

giriga


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/