Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / What's the best way to duplicate the "storepickup" shipping module?

What's the best way to duplicate the "storepickup" shipping module?

Locked

Started by organicplanet on 6 Apr 2009, 3:06 AM · Views: 2,904

Results 1 to 20 of 26
This thread is locked. New replies are disabled.
6 Apr 2009, 3:06 AM
#1
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #1 by organicplanet

Howdy!

I have multiple drop sites for customers to pick up products. What is the best method of duplicating the "storepickup" shipping module so I can modify them to reflect the different pick up sites for my customers?

Thanks in advance!
Jane

6 Apr 2009, 1:50 PM
#2
ajeh avatar

ajeh

Oba-san

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

Post #2 by ajeh

Do a search on:
clone flat
clone item

to see how this works ...

If you do not want any of the Store Pickups to be a default choice, as 0.00 is lowest, you will also need to customize the file:
/includes/classes/shipping.php

around lines 163 to 168 ...

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!

6 Apr 2009, 4:47 PM
#3
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #3 by organicplanet

Thanks for the reply!

I cloned both flat.php files and
replace the "flat" and "FLAT" with "mystuff" and "MYSTUFF"
FTP'd them into the appropriate files on my server.

I can see them in the admin shipping modules and
"install" and modify it.

But when I try to test it in my store
the checkout process totally bypasses the shipping part of check out and
goes directly to the payment part of the check out process.

Did I miss something?

Also I am confused about this part of your post:

If you do not want any of the Store Pickups to be a default choice, as 0.00 is lowest, you will also need to customize the file:
/includes/classes/shipping.php

around lines 163 to 168 ...

Thanks for the help,
Jane

6 Apr 2009, 5:30 PM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

Are your products marked as Virtual or Downloads ...

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!

6 Apr 2009, 6:03 PM
#5
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #5 by organicplanet

Product was marked as virtual. That fixed it!

My next question is since I have the "flat.php" files altered, and
shipping is always free because the customer is picking up the products at their drop sites
is there a way to get rid of the "$0.00" on the right side of the shipping section?

Thanks!
Jane

6 Apr 2009, 9:19 PM
#6
ajeh avatar

ajeh

Oba-san

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

Post #6 by ajeh

You'd have to do more customization to the code to make it not read the value of $0.00 ...

Store Pickup reads as $0.00 as well ...

This could be done in the module for the ot_shipping.php ...

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!

7 Apr 2009, 12:11 AM
#7
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #7 by organicplanet

well I went to the "ot_shipping.php" files, both of them, and this tweek is beyond my skill level...I'm completely clueless here, can someone help me out here?

Usually I can futz around enough to get most done, but this one is out of my league.

Thanks again, in advance,
Jane

7 Apr 2009, 3:42 AM
#8
ajeh avatar

ajeh

Oba-san

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

Post #8 by ajeh

Look at this function:

    function process() {
      global $order, $currencies;

        $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
                                'value' => $order->info['shipping_cost']);
    }

You need to catch the value of the $order->info['shipping_cost'] for when it is 0.00 ...

Example:

    function process() {
      global $order, $currencies;

        $this->output[] = array('title' => $order->info['shipping_method'] . ':',
                                'text' => ($order->info['shipping_cost'] == 0.00 ? 'I am Free!' : $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value'])),
                                'value' => $order->info['shipping_cost']);
    }

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!

7 Apr 2009, 5:05 AM
#9
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #9 by organicplanet

I tried your suggestion in the "includes/modules/order_total/ot_shipping.php" file.

I could see no difference in the way the page was displayed.

Sorry to keep bugging ya on this... I want to learn and understand this, Maybe just a little more detail.

I appreciate it.
Jane

7 Apr 2009, 12:50 PM
#10
ajeh avatar

ajeh

Oba-san

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

Post #10 by ajeh

Have you an URL to a Product that you are testing this with that we could perhaps peek at? :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!

7 Apr 2009, 2:41 PM
#11
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #11 by organicplanet

Sure!

The store URL is http://www.handmadepantry.com/NewTest/

it isn't live yet so feel free to play however you feel.

Thanks!

7 Apr 2009, 3:24 PM
#12
ajeh avatar

ajeh

Oba-san

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

Post #12 by ajeh

Can you go to your Modules ... Order Totals ... and see if Shipping ot_shipping is installed or if you are getting an error?

The code I gave you fixes the totals on checkout_payment and checkout_confirmation that I do not see on your site but I see on mine ...

NOTE: On checkout_shipping it displays as $0.00 ...

This can be changed tpl_checkout_shipping_default.php at:

<?php
            if ( ($n > 1) || ($n2 > 1) ) {
?>
<div class="important forward"><?php echo ($quotes[$i]['methods'][$j]['cost'] == 0 ? 'HERE!' : $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0)))); ?></div>
<?php
            } else {
?>
<div class="important forward"><?php echo ($quotes[$i]['methods'][$j]['cost'] == 0 ? 'HERE!' : $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) ) . zen_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></div>
<?php
            }
?>

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!

7 Apr 2009, 4:56 PM
#13
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #13 by organicplanet

oops...I forgot to undo what I did there

I didn't convert my changes back. When I made the changes to the "ot_shipping.php" it removed several of the order total items from the modules...order total menu.

When I changed it back to the way it was the missing options returned, including the "ot_shipping" module. I installed that, but haven't tweeked it at all yet.

I did try the first suggested change after installing the "ot_shipping" but it didn't seem to do anything.

I also played with the tpl_checkout_shipping suggestion, and that totally wiped out the whole "checkout_shipping" page.

btw...thanks for your patience!

Jane

7 Apr 2009, 5:25 PM
#14
ajeh avatar

ajeh

Oba-san

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

Post #14 by ajeh

What editor are you using on your files?

I am not sure why you cannot get the two code changes to change whether you see the shipping as $0.00 or as something else ...

I have it working fine on some test sites and not having a problem ...

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!

7 Apr 2009, 5:35 PM
#15
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #15 by organicplanet

I'm not using an editor at all,

Ijust changing the files...can you recommend one.

Free or cheaper the better...for my budget anyways.

Thanks!

7 Apr 2009, 5:44 PM
#16
ajeh avatar

ajeh

Oba-san

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

Post #16 by ajeh

How are you changing the files if you do not have a Text Editor? :unsure:

I prefer UltraEdit from ultraedit.com ... there are many other Text Editors as well ...

NOTE: you do not want to use your Control Panel or programs like MS Word etc. to touch php files ...

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!

8 Apr 2009, 3:52 AM
#17
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #17 by organicplanet

Well I was editing in my control panel...guess I'm not doing that any more...

I did get a copy of UltraEdit. I'm not quit sure how all that stuff works. I repeated the two suggested changes and FTP'd the changed files back onto my server.

I still don't see a changed result, except for my module -> order total menu looks different...like some of the options may be gone.

But no difference in the displaying of the page that I can see.

I'm clueless at this point.

Jane

8 Apr 2009, 12:04 PM
#18
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #18 by organicplanet

Another point in case you haven't figured out is I have the Apple Zen Template installed on my cart.

I wasn't sure which "tpl_checkout_shipping.php" file should be changed.

The one in the "includes/templates/template_default/templates/" file, or
The one in the "includes/templates/apple_zen/templates/" file.

I have tried changing both files, but nothing seems to be happening.

Also I am assuming that the actual file I'm changing is the "tpl_checkout_shipping_default.php"

8 Apr 2009, 2:16 PM
#19
ajeh avatar

ajeh

Oba-san

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

Post #19 by ajeh

I really cannot see what is causing this not to work on your site other than files that are not getting changed correctly or not being uploaded correctly ...

tpl_checkout_shipping_default.php is in your templates and overrides:
/includes/templates/apple_zen/templates/tpl_checkout_shipping_default.php

if you do not have a custom file there, then copy a clean one from:
/includes/templates/templates_default/templates/tpl_checkout_shipping_default.php

The changes to the order totals shipping module is in:
includes/modules/order_total/ot_shipping.php

there are not overrides for this file ...

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!

8 Apr 2009, 4:28 PM
#20
organicplanet avatar

organicplanet

New Zenner

Join Date:
Dec 2005
Posts:
58
Plugin Contributions:
0

Post #20 by organicplanet

stupid question, but am I correct in my assumption that the "tpl_checkout_shipping.php" file you speak of is my "tpl_checkout_shipping_default.php"?

I just wanna make sure I'm looking at the correct file.