Forums / Addon Shipping Modules / Bulk Shipping

Bulk Shipping

Locked
Results 1 to 13 of 13
This thread is locked. New replies are disabled.
05 Sep 2006, 00:56
#1
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Bulk Shipping

Hi, I've been going crazy trying to find a way to set up special shipping. I sell turtles. http://www.theturtleguys.com I want 3 different types of shipping. The flat rate 20 dollar shipping, a 50 dollar two day shipping, and a 100 dollar over night shipping. The two day and over night are for orders with a count of 100 or more. I looked around the forum and learned about the MZMT module. I downloaded it and installed it. It installed just fine, but I'm kind of new to this aspect of web design and I'm not sure how to make it (or anything else) work just the way I want it to. If someone could give a slightly detailed walkthrough, I'd appreciate it. Thanks
05 Sep 2006, 01:23
#2
ajeh avatar

ajeh

Oba-san

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

Re: Bulk Shipping

You are combinging a couple choices here ...

Always show $20 shipping ... assuming slow boat to china

Always show $50 shipping ... 2 day

Always show $100 shipping ... overnight ... but only on orders of 100+ items

Is this what you mean? Or could you break it down and type a little slower ... :smile:
05 Sep 2006, 01:27
#3
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

That's exactly right. Can you give me some detailed instructions?
05 Sep 2006, 01:39
#4
ajeh avatar

ajeh

Oba-san

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

Re: Bulk Shipping

You need to get creative here, as you have mixed criteria for your shipping ...

2 of these are just displays all of the time, while the 3rd is dependant on number of items ...

If you were to copy:
/includes/modules/shipping/flat.php
/includes/languages/english/modules/shipping/flat.php

To the filenames:
flatground.php
flattwoday.php

Then edit the files sets and replace all:
flat with flatground
FLAT with FLATGROUND

flat with flattwoday
FLAT with FLATTWODAY

Those are case sensative and must be done in both the code and language files ...

Then make sure that the plain flat.php is NOT installed ...

Install those two ... you should now see both in checkout ...

The 100+ item shipping is a little trickier ...

Here you also need to make sure that the number of items in the cart is >= 100

You will notice in the flat.php that there is a function to control the $this->enabled based on shipping settings using the a function:
[PHP] // disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
[/PHP]

If you were to copy flat.php to flat100.php and do the global replaces for flat to flat100 and FLAT to FLAT100 ... you would then need to make your own function to test how many items are in the cart, and if $_SESSION['cart']->count_contents() >=100 then you would allow this to show by having a function test that value and return true when allowed and return false when not allowed ...

Look at how the current function is written for the catalog and admin for:
function zen_get_shipping_enabled

You can find where that function is located using the Tools ... Developer's Tool Kit ... and searching in the bottom input box for:
function zen_get_shipping_enabled

And then, select Catalog/Admin from the dropdown and click search ...
05 Sep 2006, 01:44
#5
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

By copy ____ to _____ you mean copy and rename?
05 Sep 2006, 02:05
#6
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

Then edit the files sets and replace all:
flat with flatground
FLAT with FLATGROUND

flat with flattwoday
FLAT with FLATTWODAY


Think you could elaborate?
05 Sep 2006, 02:09
#7
ajeh avatar

ajeh

Oba-san

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

Re: Bulk Shipping

No ... I mean literally copy the files:

/includes/modules/flat.php
/includes/languages/english/modules/flat.php

To the files:
/includes/modules/flatground.php
/includes/languages/english/modules/flatground.php

/includes/modules/flattwoday.php
/includes/languages/english/modules/flattwoday.php

/includes/modules/flat100.php
/includes/languages/english/modules/flat100.php


Then edit each file group and do a global replace on:
flat
FLAT

With the proper matching word:
flatground
flattwoday
flat100

FLATGROUND
FLATTWODAY
FLAT100

Then write a function to manage the item count >= 100 to control when the flat100.php shipping module shows ...
05 Sep 2006, 02:11
#8
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

This is way over my head, but nobody else is gonna do it for me. Hopefully you're okay with newbs and don't mind answering dumb questions often.
05 Sep 2006, 02:27
#9
ajeh avatar

ajeh

Oba-san

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

Re: Bulk Shipping

Well ... you can dive in and pretend to be a coder ... :smile:

Or, you can always hire someone to do the work for you and get the 3 shipping modules made the way you want them to work ...
05 Sep 2006, 02:31
#10
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

If you were to copy flat.php to flat100.php and do the global replaces for flat to flat100 and FLAT to FLAT100 ... you would then need to make your own function to test how many items are in the cart, and if $_SESSION['cart']->count_contents() >=100 then you would allow this to show by having a function test that value and return true when allowed and return false when not allowed ...

Look at how the current function is written for the catalog and admin for:
function zen_get_shipping_enabled

You can find where that function is located using the Tools ... Developer's Tool Kit ... and searching in the bottom input box for:
function zen_get_shipping_enabled

And then, select Catalog/Admin from the dropdown and click search ...


I did what you said about looking for the function, found it, and see what you're talking about. I'm not sure what to do with it now that I've found it though.
05 Sep 2006, 02:37
#11
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

[PHP]// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}[/PHP]

Do I just make that look like this:

[PHP]// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$_SESSION['cart']->count_contents() >=100 ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}[/PHP]

Also do I change the function that I found from: $_SESSION['cart']->count_contents()
To: $_SESSION['cart']->count_contents() >=100

I'm trying to ask more than one question at once to keep from double posting, but I don't see an edit post button.

Edit: Found the edit button :blush: no more double posting. I'm in the process of learning php, but I'm teaching myself so it is very slow. I taught myself html, css, and xhtml so I think I can handle it with help.
05 Sep 2006, 03:12
#12
ajeh avatar

ajeh

Oba-san

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

Re: Bulk Shipping

Not exactly ...

You need to make your own function to manage the:
$_SESSION['cart']->count_contents() >=100

Functions can be made using the overrides by creating your own function file such as:

/includes/functions/extra_functions/myfunctions.php
/admin/includes/functions/extra_functions/myfunctions.php

Which would contain:
[PHP]<?php
function checkshipping_items {
// code here
}
?>
[/PHP]

The admin function would just have a return true as this is always true so it can work in the admin side ...

The catalog function would be doing the actual test ...

Look at the function zen_get_shipping_enabled for the catalog vs the same function for the admin ...

You would build something similar ...

[PHP]<?php
function checkshipping_items() {
if ($_SESSION['cart']->count_contents() - $_SESSION['cart']->free_shipping_items() >= 100) {
return true;
} else {
return false;
}
}
?>
[/PHP]

The admin would have a more simple function:
[PHP]<?php
function checkshipping_items() {
return true;
}
?>
[/PHP]

Now on the shipping module ... you would put inside the current code:
[PHP]
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
if (checkshipping_items() == true) {
$this->enabled = ((MODULE_SHIPPING_FLAT100_STATUS == 'True') ? true : false);
}
}
[/PHP]

This means ... it would pass the normal test ... then have to pass your test ...

NOTE: this is assuming you added it to the flat100.php file ...

Easy, eh? :blink:
05 Sep 2006, 20:57
#13
suseadmi avatar

suseadmi

New Zenner

Join Date:
Sep 2006
Posts:
11
Plugin Contributions:
0

Re: Bulk Shipping

Okay, here's how I'm doing this. I have a copy of zencart unzipped on my computer so I can edit it without messing with what's on my actual site until finished. (maybe that will help you understand...something *shrugs* ) Would it just be possible to copy and paste all the scripts and partial scripts that you've given me and there be a possibility of it working?