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!
Donations always welcome: www.zen-cart.com/donate
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.
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).
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!
Donations always welcome: www.zen-cart.com/donate
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.
Bookmarks