Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    1
    Plugin Contributions
    0

    Default Disable payment method for categories (with subcategories)

    Hi,

    I've succeded disabling COD payment for some categories using "master_categories_id" ($_SESSION['cart']->in_cart_check('master_categories_id','100') > 0).

    But I cannot find the way to do the same using a Category with subcategories. If for example master_categories_id=6 has 100 subcategories, is there a way of disabling COD for all other than using "master_categories_id" 100 times?

    Thanks in advance for your attention!

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

    Default Re: Disable payment method for categories (with subcategories)

    You could get all the products_id values in an array with this:
    Code:
    // bof: check my category
    $chk_parent = 3;
    $check_parent_products = zen_get_categories_products_list($chk_parent);
    echo '<pre>'; echo print_r($check_parent_products); echo '</pre>';
    echo 'chk_parent: ' . $chk_parent . ' sizeof($check_parent_products): ' . sizeof($check_parent_products) . '<br>';
    // eof: check my category
    where you can set the category's parent_id to $chk_parent ...

    Once you have that array of products_id values, you can check the products in the cart to see if they match any of those ...
    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: v1.5.5]
    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. v151 Disable a payment method for a chosen shipping method?
    By chowyungunz in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 12 Jun 2015, 12:56 PM
  2. v150 Images for Categories, Subcategories and Sub-Subcategories.
    By shannonphx in forum Customization from the Admin
    Replies: 5
    Last Post: 16 Aug 2013, 08:59 PM
  3. Disable Table shipping method with weight?
    By joecooper in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Aug 2012, 05:53 PM
  4. Hide categories/subcategories with no products
    By earthone in forum Basic Configuration
    Replies: 0
    Last Post: 22 Jul 2010, 09:38 PM
  5. Disable Credit Card Option on Payment Method
    By Ozwide in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 30 Dec 2009, 04:43 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR