Forums / Built-in Shipping and Payment Modules / Percentage of Total Amount or Dollar Value

Percentage of Total Amount or Dollar Value

Locked

Views: 3,296

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
22 Jun 2010, 8:21 PM
#1
anshin avatar

anshin

New Zenner

Join Date:
Jun 2010
Location:
Vancouver Island, BC
Posts:
6
Plugin Contributions:
0

Percentage of Total Amount or Dollar Value

Hey folks ...

Has anyone come across either a module, or did some changes to be able to have this as a shipping option.

Shipping & Handling: 10% of the subtotal or $10.00 (whichever is greater)?

Many thanks

23 Jun 2010, 12:08 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Percentage of Total Amount or Dollar Value

You can customize the Table Rate to have 10% and add in a test to make it a minimum of $10.00 ...

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!

23 Jun 2010, 1:51 AM
#3
anshin avatar

anshin

New Zenner

Join Date:
Jun 2010
Location:
Vancouver Island, BC
Posts:
6
Plugin Contributions:
0

Re: Percentage of Total Amount or Dollar Value

Hey Ajeh,

Thanks for the reply, but I am not sure what you are meaning. I know how to set within the table rate ... eg: 10:5.00,5%

how would I do what you are suggesting?

Cheers :)

23 Jun 2010, 3:14 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Percentage of Total Amount or Dollar Value

In the Table Rate table shipping module, the final cost is built in:

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
    'cost' => $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));

What you want to do is test if the cost is <= 10 then you need to adjust the cost to be at least 10.00 ...

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!

23 Jun 2010, 3:43 AM
#5
anshin avatar

anshin

New Zenner

Join Date:
Jun 2010
Location:
Vancouver Island, BC
Posts:
6
Plugin Contributions:
0

Re: Percentage of Total Amount or Dollar Value

Hey there .. sorry if I am being difficult, but I have no idea what you are asking. I checked my table.php file in modules>shipping and it has the same code that you pasted ...

As for the <= 10 ... not sure ...

Do you know what formula is needed in the admin section under the Shipping Rate?

This is what I have tried: 1:10.00,2:10% (1=number of products : costing 10.00, or 2=number of products : 10% off)

Any ideas?

23 Jun 2010, 1:34 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Percentage of Total Amount or Dollar Value

You can customize the shipping charge in the Table Rate table shipping module by editing the file:
/includes/modules/shipping/table.php

and changing the code from:

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
    'cost' => $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));

to read:

// bof: charge minimum of $10.00 shipping
    $chk_shipping_cost = $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING);
    if ($chk_shipping_cost < 10.00) {
      $chk_shipping_cost = 10.00;
    }
    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
    'cost' =>  $chk_shipping_cost) ));
// eof: charge minimum of $10.00 shipping

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!

23 Jun 2010, 5:06 PM
#7
anshin avatar

anshin

New Zenner

Join Date:
Jun 2010
Location:
Vancouver Island, BC
Posts:
6
Plugin Contributions:
0

Re: Percentage of Total Amount or Dollar Value

Ahhh excellent, that worked perfect!!!

Thanks very much again for all your work, I really appreciate it.

Cheers :)

23 Jun 2010, 5:12 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Percentage of Total Amount or Dollar Value

Sure thing ... remember the Zen Cart Team when you are rich and famous! :cool:

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!

23 Jun 2010, 7:50 PM
#9
anshin avatar

anshin

New Zenner

Join Date:
Jun 2010
Location:
Vancouver Island, BC
Posts:
6
Plugin Contributions:
0

Re: Percentage of Total Amount or Dollar Value

I sure will ... I think they have done a fabulous job!!! :)

23 Jun 2010, 10:34 PM
#10
anshin avatar

anshin

New Zenner

Join Date:
Jun 2010
Location:
Vancouver Island, BC
Posts:
6
Plugin Contributions:
0

Re: Percentage of Total Amount or Dollar Value

Actually, one last question if I could. Is there a way to use this function, but to have it work for all of Canada and the US, but for Alaska and Hawaii be $12.00 or 12% or subtotal?

Cheers

23 Jun 2010, 10:47 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Percentage of Total Amount or Dollar Value

Build a Zone for Canada and the US for the shipping module ...

Then you would need to customize the code further to test for Alaska and Hawaii to use $12 or 12% ...

You can test the:
$order->delivery['zone_id']

to determine should you use the default percentage or 12% and whether to use the $10.00 minimum or 10.00 ...

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!

16 Nov 2010, 6:23 AM
#12
ifsca avatar

ifsca

New Zenner

Join Date:
Jun 2008
Posts:
6
Plugin Contributions:
0

Re: Percentage of Total Amount or Dollar Value

Re: hard coding minimum $10

Correct me if I'm wrong but wouldn't it be easier to set the Table Rate to

100:10,10000:10%

16 Nov 2010, 2:02 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Percentage of Total Amount or Dollar Value

If you are only trying to charge that to a specific Zone then that is not quite enough as you would have Zone Rate zones for all the US without the extra charge and then have Table Rate table for that Zone ...

One way or the other you would need to test for the specific zone and either add on the amount or disable the shipping method for the Zone Rate zones so Alaska and Hawaii would get the higher rate ...

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!