ladivito Posted November 30, 2009 Share Posted November 30, 2009 我把我国家的州属输入了BO,然后到FO更改了我想要的州属,但是所列出的却是美国的州属。有谁可以帮忙看看到底是什么问题吗 ? 谢谢 Link to comment Share on other sites More sharing options...
21846657 Posted December 2, 2009 Share Posted December 2, 2009 Back Office >> Shipping >> Countries(你设置的国家) >> Contains states 有没有Enable? Link to comment Share on other sites More sharing options...
ladivito Posted December 2, 2009 Author Share Posted December 2, 2009 Back Office >> Shipping >> Countries(你设置的国家) >> Contains states 有没有Enable? 已经enable了。比如正确的地址是China (ShangHai), 但是在Prestashop的却是China (Hawaii) <--突然之间变成美国的州属正在懊恼中,已经来回确认很多次。 Link to comment Share on other sites More sharing options...
21846657 Posted December 2, 2009 Share Posted December 2, 2009 1. Back Office >> Shipping >> States >> Add new/Modify 设置正确吗?2. 把classes/State.php附到这里,我帮你看看。 Link to comment Share on other sites More sharing options...
ladivito Posted December 2, 2009 Author Share Posted December 2, 2009 Add/Modify 也确认设置正确了 <?php /** * State class, State.php * States management * @category classes * * @author PrestaShop * @copyright PrestaShop * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0 * @version 1.2 * */ class State extends ObjectModel { /** @var integer Country id which state belongs */ public $id_country; /** @var integer Zone id which state belongs */ public $id_zone; /** @var string 2 letters iso code */ public $iso_code; /** @var string Name */ public $name; /** @var interger Tax behavior */ public $tax_behavior; /** @var boolean Status for delivery */ public $active = true; protected $fieldsRequired = array('id_country', 'id_zone', 'iso_code', 'name', 'tax_behavior'); protected $fieldsSize = array('iso_code' => 4, 'name' => 32); protected $fieldsValidate = array('id_country' => 'isUnsignedId', 'id_zone' => 'isUnsignedId', 'iso_code' => 'isStateIsoCode', 'name' => 'isGenericName', 'tax_behavior' => 'isUnsignedInt', 'active' => 'isBool'); protected $table = 'state'; protected $identifier = 'id_state'; public function getFields() { parent::validateFields(); $fields['id_country'] = intval($this->id_country); $fields['id_zone'] = intval($this->id_zone); $fields['iso_code'] = pSQL(strtoupper($this->iso_code)); $fields['name'] = pSQL($this->name); $fields['tax_behavior'] = intval($this->tax_behavior); $fields['active'] = intval($this->active); return $fields; } public static function getStates($id_lang, $active = false) { return Db::getInstance()->ExecuteS(' SELECT `id_state`, `id_country`, `id_zone`, `iso_code`, `name`, `tax_behavior`, `active` FROM `'._DB_PREFIX_.'state` '.($active ? 'WHERE active = 1' : '').' ORDER BY `name` ASC'); } /** * Get a state name with its ID * * @param integer $id_state Country ID * @return string State name */ static public function getNameById($id_state) { $result = Db::getInstance()->getRow(' SELECT `name` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.intval($id_state)); return $result['name']; } /** * Get a state id with its name * * @param string $id_state Country ID * @return integer state id */ static public function getIdByName($state) { $result = Db::getInstance()->getRow(' SELECT `id_state` FROM `'._DB_PREFIX_.'state` WHERE `name` LIKE \''.pSQL($state).'\''); return (intval($result['id_state'])); } } ?> 谢谢你的协助 ~ 非常感谢 Link to comment Share on other sites More sharing options...
21846657 Posted December 3, 2009 Share Posted December 3, 2009 Classes/State.php的代码是一样的。你有修改过admin/tabs/AdminStates.php吗? Link to comment Share on other sites More sharing options...
ladivito Posted December 4, 2009 Author Share Posted December 4, 2009 我没有修改过adminstates.php里面的任何东西。。。。我根本不知道哪里出错了,真的很纳闷 ~ Link to comment Share on other sites More sharing options...
ladivito Posted December 5, 2009 Author Share Posted December 5, 2009 请问这个问题需要怎样处理呢 ? Link to comment Share on other sites More sharing options...
21846657 Posted December 7, 2009 Share Posted December 7, 2009 如果需要,你可以发给我连接和BO的登录信息,我来帮你debug;或者,这是一个bug?那么你可以report给PS Team。Good luck! Link to comment Share on other sites More sharing options...
ladivito Posted December 8, 2009 Author Share Posted December 8, 2009 我已经试了还是不能不过我已经report到bug tracker去了......我会试一试用1.2.4看看怎样.... Link to comment Share on other sites More sharing options...
21846657 Posted December 9, 2009 Share Posted December 9, 2009 那么你现在的version是? Link to comment Share on other sites More sharing options...
ladivito Posted December 9, 2009 Author Share Posted December 9, 2009 1.2.5 和最新的SVN Link to comment Share on other sites More sharing options...
21846657 Posted December 10, 2009 Share Posted December 10, 2009 Hi Ladivito,呃...我本地测试了1.1.0.5,1.2.4.0,1.2.5.0和SVN,都没问题... :long: Link to comment Share on other sites More sharing options...
ladivito Posted December 10, 2009 Author Share Posted December 10, 2009 那就奇怪了。。。。你可以贴上你的states.php和相关的文件吗 ? 我试试overwrite我这里的看能不能用。。。。。 Link to comment Share on other sites More sharing options...
21846657 Posted December 11, 2009 Share Posted December 11, 2009 本地XAMPP测试使用的是default versions。你可以比较一下各个版本的AdminStates.php和AdminCountries.php,然后再merge;或者直接override。BTW,在SVN里,没有找到相关的改动。(如果我有错误,请更正我。) Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 我试试看。。。刚刚看了一下,SVN里没有相关的改动。 Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 下载了1.2.5版本, overwrite了admincountries/adminstates/states.php 但是还是不能 Link to comment Share on other sites More sharing options...
21846657 Posted December 11, 2009 Share Posted December 11, 2009 关于添加,譬如,上海到中国里,你是怎么操作的? Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 Bo-> shipping->country->contain state = yesBO->shipping->state->add new->输入name,iso code,country=china,zone=asiatax behaviour = bothstatus = enable Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 好奇怪。。。我安装1.2.5到另外一个folder和MySQL Database就没事。。。一切正常。。。。。我检查了两个的Database都是一样的。。。。是不是我的*.php出错了 ? Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 应该是文件出错了。。。。我overwrite之前的有问题的文件那么新的folder就有同样问题。。。。请问,在country,state....etc 相关的文件有哪些 ? 我不可以全部overwrite新的文件下去因为目前我做了相当多的更改在其他文件里面谢谢 Link to comment Share on other sites More sharing options...
21846657 Posted December 11, 2009 Share Posted December 11, 2009 相关的文件就是admin/tab/AdminStates.php和AdminCountries.php。这两个文件你有改动吗?关于override,最好不要在FTP里直接覆盖,应先删除旧文件或者更名备份,再上传新文件。这是我的方法。另外,改动较大的话,你可以尝试用WinMerge来合并更改内容。 Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 谢谢你^^ 我现在试试看。。。。 Link to comment Share on other sites More sharing options...
ladivito Posted December 11, 2009 Author Share Posted December 11, 2009 已经overwrite了也是不能用。。。文件明显有很多的不同根本不知道什么问题。。。。只好重灌咯。。。。又要从新更改其他文件了 =.= Link to comment Share on other sites More sharing options...
ladivito Posted December 13, 2009 Author Share Posted December 13, 2009 找到了...问题在theme的文件夹里面但是不知道是哪一个文件..... Link to comment Share on other sites More sharing options...
ladivito Posted December 13, 2009 Author Share Posted December 13, 2009 找到了...问题在theme的文件夹里面但是不知道是哪一个文件..... 是/themes/prestashop/address.tpl replace 1。2。5 版本的便可以了 Link to comment Share on other sites More sharing options...
21846657 Posted December 14, 2009 Share Posted December 14, 2009 admin/tab/AdminStates.php和AdminCountries.php 你没有改动吧?其实也不需要有什么改动。他们是程序文件而已。你改动的是模板文件。所以程序是对的。记得去cancel你的bug report哦。还有修改这帖子的标题,以便其他人获取经验。谢谢!;-) Link to comment Share on other sites More sharing options...
ladivito Posted December 14, 2009 Author Share Posted December 14, 2009 就只是/themes/prestashop/address.tpl 而已。。。。谢谢 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now