Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    145
    Plugin Contributions
    0

    Default where to put my diy shipping class extends core class ?


  2. #2
    Join Date
    Jan 2004
    Posts
    58,243
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: where to put my diy 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.
    .

    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.

  3. #3
    Join Date
    Apr 2012
    Posts
    145
    Plugin Contributions
    0

    Default Re: where to put my diy 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).

  4. #4
    Join Date
    Jan 2004
    Posts
    58,243
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: where to put my diy 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.
    .

    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.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 20 Jan 2012, 01:43 AM
  2. Replies: 3
    Last Post: 3 Aug 2009, 06:13 AM
  3. order_total class and class redeclaration
    By s_p_ike in forum General Questions
    Replies: 1
    Last Post: 8 Feb 2007, 11:33 AM
  4. Class=input requirment? Where is it?
    By MJA in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 13 Jan 2007, 06:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •