Zen Follower
- Join Date:
- Apr 2012
- Posts:
- 151
- Plugin Contributions:
- 0
where to put my diy shipping class extends core class ?

Views: 1,328
Zen Follower

Sensei
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.
Zen Follower
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).
Sensei
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.
Tell staff why this post should be reviewed.