Opencart Weight Based Shipping

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!?

Answers


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


Need Your Help

Why Java 6 overrides keySet(), entrySet() and values() interface in SortedMap

java dictionary sortedmap keyset entryset

Java 5 http://docs.oracle.com/javase/1.5.0/docs/api/java/util/SortedMap.html

WCF Service 404 error

wcf http service handler

I am trying to set up a WCF Service but I'm having a few problems. The service works and loads the wsdl page when I type in

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.