VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: tarku on February 16, 2013, 10:00:58 AM

Title: Make Country first in Virtuemart 2
Post by: tarku on February 16, 2013, 10:00:58 AM
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...
Title: Re: Make Country first in Virtuemart 2
Post by: GJC Web Design on February 16, 2013, 15:26:27 PM
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 '
        ;
Title: Re: Make Country first in Virtuemart 2
Post by: tarku on February 18, 2013, 04:52:39 AM
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
Title: Re: Make Country first in Virtuemart 2
Post by: GJC Web Design on February 18, 2013, 08:39:44 AM
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);
Title: Re: Make Country first in Virtuemart 2
Post by: tarku on February 18, 2013, 09:05:51 AM
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.
Title: Re: Make Country first in Virtuemart 2
Post by: GJC Web Design on February 18, 2013, 09:22:21 AM
No prob

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

comment out


//asort($sorted_countries);



is only for the shopper registration dropdown