我想加上表运费在澳大利亚境内的马金托1.8。
这家商店的总部设在澳大利亚,只向澳大利亚发货。当我尝试导入以下CSV时,Magento会弹出一个错误,指出“文件尚未导入”和代码“无效”。

"Country","Region/State","Zip/Postal Code","Order Subtotal (and above)","Shipping Price"
"AU","*","*","250","0"
"AUS","VIC","*","0","11"
"AUS","NSW","*","0","12"
"AUS","QLD","*","0","13"
"AUS","ACT","*","0","14"
"AUS","NT","*","0","15"
"AUS","WA","*","0","16"
"AUS","SA","*","0","17"
"AUS","TAS","*","0","18"

我知道并且在过去使用过fontis extension,但我不喜欢它有多臃肿,有额外的功能,我没有用处。

最佳答案

在翻了几下桌子后,我找到了下面的解决办法。
首先,需要将需要的状态添加到directory_country_region表中。确保这是自动递增的,并对AU使用country_id
我运行了以下查询:

INSERT
    INTO `your-database-name`.`directory_country_region`
        (`region_id`, `country_id`, `code`, `default_name`)
    VALUES
        (NULL, 'AU', 'VIC', 'Victoria'),
        (NULL, 'AU', 'NSW', 'New South Wales'),
        (NULL, 'AU', 'QLD', 'Queensland'),
        (NULL, 'AU', 'ACT', 'Australian Captial Territory'),
        (NULL, 'AU', 'NT', 'Northern Territory'),
        (NULL, 'AU', 'WA', 'Western Australia'),
        (NULL, 'AU', 'SA', 'South Australia'),
        (NULL, 'AU', 'TAS', 'Tasmania');

插入这些行后,记下它们各自的region_id以便在directory_country_region_name表中使用。
我逐行运行了下面的查询。确保更新region_id以匹配上次查询中创建的id。
INSERT
    INTO `your-database-name`.`directory_country_region_name`
        (`locale`, `region_id`, `name`)
    VALUES
        ('en_AU', '485', 'Victoria'),
        ('en_AU', '486', 'South Australia'),
        ('en_AU', '487', 'Western Australia'),
        ('en_AU', '488', 'Northern Territory'),
        ('en_AU', '489', 'Queensland'),
        ('en_AU', '490', 'New South Wales'),
        ('en_AU', '491', 'Australian Capital Territory'),
        ('en_AU', '492', 'Tasmania');

现在使用澳大利亚地址创建一个新帐户,注意我们现在得到一个填充了这些值的下拉列表!胡扎!
我现在可以导入我的CSV表内的价格在Magento没有问题。
"Country","Region/State","Zip/Postal Code","Order Subtotal (and above)","Shipping Price"
"AUS","*","*","250","0"
"AUS","VIC","*","0","11"
"AUS","NSW","*","0","12"
"AUS","QLD","*","0","13"
"AUS","ACT","*","0","14"
"AUS","NT","*","0","15"
"AUS","WA","*","0","16"
"AUS","SA","*","0","17"
"AUS","TAS","*","0","18"

我想让这个查询自动使用region_id表中的directory_country_region_name,如果有人对如何改进这个问题有任何提示,我将非常感激。

10-05 20:08