This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

question on developing a Custom ShipCalc .inc files ( "flatrate")

Below, I've attached my "flatrate.inc" which seems to correctly
calculate a linear regression along the lines of
cost= flatrate+ priceperpound * weight
for a four zone a US-centric scheme.
It's easy to read and modify and has the advantage that the zones do
not have to be contiguous in a pulldown&select scheme.

However, there is a problem that I cannot find an answer to.

Edits to the coefficients of this file (living in
modules/ecommerce/contrib/shipcalc/partners ) do not reliably update-
the checkout procedure either calculates based on the old coeffs or
"crashes" with a blank white screen.

Can someone explain (or point to the explanation) of how this code
interacts with the rest of shipcalc and what installation steps are
required to ensure the right version is being used ?

Thanks,
D


<?php

function flatrate_shipping_methods($type = 'domestic') {
// TODO: Add descriptions of various shipping methods.
$methods = array();

$methods['flatrate'] = array( '#title' => t('flatrate'), '#description' => t('Weight Based Shipping.'), );

switch ($type) {
case 'domestic':
default:
$methods['flatrate']['Flat Rate & Weight Based'] = array(
'#title' => t('Flat Rate & Weight Based'),
);
break;
case 'international':
$methods['flatrate']['Flat Rate & Weight Based'] = array(
'#title' => t('Flat Rate & Weight Based International'),

Has anyone integrated/communicated with Quickbooks?

I have a client that would like to integrate Quickbooks with their e-commerce site. Has anyone done any work with Quickbooks and Drupal together?

cheers
alynner

How do I reset a form element to a default value, and display it in the preview

I am updating some of my custom modules from 4.6 to 4.7.

Under 4.6 I had a form that, if some fields were submitted as blank, would revert to a default setting. Therefore to revert the form all you had to do was delete the current values on the input form and hit Preview or Submit. If you previewed then the default values were displayed when the form refreshed.

Views Question

I have a node type that allows for multiple terms. When I try to list items using the Views module, any item that has more than 1 term in a particular vocabulary seems to appear twice.

For instance .. I have a list of employees, and which company they work for. In some cases an employee will work for multiple companies. The field I've used in the Views module is "Taxonomy: Terms for Companies". This generates 2 lines for the employee in the output, both with the company of "TGC | OH" - the companies that the employee works for (one TGC, the other OH).

Ping Technorati- While avoiding the CommentsRSS

I just instealled this great subsitite for the ping module:

http://drupal.org/node/36659#comment-70387

And it works great!

But unfortunately, I had to disable my comments RSS module, because my drupal website was pinging technorati.com with my site's comments, instead of the site's stories and blog posts.

Submitting and validating multiple forms

I have an issue in writing a multipart form on a single page.

The user is presented a themed table, for which each Title element is editable. I place the edit forms on each row as follows:

    $rows = array();
    while ($entry = db_fetch_array($result)) {
      $form[$entry['mid']]['mysite_title']['title'] = array(
        '#type' => 'textfield',
        '#size' => '15',
        '#default_value' => NULL
      );
      $form[$entry['mid']]['mysite_title']['mid'] = array(
        '#type' => 'hidden',
        '#value' => $entry['mid']
      );        
      $form[$entry['mid']]['mysite_title']['uid'] = array(
        '#type' => 'hidden',
        '#value' => $entry['uid']
      );        
      $form[$entry['mid']]['mysite_title']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Rename')
      );          
      $remove = mysite_remove_link($owner->uid, $entry['mid']);
      $promote = mysite_promote_link($owner->uid, $entry['mid']);
      $demote = mysite_demote_link($owner->uid, $entry['mid']);        
      $rows[] = array('data' => array(check_plain($entry['title']), theme('mysite_actions', $entry['uid'], $entry['mid']), drupal_get_form('mysite_edit_title', $form[$entry['mid']])));        
    }

On submit, the form is run through the validate hook:


$sql = "SELECT mid FROM {mysite_data} WHERE lower(title) = '%s' AND uid = %s";

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions