Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2012
    Plugin Contributions

    Default Combining two modules?

    Good Afternoon Peeps,

    I'm in the process of building my first Zen Cart store and so far so good, nice bit of kit!

    I'm doing a bit of customisation and in need of help as unfortunately I am not a hardcore coder and this goes straight over my head.

    My shop will serve our regular account customers whom receive various discounts depending on how much we like them and whom also pay on invoice. We also have general public punters who receive no discount and pay via card and also non account trade customers who do receive discount but must also pay via card.

    Now the Invoice add on module satisfies the above as I can create a group discount with a prefixed name of "Invoice" and any of my customers who I assign to an invoice discount gets the invoice option at the checkout, all works beautifully.

    URL to Invoice add-on below

    The second thing I would like to do is have my discounted customers to be able to see "their" discounted price on the product page (not just at the checkout)

    This is sorted by the Group Pricing (per item) add-on if I create a group discount called Group A/Group B/Group C or Group D.

    Link below

    What I am looking to do is to merge the necessary files of two add-on modules so my discount customers see their prices when they log in as well as (if they are invoice customers) having the invoice button available on the checkout.

    At present I can only have one or the other as I don't know how to go about merging the two or even if it's possible.

    What I am looking to achieve is...

    Is it possible to have:-

    Group discount name:- "Invoice Group A" to D which will give a discount AND show discounted prices AND allow invoice payment on the checkout.

    as well as

    Group discount name:- "Group A" to D which will give a discount AND show discounted prices BUT will not show the invoice button on the payment page of the checkout.

    Any other group discount name will just be for ad hoc discounts with no special black magic apart from what is standard with Zen.

    I'm hoping some of you uber brainy people can help me out.

    Big thanks in advance!

  2. #2
    Join Date
    Jul 2005
    Upstate NY
    Plugin Contributions

    Default Re: Combining two modules into one SUPER module!

    What are the files that the two mods share? As I'm sure you know, those are the ones that will have to be merged. The first step would be to document exactly how each mod's version of those files differs from the stock version. Compare the difference areas and see how much overlap there is. Where they modify different parts of the stock files, you may be able to just use the respective mod version of the lines. If they both modify the same statement in different ways, you will need experienced PHP coders to advise on combining the functionality.

  3. #3
    Join Date
    Feb 2006
    Tampa Bay, Florida
    Plugin Contributions

    Default Re: Combining two modules into one SUPER module!

    There are no files to be merged - the two mods use different files.

    The invoice module just does a small check in includes/modules/payment/invoice.php to see if the person is in a group which starts with the string "invoice_".

    This check is done here:

              $invoice_prefix = "invoice";
              $check_prefix = substr($check->fields['group_name'], 0, strlen($invoice_prefix));
              if (strcasecmp($check_prefix, $invoice_prefix) == 0) {
                $check_flag_group = true;
    If both of your groups A-D have the same prices (whether or not they are invoice eligible), you should use another mechanism to identify invoice eligible customers. You'll have to hire someone to add an "invoice eligible" flag to your customers table and admin->customers->customers, but it will save you time because you'll only have to enter 4 prices instead of 8.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.



Similar Threads

  1. Having Two Shipping Modules ON
    By sle39lvr in forum Addon Shipping Modules
    Replies: 2
    Last Post: 19 Apr 2012, 04:13 PM
  2. Shipping with two modules
    By Arunachala in forum General Questions
    Replies: 1
    Last Post: 30 Jan 2011, 02:46 AM
  3. Interaction Between Two Order Total Modules
    By retched in forum General Questions
    Replies: 1
    Last Post: 11 Oct 2010, 07:40 AM
  4. two stores on one db or two payment modules?
    By trillian in forum General Questions
    Replies: 7
    Last Post: 18 Nov 2008, 04:10 PM
  5. contribution conflict - combining two mods
    By dannyd in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 5 Jul 2007, 07:23 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Zen-Cart, Internet Selling Services, Klamath Falls, OR