简体   繁体   English

警告:需要运输方式 - OpenCart

[英]Warning: Shipping method required - OpenCart

Ran into this problem a while back.前一段时间遇到了这个问题。 Been scouring the web, OpenCart forums, StackOverflow for weeks now trying to get this sorted.数周以来一直在 web、OpenCart 论坛、StackOverflow 上搜索,现在试图解决这个问题。

:[enter image description here][1] [1]: http.//i.stack.imgur.com/1fbDB.png :[在此处输入图片描述][1] [1]: http.//i.stack.imgur.com/1fbDB.png

Basically I took Flat Shipping module and made a copy of it.基本上我采用了 Flat Shipping 模块并复制了它。 Renamed every instance of module name and got myself another flat rate shipping module.重命名模块名称的每个实例,并为自己获得另一个固定费率运输模块。

Only problem is that I get this warning which doesn't throw any errors.唯一的问题是我得到了这个不会引发任何错误的警告。 This seems to be a fairly common problem but every solution that I found didn't help me.这似乎是一个相当普遍的问题,但我找到的每个解决方案都没有帮助我。

I noticed that if I enable Free shipping module I can select it no warnings.我注意到,如果我启用免费送货模块,我可以 select 它没有警告。 But when I go to select my custom shipping module I get a warning.但是当我 go 到 select 我的自定义运输模块时,我收到警告。

If anyone has a solution or what else I can check I'd appreciate the tip.如果有人有解决方案或我可以检查的其他内容,我将不胜感激。

I am working with OpenCart 1.5.6.4我正在使用 OpenCart 1.5.6.4

This is almost certainly going to be due to your model file for your shipping method.这几乎肯定是由于您的运输方式文件 model 造成的。 Make sure that you've given the new method code for the items.确保您已经为项目提供了新的方法代码。 For example, the original shipping method would use flat.flat which if you view the HTML for the radio on your site you'll see what yours is.例如,最初的运输方式将使用flat.flat ,如果您在您的站点上查看收音机的 HTML,您就会看到您的收音机是什么。 Basically if your new one is new.new then make sure you've set this accordingly in your model file基本上如果你的新的是new.new然后确保你已经在你的 model 文件中相应地设置它

If you notice, this error arises when the page is reloaded and so I thought it had to do with the cache since when I experienced it, I always had to clear cache and then it would not bring that.如果您注意到,这个错误在页面重新加载时出现,所以我认为它与缓存有关,因为当我遇到它时,我总是必须清除缓存然后它不会带来那个。 Read this to get some insight on whether the solution applies to your case cause of error阅读本文以深入了解该解决方案是否适用于您的错误原因

open system/framework.php in your open cart installation, locate the line below (around line 74) open system/framework.php 在您的 open cart 安装中,找到下面的行(第 74 行左右)

$response->addHeader('Content-Type: text/html; charset=utf-8');

Add the following lines immediately below it在其下方立即添加以下行

$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache');

Now, clear your browser cache.现在,清除浏览器缓存。 The warning should no longer be there.警告不应再存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM