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

shipcalc flat rate & beginner php programming

Hi,

I'm trying to modify the ecommerce/shipcalc .inc "module"
to avoid javascript, and have a hardcoded list of various countries
that would not be contigous in the javascript pulldown.

I've excerpted (below) the file that I save as weight.inc, and have just a few questions.
At line 18 I define
function weight_get_rates($txn)
which is getting called.
However, I can't get the country check to work properly

if (in_array($ctry, $usa))	{ $flat_rate = 12.3;    $per_pound_cost = 1.4732; }  

despite a variety of syntax experiments:

		$usa   = array( "United  States");
		$usa1    =  array(  'US' => t('United States'));
		$usa2    =  array(t('United States'));

If someone could
1) show me a simple example of how to check which country is being set by the customer
and/or
2) show me how to display/debug variables on screen (the php equivalent to printf . )

I'd be a good bit closer,

Thank you,

==============================

<?php
// custom weight module for 4 region flat rate
function weight_shipping_methods($type = 'domestic') {
// TODO: Add descriptions of various shipping methods.
$methods = array();
$methods['weight'] = array( '#title' => t('weight'), '#description' => t('Weight Based Shipping.'), );
switch ($type) {
case 'domestic':
default:
$methods['weight']['Flat Rate & Weight Based'] = array( '#title' => t('Flat Rate & Weight Based'), );

Should I write a new module for Drupal 5.x or for 4.7

I'm a newbie when it comes to module writing, but I was wondering if it would make more sense for me to write a new custom module using the 5.x or 4.7.x API for a site I'm currently developing? I don't intend to launch the site for a few months, and I'm wondering if using the newer API will help me avoid a lot of future updating of my module when I upgrade to 5.x.

How to make multiple book outlines when # of nodes is too high to be readable

I have been creating books to represent issues/volumes of a magazine. I now have 4 issues online and over 100 book node pages. The outline function of the book module is a bit overloaded. It might be nice to be able to have a meta outline feature or to hide the subnodes when using the outline tab. Any such feature out there?

This would make a more scalable navigaition system. Likewise the menu system is hard to use after about 20-25 items. Any one working on an elegant solution?

Exposing Thumbnails to Views

Hello all,

I saw a few (indirect) question about how to expose thumbnails to views. I didn't see any answers, tho, so I had to figure it out myself. Here are my results: I'm sure there's room for improvement, but it's a starting point.

Where is the profile image update in user module

Hi,

Where is the part of code that uploads the image to the selected directory/folder when a user uploads his profile picture. is it the user_validate_picture() function in the user.module, that does this work. Please help
thanks
drupal_india

Views module breaks userreference CCK field type

In drupal 4.7.3 I have a CCK-defined node type "Project" that uses a userreference field called "AssignedTo."
That all works swimmingly.

I use the Views module to allow a filter-by the userreference field so I can see everything that's assigned to specific users.
My select box for the userreference field is off by one.

Example.
My uid/username pairs from the database are:
1=admin
2=brian
3=von
4=josh

My select box in views says:
0=admin
1=brian
2=von
3=josh

Pages

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