Forums / Addon Shipping Modules / help with Fastway Shipping Module

help with Fastway Shipping Module

Locked

Started by maori1 on 14 Jun 2006, 11:48 AM · Views: 27,977

Results 81 to 85 of 85
This thread is locked. New replies are disabled.
29 Jun 2010, 11:30 PM
#81
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

help with Fastway Shipping Module

Need to be changed to
if ($rec->fields['f_delivery'] == 'xxx') {

For this code to have any hope of working.OK, so I have tested the suggestion mentioned. It simply gives me a blank page.

The original code in the includes/modules/shipping/fastway.php file reads

$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode >= f_postcode and $topcode <= f_postcode";
$rec = $db->Execute($sql); 

    if ($rec->fields['f_delivery'] = 'S/D') {
    $days = 'same';
    }
    if ($rec->fields['f_delivery'] = 'N/D') {
    $days = 'next';
    } 
    else {
    $days = $rec['f_delivery'];
}
```It is plainly obvious that this module is not working as originally intended (given that it was modified from the original OSC fastway module). Given I am not a coder I feel I have little choice but to attempt to get this module working properly anyway.

What logs am I looking at to establish where the code is failing, that's if it is logging anything.

What tools can I used to assist me in getting this module to work?
What other resources can/should I be using?

Regards

Fred
1 Jul 2010, 1:44 AM
#82
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

Re: help with Fastway Shipping Module

After some considerable help from a programmer friend of mine I have a solution to the shipping days problem.

$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode >= f_postcode and $topcode <= f_postcode";
$rec = $db->Execute($sql); 

    if ($rec->fields['f_delivery'] == '') {
    $days = 'unknown';
    }
    if ($rec->fields['f_delivery'] == 'S/D') {
    $days = 'same';
    }
    if ($rec->fields['f_delivery'] == 'N/D') {
    $days = 'next';
    }
    else {
    $days = ($rec->fields['f_delivery']); 
    }
```I am now working on the rest of the module for correct function. These include the use of f-region and f-suburb to validate the customers address. 

I suspect f-satchel isn't working either.

Regards

Fred
1 Jul 2010, 3:13 AM
#83
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: help with Fastway Shipping Module

FredZ:

if ($rec->fields['f_delivery'] == '') {
$days = 'unknown';

This line isn't needed. It does nothing useful.
The 'else' part of the code takes care of the 'unknown'.

FredZ:

if ($rec->fields['f_delivery'] == 'S/D') {
$days = 'same';
}

This MAY get set, but it get's reset by the next couple of lines. This is a coding error/bug

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

1 Jul 2010, 3:30 AM
#84
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: help with Fastway Shipping Module

FredZ:

OK, so I have tested the suggestion mentioned. It simply gives me a blank page.

Must've done something wrong.

FredZ:

The original code in the includes/modules/shipping/fastway.php file reads

$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode >= f_postcode and $topcode <= f_postcode";
$rec = $db->Execute($sql);

if ($rec->fields['f_delivery'] = 'S/D') {
$days = 'same';
}
if ($rec->fields['f_delivery'] = 'N/D') {
$days = 'next';
} 
else {
$days = $rec['f_delivery'];

}


You only had to make two changes to fix this. (adding the '=') 

```php
$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode  >= f_postcode and $topcode <= f_postcode";
$rec = $db->Execute($sql); 

    if ($rec->fields['f_delivery'] == 'S/D') {
    $days = 'same';
    }
    if ($rec->fields['f_delivery'] == 'N/D') {
    $days = 'next';
    } 
    else {
    $days = $rec['f_delivery'];
}

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

1 Jul 2010, 4:04 AM
#85
fredz avatar

fredz

New Zenner

Join Date:
Jan 2007
Posts:
66
Plugin Contributions:
0

Re: help with Fastway Shipping Module

RodG:

Must've done something wrong.

You only had to make two changes to fix this. (adding the '=')

$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode >= f_postcode and $topcode <= f_postcode";
$rec = $db->Execute($sql);

if ($rec->fields['f_delivery'] == 'S/D') {
$days = 'same';
}
if ($rec->fields['f_delivery'] == 'N/D') {
$days = 'next';
} 
else {
$days = $rec['f_delivery'];

}



Not at all. If I simply added the = signs as mentioned all I got was a blank page. I needed to modify the last line to get it to display the contents of f-delivery

Regards

Fred