Jump to content

ktapet

Members
  • Posts

    3
  • Joined

  • Last visited

About ktapet

  • Birthday 03/06/1970

Profile Information

  • Location
    Romania
  • Interests
    mountain
  • Activity
    Freelancer

ktapet's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hi, there is no bug here! Just update paypal module to the last version: 3.6.8. I tested two different cases: prestashop 1.5.2 and paypal 3.6.8 and prestashop 1.6 and paypal 3.6.8 and works fine both. I think the problem you have is because you don't set the correct currency restrictions on payment tab for paypal module. All you have to do is to go in module>payment and be sure to check a currency that is accepted by paypal: Example: supose we have 2 curency: dollar and lei(lei is not supported by paypal). In PS 1.5.2 i have in currency restrictions section for each currency (in my case dollar and lei) one checkbox for each payment module and another 2 radio boxes : one for 'Customer currency' and one for 'Shop default currency'. The only way is work is to check the dollar checkbox and the 'Customer currency' radio box on the paypal column. For PS 1.6 is easier, we have on paypal column only radio boxes and works with 'Customer currency' radio box(if is paypal supported) or dollar radio box checked.
  2. did you delete the /cache/class_index.php file after you add override/controllers/admin/AdminImportController.php file?
  3. I made a succesfully customers import incl. passwords(update from ps_1.3.7 to ps_1.6) with some additions to Gonebdg post: I don't know why, but Prestashop Developers wants to re-encrypt the passwords from the csv file. The encription is make in line 2323 from customerImport method of AdminImportController.php and the code is: ******* if ($customer->passwd) $customer->passwd = Tools::encrypt($customer->passwd); ******* The solution i founded was to comment those 2 lines and let the passwords as they are extracted from the old prestashop database in the csv file, where was added already encrypted when customers created their accounts. To do that I overrided AdminImportController.php by adding overide/controllers/admin/AdminImportController.php with the following code on it: *********************************** <?php class AdminImportController extends AdminImportControllerCore { public function customerImport() { $customer_exist = false; $this->receiveTab(); $handle = $this->openCsvFile(); $default_language_id = (int)Configuration::get('PS_LANG_DEFAULT'); $id_lang = Language::getIdByIso(Tools::getValue('iso_lang')); if (!Validate::isUnsignedId($id_lang)) $id_lang = $default_language_id; AdminImportController::setLocale(); for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, $this->separator); $current_line++) { if (Tools::getValue('convert')) $line = $this->utf8EncodeArray($line); $info = AdminImportController::getMaskedRow($line); AdminImportController::setDefaultValues($info); if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id']) $customer = new Customer((int)$info['id']); else { if (array_key_exists('id', $info) && (int)$info['id'] && Customer::customerIdExistsStatic((int)$info['id'])) $customer = new Customer((int)$info['id']); else $customer = new Customer(); } if (array_key_exists('id', $info) && (int)$info['id'] && Customer::customerIdExistsStatic((int)$info['id'])) { $current_id_customer = $customer->id; $current_id_shop = $customer->id_shop; $current_id_shop_group = $customer->id_shop_group; $customer_exist = true; $customer_groups = $customer->getGroups(); $addresses = $customer->getAddresses((int)Configuration::get('PS_LANG_DEFAULT')); } // Group Importation if (isset($info['group']) && !empty($info['group'])) { foreach (explode($this->multiple_value_separator, $info['group']) as $key => $group) { $group = trim($group); if(empty($group)) continue; $id_group = false; if (is_numeric($group) && $group) { $myGroup = new Group((int)$group); if (Validate::isLoadedObject($myGroup)) $customer_groups[] = (int)$group; continue; } $myGroup = Group::searchByName($group); if (isset($myGroup['id_group']) && $myGroup['id_group']) $id_group = (int)$myGroup['id_group']; if (!$id_group) { $myGroup = new Group(); $myGroup->name = Array($id_lang => $group); if ($id_lang != $default_language_id) $myGroup->name = $myGroup->name + array($default_language_id => $group); $myGroup->price_display_method = 1; $myGroup->add(); if (Validate::isLoadedObject($myGroup)) $id_group = (int)$myGroup->id; } if ($id_group) $customer_groups[] = (int)$id_group; } } elseif(empty($info['group']) && isset($customer->id) && $customer->id) $customer_groups = array(0 => Configuration::get('PS_CUSTOMER_GROUP')); AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $customer); //if ($customer->passwd) //$customer->passwd = Tools::encrypt($customer->passwd); $id_shop_list = explode($this->multiple_value_separator, $customer->id_shop); $customers_shop = array(); $customers_shop['shared'] = array(); $default_shop = new Shop((int)Configuration::get('PS_SHOP_DEFAULT')); if (Shop::isFeatureActive() && $id_shop_list) { foreach ($id_shop_list as $id_shop) { if (empty($id_shop)) continue; $shop = new Shop((int)$id_shop); $group_shop = $shop->getGroup(); if ($group_shop->share_customer) { if (!in_array($group_shop->id, $customers_shop['shared'])) $customers_shop['shared'][(int)$id_shop] = $group_shop->id; } else $customers_shop[(int)$id_shop] = $group_shop->id; } } else { $default_shop = new Shop((int)Configuration::get('PS_SHOP_DEFAULT')); $default_shop->getGroup(); $customers_shop[$default_shop->id] = $default_shop->getGroup()->id; } //set temporally for validate field $customer->id_shop = $default_shop->id; $customer->id_shop_group = $default_shop->getGroup()->id; if (isset($info['id_default_group']) && !empty($info['id_default_group']) && !is_numeric($info['id_default_group'])) { $info['id_default_group'] = trim($info['id_default_group']); $myGroup = Group::searchByName($info['id_default_group']); if (isset($myGroup['id_group']) && $myGroup['id_group']) $info['id_default_group'] = (int)$myGroup['id_group']; } $myGroup = new Group($customer->id_default_group); if (!Validate::isLoadedObject($myGroup)) $customer->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); $customer_groups[] = (int)$customer->id_default_group; $customer_groups = array_flip(array_flip($customer_groups)); $res = true; if (($field_error = $customer->validateFields(UNFRIENDLY_ERROR, true)) === true && ($lang_field_error = $customer->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true) { foreach ($customers_shop as $id_shop => $id_group) { if ($id_shop == 'shared') { foreach ($id_group as $key => $id) { $customer->id_shop = (int)$key; $customer->id_shop_group = (int)$id; if ($customer_exist && ($current_id_shop_group == $id || in_array($current_id_shop, ShopGroup::getShopsFromGroup($id)))) { $customer->id = $current_id_customer; $res &= $customer->update(); } else { $res &= $customer->add(); if (isset($addresses)) foreach ($addresses as $address) { $address['id_customer'] = $customer->id; unset($address['country'], $address['state'], $address['state_iso'], $address['id_address'] ); Db::getInstance()->insert('address', $address); } } if ($res && isset($customer_groups)) $customer->updateGroup($customer_groups); } } else { $customer->id_shop = $id_shop; $customer->id_shop_group = $id_group; if ($customer_exist && $id_shop == $current_id_shop) { $customer->id = $current_id_customer; $res &= $customer->update(); } else { $res &= $customer->add(); if (isset($addresses)) foreach ($addresses as $address) { $address['id_customer'] = $customer->id; unset($address['country'], $address['state'], $address['state_iso'], $address['id_address']); Db::getInstance()->insert('address', $address); } } if ($res && isset($customer_groups)) $customer->updateGroup($customer_groups); } } } unset($customer_groups); $customer_exist = false; if (!$res) { $this->errors[] = sprintf( Tools::displayError('%1$s (ID: %2$s) cannot be saved'), $info['email'], (isset($info['id']) && !empty($info['id']))? $info['id'] : 'null' ); $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } $this->closeCsvFile($handle); } } ***********************************
×
×
  • Create New...