Opencart 基于重量的运输

发布于 2024-12-18 20:24:30 字数 902 浏览 4 评论 0原文

我有很多脚本可以在 opencart 之外执行各种不同的操作,但使用 opencart 数据库。他们不会修改数据库,只是为了报告等目的而查询数据库。

我想查询 OpenCart 数据库和基于标准重量的运费(国内、英国)。目前我什至无法弄清楚这些基于重量的运费存储在哪里,更不用说根据产品查找运费了。

$delivery_query=mysql_query("SELECT value FROM `oc_setting` T1 where T1.group = 'weight' and T1.key = 'weight_4_rate'");
while($row=mysql_fetch_array($delivery_query)){
 $delivery=explode(',',$row['value']);
 foreach($delivery as $rate){
  $delivery_arry[]=explode(':',$rate);
 }
}

它正在生成我的交货数组:

Array
(
    [0] => Array
        (
            [0] => 100
            [1] => 1.58
        )

    [1] => Array
        (
            [0] => 250
            [1] => 1.96
        )

    [2] => Array
        (
            [0] => 500
            [1] => 2.48

循环遍历 oc_products 表中的第二个数组,我输出了另一个具有重量的产品数组,在该循环中我需要查找相应重量的价格... 这就是现在的位我需要帮助!?

I have alot of scripts that do various different things outside opencart, but using the opencart database. They don't modify the database simply query it for the purpose of reporting and alike.

I want to query to the OpenCart database and the standard weight based shipping rates (domestic, uk). At the minute I cannot even figure out where those weight based shipping costs are stored, never mind look up the shipping price against the product.

$delivery_query=mysql_query("SELECT value FROM `oc_setting` T1 where T1.group = 'weight' and T1.key = 'weight_4_rate'");
while($row=mysql_fetch_array($delivery_query)){
 $delivery=explode(',',$row['value']);
 foreach($delivery as $rate){
  $delivery_arry[]=explode(':',$rate);
 }
}

Which is producing my delivery array:

Array
(
    [0] => Array
        (
            [0] => 100
            [1] => 1.58
        )

    [1] => Array
        (
            [0] => 250
            [1] => 1.96
        )

    [2] => Array
        (
            [0] => 500
            [1] => 2.48

Looping through my second array from the oc_products table I have outputted another array of products with weight, within that loop I need to lookup the price for the corresponding weight... This is now the bit I need help with!?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琉璃繁缕 2024-12-25 20:24:30

运费存储在 setting 表中,或者根据您的情况存储在 oc_setting 中。对于基于标准重量的运输,费率使用键 weight_X_rate 存储,其中 X 是地理区域 ID,并具有组 weight

在此处输入图像描述

Shipping costs are stored in the setting table, or oc_setting in your case. For the standard weight based shipping, the rates are stored with the key weight_X_rate where X is the geozone id, and have the group weight

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文