CVS edit link for mbohner

I have written a module for Ubercart 2.x Drupal 6.x providing shipping cost calculation based on supplier, weight or order of the individual product. It is based on uc_tablequote. The supplier feature adds quite some complexity to it, so it is not just an extension of the previous mentioned module. Suppliers are defined as a taxonomy vocabulary and each product needs to specify a term. In "Home » Administer » Store administration » Configuration » Shipping quote settings" one is able to create a table consisting of (supplier, min weight/#order, max weight/#order, shipping rate)-records. Shipping cost is calculated individually per item in shopping cart and added up. Name of the module: uc_supplier_tablequote.
(Test-)Example of table created:
Supplier Minimum value Maximum value Shipping Rate
AngusRobertson 0 0.9 10
AngusRobertson 0.901 2 20
AngusRobertson 2.001 999999 50
Happy Books 0 1 15
Happy Books 1.001 2 30
Happy Books 2.001 999999 100

Comments

mbohner’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new10.58 KB
avpaderno’s picture

Issue tags: +Drupal 6.x, +Module review
avpaderno’s picture

Status: Needs review » Needs work
  1.   if($form_state['values']['uc_supplier_tablequote_minimum'] <= $r->max 
    

    The space between if, and ( is missing.

  2. The file LICENSE.txt must be removed, as Drupal.org CVS doesn't allow that file to be committed.
  3.     if ($num_rows == 0) {
          db_query("INSERT INTO {uc_supplier_tablequote} (min, max, rate, type, supplier) 
                    VALUES (%f, %f, %f, '%s', '%s')", 
                      $form_state['values']['uc_supplier_tablequote_minimum'], 
                      $form_state['values']['uc_supplier_tablequote_maximum'], 
                      $form_state['values']['uc_supplier_tablequote_rate'], 
                      $form_state['values']['uc_supplier_tablequote_type'],
                      $termName);
                      variable_set('uc_supplier_tablequote_type',$form_state['values']['uc_supplier_tablequote_type']);
        }
    

    The indentation should be increased of two characters every time.

  4.   function uc_cart_get_contents_with_supplier($cid = NULL, $action = NULL) {}
    

    The function doesn't respect the namespace of the module.

  5. See the Drupal coding standards to understand how a module code should be written.
avpaderno’s picture

Status: Needs work » Closed (won't fix)

There have not been replies from the OP in the past 7 days. I am marking this report as won't fix.

mbohner’s picture

Component: Miscellaneous » Code
Status: Closed (won't fix) » Needs review
StatusFileSize
new4.83 KB

Hi guys,

Have a look please. Thanks.

Cheers
Markus

avpaderno’s picture

Component: Code » Miscellaneous
Status: Needs review » Closed (won't fix)

@mbohner: Your CVS application has been rejected on September; you need to re-apply, to get a CVS account.