News:

Looking for documentation? Take a look on our wiki

Main Menu

Make Country first in Virtuemart 2

Started by tarku, February 16, 2013, 10:00:58 AM

Previous topic - Next topic

tarku

Hi
My joomla version is 2.5.9 and virtuemart version 2.0.18a and php version is 5.3.8
The problem i want to make the USA country to come first on detail page drop down of country
I have seen the #__virtuemart_countries table there is one column of ordering.
I have changed the ordering of this country so that i can pick it by ordering

But I did not found the sql query any where #__virtuemart_countries
So please let me know which file to change it
Or there is any option to do it on admin panel
Please help me out it is very urgent
Thank you for any help...

GJC Web Design

administrator/components/com_virtuemart/elements/vmcountries.php

$query = 'SELECT `virtuemart_country_id` AS value, `country_name` AS text FROM `#__virtuemart_countries`
                WHERE `published` = 1 ORDER BY `country_name` ASC '
        ;
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

tarku

thank you so much GJC Web Design for your reply
but it did not make any effect
even i have removed the query
$query = 'SELECT `virtuemart_country_id` AS value, `country_name` AS text FROM `#__virtuemart_countries`
                     WHERE `published` = 1 ORDER BY `ordering` '
        ;
and after than i removed this function fetchElement($name, $value, &$node, $control_name)
there is no effect in the front end.
when the user entering his BT details editaddresscheckoutBT
I donot know where to do these changes..PLease help it is urgent

GJC Web Design

#3
Sorry - that function I now see is only for plugins
it's in administrator/components/com_virtuemart/models/country.php ~ line 86 -  function getCountries()

change

$ordering = $this->_getOrdering();

to

//$ordering = $this->_getOrdering();
$ordering = ' ORDER BY ordering DESC';


note the space between   =' ORDER

and as they REALLY don't want you to do this.. ;)

administrator/components/com_virtuemart/helpers/shopfunctions.php line ~ 275

comment out

//asort($sorted_countries);
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

tarku

Hi GJC Web Design
I make the following changes of this file administrator/components/com_virtuemart/models/country.php
but i did not comment the following lines
asort($sorted_countries) in this file
administrator/components/com_virtuemart/helpers/shopfunctions.php

I really thankful to GJC Web Design you always give the quick reply to this post and help me to complete it on time
Thank you so much you have made my day.

GJC Web Design

No prob

the
Quoteadministrator/components/com_virtuemart/helpers/shopfunctions.php line ~ 275

comment out


//asort($sorted_countries);



is only for the shopper registration dropdown

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