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

Started by linjuming on 21 Aug 2012, 1:51 AM · Views: 1,335
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 Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
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.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Tell staff why this post should be reviewed.