Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Need some development logic opinions

    I have sell "high risk" items online... only 2 categories are considered "high risk" and accounts for about half of my products.

    the problem is I only have 1 CC processor that allows me to process CCs for the products I sell. that 1 processor (payment alliance) will doesn't put the money in my account for 3-5 days. That means I have to float the cash for that long. considering the fast growth of my store and the fact that I did this with ZERO loans, cash-flow is becoming an issue.

    The processor from my bank (PNC) will put money in my account next day! This would be HUGE for me. problem is they wont allow me to process the "high risk" items. but they will allow me to process the other 16,000 items (which account for 85% of all orders).

    so, I need to use 2 different payment processors based on what the customer is purchasing.

    here are my 2 ideas to overcome this:

    1) create 2 completely separate sites that share a database (each site using a different table prefix) then edit the code so the customer and order tables are shared between the 2 sites (remove table prefix reference in the code). this way user accounts and orders will all be maintained in one location. customers can see all their orders no matter which site they are in and they have 1 login for both sites.

    2) edit the checkout pages to use a 1 payment module if it has a "high risk" item in the cart and use the other if it doesn't.

    as a developer I am very familiar with zen carts template system and have done an extensive amount of editing in the code... so I am not a noob getting in over his head! but I will admit that I haven't messed with the payment modules to much extent yet. but I am confident in being able to complete either option with enough time and research.


    so... zen developers... which route would you go? option 1 or option 2? or maybe a 3rd I havent thought of?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need some development logic opinions

    Are the High Risk items all in the same Category or in a handful of Categories that do not include the Regular Products?

    The idea here is that if the High Risk Products use particular msater_categories_id that the other Regular Products do not, then this can be tested for and if 1 or more High Risk Product is in the cart ... then only use the 1 Payment module and if no High Risk Product is in the Cart ... then use the other Payment Module ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Need some development logic opinions

    Quote Originally Posted by Ajeh View Post
    Are the High Risk items all in the same Category or in a handful of Categories that do not include the Regular Products?

    The idea here is that if the High Risk Products use particular msater_categories_id that the other Regular Products do not, then this can be tested for and if 1 or more High Risk Product is in the cart ... then only use the 1 Payment module and if no High Risk Product is in the Cart ... then use the other Payment Module ...
    yes. all high risk products are in their own category. i already have a check in place on the first checkout page to display a procedures notification if an item from high risk category is in cart.

    now the oyher thing is the payment gateways will need tobse the same module. so i guess i can just edit the payment module with a statement that will change te unique data (login id and hash stuff) based on what category thebitems in the cart are from.

    thats probably a much better/easier idea considering it would only need 1 file to be edited.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need some development logic opinions

    By being able to identify these products by master_categories_id this can be used to enable on module and disable the other and visa versa ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Need some development logic opinions

    Quote Originally Posted by Ajeh View Post
    By being able to identify these products by master_categories_id this can be used to enable on module and disable the other and visa versa ...
    wait... you're in ohio? me too! :)

    I'll start researching how the payment/checkout works and see if I can work this out. want to give any hints as to what files to start looking at? :)

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need some development logic opinions

    What you are looking for is the $this->enabled ...

    When set to true it will show and when set to false it will not show ...

    if you search on:
    $this->enabled

    you should find several examples of how this can be altered for true/false by various tests for the cart contents ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Need some development logic opinions

    I have it all figured out... thanks again for your help!

    one question... is there a better way of doing the following:

    PHP Code:
    foreach ($order->products as $k => $v) {
        if(
    zen_get_categories_parent_name(zen_get_products_category_id($order->products[$k]['id'])) == 'the top category name'){
            do 
    something;
        }

    the biggest problem with this is if the the tree is more than 1 level deep it wont return the top level category only the product categories parent.

    is there a function to get the top level category? or to atleast get the parrent ID? I couldnt seem to find one.

    I can write one... but would rather use built in stuff if at all possible:

    PHP Code:
      function zen_categories_top_level($categories_id){
          
    $lookup 1;
          while(
    $lookup != 0){
            
    $lookup zen_categories_lookup($categories_id,'parent_id');
            if(
    $lookup != 0){
                
    $categories_id $lookup;
            }
          }
          return 
    $categories_id;
      } 

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need some development logic opinions

    You could try:
    (int)zen_get_generated_category_path_rev($current_category_id)

    which would give the top based on the $current_category_id, so if you passed it a specific Category ID such as:
    (int)zen_get_generated_category_path_rev(40)

    where the cPath is 33_34_40 and the top level was 33, it would find 33 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Need help for bestsellers logic
    By lindanewbie in forum Basic Configuration
    Replies: 0
    Last Post: 24 Mar 2011, 01:52 AM

Posting Permissions

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