Opencart 基于重量的运输
我有很多脚本可以在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
运费存储在
setting
表中,或者根据您的情况存储在oc_setting
中。对于基于标准重量的运输,费率使用键weight_X_rate
存储,其中X
是地理区域 ID,并具有组weight
Shipping costs are stored in the
setting
table, oroc_setting
in your case. For the standard weight based shipping, the rates are stored with the keyweight_X_rate
whereX
is the geozone id, and have the groupweight