Hi there

I can't assign Prices when only one country is defined. The country selector on the product edit page is empty.
I have EUR as standard and need only for CHF separate prices. No need to set up other countries.

A trick could be, to ad a line like "please select" in the country selector, that it still works "on change".

Is it also possible to enable one country override by default?
This would save clicks!

Comments

Docc’s picture

Assigned: Unassigned » Docc

Tnx for the bugreport, will fix this in the next commit.

plasticlax’s picture

yes this is happening to me too.

miguel.rincon86’s picture

Hi I like what I have seen of the module so far.

For some really strange reason China is not showing on the Multiprice Defaults selection. I tried disabling/enabling and adding/removing other countries. I curently have Canada, China, Hong Kong, Taiwan and US

I even tried modifiying the html with firebug to force input 156 (the cif code for China)

All I got was An illegal choice has been detected. Please contact the site administrator.

I went into admin/store/settings/countries/edit, to make sure China was imported and enabled. I wonder if the "please select" fix could be hiding a country for some reason. I saw some other cases where not all the countries appeared.

Thank you!

Miguel
SEO and Web Development in Beijing

EDIT: I am on 2.x dev version, sorry I did not put the right fields.

EDIT 2: I now realize that the location of the store affects the way Multiprice works by excluding the "home" country. Congrats on such a smart module, hope we can see a release soon!

plasticlax’s picture

Version: 6.x-1.x-dev » 6.x-1.0

you can always go in and delete the redundant country, but then you cannot reselect it later without deleting both. this is all probably different when using more than 2 options in country.

bartezz’s picture

In addition to the OP, if one sets prices for each available country -> save the node -> edit the node, you will get an error;

warning: Invalid argument supplied for foreach() in includes\form.inc on line 1434.

This is because of this code;

    $exist = array();
    while ($country = db_fetch_object($result)) {
      $form['base']['multiprice']['countries'] += uc_multiprice_field_element($country);
      $exist[] = $country->country_id;
    }
      
    $result = db_query("SELECT country_id, country_name FROM {uc_countries} WHERE version > 0 ORDER BY country_name ASC");
    while ($country = db_fetch_object($result)) {
      if (!in_array($country->country_id, $exist))
        $countries[$country->country_id] = $country->country_name;  
    }

    $form['base']['multiprice']['more'] = array(
      '#type' => 'select',
      '#description' => t("Select the country/region to add a price overide."),
      '#options' => $countries,

This code will check if a price for a country has already been set and if so, delete the country from the countries array.
If one sets a price for each country the $countries array will be empty, therefore the select element to be generated by
the form module has no options!

Temp workaround is using '#options' => (array)$countries,

Think this part of the module needs some more attention....

Cheers

Docc’s picture

Status: Active » Closed (won't fix)

Bartezz dont hijack the issue. Create a new one.

Closing this issue because multiprice is used for different prices for diffferent countries.
Not different prices for one country.

bartezz’s picture

Sorry, thought this was related enough to post in this issue...

But I think eventhough the module is intended for price per country there is validity in the OP. If you have enabled three countries, then edit a product node and set prices for two countries, leaving the price for one country unset, then save the node, then again edit the node, the dropdown has only one available country. Because the dropdown works 'onchange' it will not create a row of fields to set for that one country.

Cheers

Docc’s picture

Yes but thats a different issue then the issue of the starter.

Though noneless. Im not supporting 1.0 anymore. Only security fixes.
Im focusing on 2.x wich has the same functionality and more. Want to push out a stable 2.x asap