Zen Cart Logo
Forums / General Questions / where to put my diy shipping class extends core class ?

where to put my diy shipping class extends core class ?

Views: 1,328

Results 1 to 4 of 4
21 Aug 2012, 1:51 AM
#1
linjuming avatar

linjuming

Zen Follower

Join Date:
Apr 2012
Posts:
151
Plugin Contributions:
0

where to put my diy shipping class extends core class ?

21 Aug 2012, 4:47 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: where to put my diy shipping class extends core class ?

Zen Cart v1.xxx isn't architected to allow you to extend that class.

Question: WHY are you needing to extend the class at all?
That class serves a very specific purpose, and extending it isn't normally necessary. Directly editing the class should suffice in most cases.

While directly editing the class may not be seen as ideal in the mind of a programmer thinking in object-oriented mode, extending that class doesn't gain you anything in this current architecture.

21 Aug 2012, 9:06 AM
#3
linjuming avatar

linjuming

Zen Follower

Join Date:
Apr 2012
Posts:
151
Plugin Contributions:
0

Re: where to put my diy shipping class extends core class ?

sometimes I want to add myself's class ,but not want to put in the default class php file.
for example, I want to let table_table shipping method selected when no shipping session on checkout_shipping page (the default zencart use cheapest() to let cheapest method selected).

21 Aug 2012, 1:58 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: where to put my diy shipping class extends core class ?

There are many ways to handle that without extending the class.Adding some conditional code to the original class could be one way. Bypassing the cheapest() function call elsewhere, outside the class, is another way.