Forums / Addon Shipping Modules / USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

Views: 1,170

Results 1 to 7 of 7
10 Sep 2014, 6:36 PM
#1
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

@ajeh (since you provided the code for me)

Have I done this correctly or do I have lines in the wrong place?

// USPS_2014_0907_K5
// ADDITIONAL CUSTOMIZED CONDITIONS CAN GO HERE TO MANAGE $type_rebuilt or $title on $methods
// ************* START MODIFICATION USPS *****************

      // if quoted cost is lower than flat rate module cost, mark up the cost to equal flat rate
      $quoted_cost = ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes;
      $adjusted_cost = ($quoted_cost < MODULE_SHIPPING_FLAT_COST ? MODULE_SHIPPING_FLAT_COST : $quoted_cost);
      
      // switch comment marks to show $hiddenCost: from quote title
      //$show_hiddenCost =  ' $hiddenCost: ' . $hiddenCost;

$show_hiddenCost = '';

$methods[] = array('id' => $type_rebuilt,
                         'title' => $title . $show_hiddenCost,
                         'cost' => $adjusted_cost);

// ************* END MODIFICATION *****************

Thanks

10 Sep 2014, 9:46 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

The $cost is computed on line 557 ...

So you could use:

$quoted_cost = $cost;

You do not need to recalculate that ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Sep 2014, 8:28 PM
#3
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

I am not understanding. Would you show what to leave out and where to put $quoted_cost = $cost;
What is this $show_hiddenCost = ''; do or for

Thank you,
Larry Penny

14 Sep 2014, 8:44 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

Try using:

// USPS_2014_0907_K5
// ADDITIONAL CUSTOMIZED CONDITIONS CAN GO HERE TO MANAGE $type_rebuilt or $title on $methods
// ************* START MODIFICATION USPS *****************

// if quoted cost is lower than flat rate module cost, mark up the cost to equal flat rate
[B]$quoted_cost = $cost;
[/B]$adjusted_cost = ($quoted_cost < MODULE_SHIPPING_FLAT_COST ? MODULE_SHIPPING_FLAT_COST : $quoted_cost);

// switch comment marks to show $hiddenCost: from quote title
//$show_hiddenCost = ' $hiddenCost: ' . $hiddenCost;
$show_hiddenCost = '';

$methods[] = array('id' => $type_rebuilt,
'title' => $title . $show_hiddenCost,
'cost' => $adjusted_cost);

// ************* END MODIFICATION *****************

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Sep 2014, 10:42 PM
#5
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

That was quick. Now I follow what you were saying.

Thanks a lot,

Larry

15 Sep 2014, 12:31 AM
#6
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

Works perfect -- Thank you very much

Ajeh:

Try using:

// USPS_2014_0907_K5
// ADDITIONAL CUSTOMIZED CONDITIONS CAN GO HERE TO MANAGE $type_rebuilt or $title on $methods
// ************* START MODIFICATION USPS *****************

// if quoted cost is lower than flat rate module cost, mark up the cost to equal flat rate
[B]$quoted_cost = $cost;
[/B]
$adjusted_cost = ($quoted_cost < MODULE_SHIPPING_FLAT_COST ? MODULE_SHIPPING_FLAT_COST : $quoted_cost);

// switch comment marks to show $hiddenCost: from quote title
//$show_hiddenCost = ' $hiddenCost: ' . $hiddenCost;
$show_hiddenCost = '';

$methods[] = array('id' => $type_rebuilt,
'title' => $title . $show_hiddenCost,
'cost' => $adjusted_cost);

// ************* END MODIFICATION *****************

15 Sep 2014, 12:53 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS_2014_0907_K5--// if quoted cost is lower than flat rate module cost

You are most welcome ... Thanks for the update that this is working for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!