News:

Looking for documentation? Take a look on our wiki

Main Menu

Differentiate between "no country selected" and "no country + all countries "

Started by e-trader, November 08, 2013, 18:09:29 PM

Previous topic - Next topic

e-trader

Hello all - is the following possible? It seems not and looks like a shortcoming in the rule system.

In the calculation rules, leaving countries empty means "no country selected + any country selected".
When wanting to setup a calculation rule for anonymous guests that apply when no country is selected yet, you leave country empty (rule 1). That works.
Then, how could one configure a second rule for anonymous users, specific to countries without making the first rule apply also (and get a double calculation).

One can not differentiate between "no country selected" and "no country + all countries".


VM 2.0.24. I don't expect any replies, just praying somebody from the VM team will pick this up

nkou

I face the same problem. However, in my case I could use a default country_id for visitor shoppers that have not set their country just yet.
Unfortunately, my hack had to be done in vm core:
administrator/components/com_virtuemart/helpers/calculationh.php (line 216, for 2.0.20b)

if ($stBased and !empty($this->_cart->ST['virtuemart_country_id'])) {
$this->_deliveryCountry = (int)$this->_cart->ST['virtuemart_country_id'];
} else if (!empty($this->_cart->BT['virtuemart_country_id'])) {
$this->_deliveryCountry = (int)$this->_cart->BT['virtuemart_country_id'];
} /*nkou: added greece id as default for visitors*/else {
$this->_deliveryCountry = 84;
}


Hopefully, we'll find a better solution.