Page 1 of 6 123 ... LastLast
Results 1 to 10 of 52
  1. #1
    Join Date
    Sep 2012
    Posts
    104
    Plugin Contributions
    0

    Default Is it possible to disable buying only in one category?

    Hi All!

    Is it possible to disable , in admin , the order of one category?
    For example :

    pendants - costumer can buy every product in this category/subcategory
    packaging - this is only for showcase, so that costumer can see the packaging types.

    thanks in advance

    Nandor

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

    Default Re: Is it possible to disable buying only in one category?

    Let's say you wanted all Products that have master_categories_id 12 to be Call for Price (or change to what ever you want it to read/link to) ...

    Edit the file:
    /includes/functions/functions_general.php

    and add the code in RED around line 1101:
    Code:
    // bof: show room only for master_categories_id 12
    //echo 'Products ID: ' . $product_id . ' Master Cat: ' . zen_get_products_category_id($product_id) . '<br>';
      if (zen_get_products_category_id($product_id) == 12) {
        return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
      }
    // eof: show room only for master_categories_id 12
    
        $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    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!

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

    Default Re: Is it possible to disable buying only in one category?

    NOTE: you could also use a Product Type for this to change the behavior from a Product General to a Document Product and turn off the ability to Add to Cart on 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!

  4. #4
    Join Date
    Sep 2012
    Posts
    104
    Plugin Contributions
    0

    Default Re: Is it possible to disable buying only in one category?

    Quote Originally Posted by Ajeh View Post
    NOTE: you could also use a Product Type for this to change the behavior from a Product General to a Document Product and turn off the ability to Add to Cart on those ...
    Hello!

    The second one seems easier! i changed it to document product, but how/where , in admin, can i turn off the ability to add to cart, just for this category?

    thanks in advance

    N.

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Is it possible to disable buying only in one category?

    Quote Originally Posted by Nandor View Post
    Hello!

    The second one seems easier! i changed it to document product, but how/where , in admin, can i turn off the ability to add to cart, just for this category?

    thanks in advance

    N.
    catalog->Product Types.... edit

    Cheers
    Rod
    Last edited by RodG; 4 Apr 2013 at 07:58 AM.

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Is it possible to disable buying only in one category?

    I may be thinking of something else, but i don't believe it's possible to change the Product Type of an existing product. I think you'll have to recreate the products using the new Product Type.

  7. #7
    Join Date
    Sep 2012
    Posts
    104
    Plugin Contributions
    0

    Default Re: Is it possible to disable buying only in one category?

    Quote Originally Posted by stevesh View Post
    I may be thinking of something else, but i don't believe it's possible to change the Product Type of an existing product. I think you'll have to recreate the products using the new Product Type.
    Doesnt work either way. Recreated category. When i create a new category "Restrict to product type" is not given. When i enter this category again (after having created) there is the choice "Restrict to product type" , i set it to Document-general instead of Product-general. till now its ok. But when i reenter edit this category it is automatically set back to Product-general. (before this i changed the product types setting of document -general to No (cant be added to cart)

    thanks

    Nandor

  8. #8
    Join Date
    Sep 2012
    Posts
    104
    Plugin Contributions
    0

    Default Re: Is it possible to disable buying only in one category?

    Quote Originally Posted by Ajeh View Post
    Let's say you wanted all Products that have master_categories_id 12 to be Call for Price (or change to what ever you want it to read/link to) ...

    Edit the file:
    /includes/functions/functions_general.php

    and add the code in RED around line 1101:
    Code:
    // bof: show room only for master_categories_id 12
    //echo 'Products ID: ' . $product_id . ' Master Cat: ' . zen_get_products_category_id($product_id) . '<br>';
      if (zen_get_products_category_id($product_id) == 12) {
        return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
      }
    // eof: show room only for master_categories_id 12
    
        $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

    i tried this solution. Master cat. id is 58, i rewrote it but the add this to my cart is still there.
    So you can buy from this category.

    thanks

    Nandor

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

    Default Re: Is it possible to disable buying only in one category?

    Check and make sure that in the table:
    products

    58 is the actual master_categories_id of the Product(s) in the table ...

    Also, look at the upgrades for v1.3.9e to v1.3.9h ... I cannot recall what version the master_categories_id look up issues were all cleaned up ...
    http://www.zen-cart.com/showthread.p...29-with-v1-3-9

    Another check is to look in the functions_lookups.php and make sure the function zen_get_products_category_id reads:
    Code:
      function zen_get_products_category_id($products_id) {
        global $db;
    
        $the_products_category_query = "select products_id, master_categories_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'";
        $the_products_category = $db->Execute($the_products_category_query);
    
        return $the_products_category->fields['master_categories_id'];
      }
    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!

  10. #10
    Join Date
    Sep 2012
    Posts
    104
    Plugin Contributions
    0

    Default Re: Is it possible to disable buying only in one category?

    Quote Originally Posted by Ajeh View Post
    Check and make sure that in the table:
    products

    58 is the actual master_categories_id of the Product(s) in the table ...

    Also, look at the upgrades for v1.3.9e to v1.3.9h ... I cannot recall what version the master_categories_id look up issues were all cleaned up ...
    http://www.zen-cart.com/showthread.p...29-with-v1-3-9

    Another check is to look in the functions_lookups.php and make sure the function zen_get_products_category_id reads:
    Code:
      function zen_get_products_category_id($products_id) {
        global $db;
    
        $the_products_category_query = "select products_id, master_categories_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'";
        $the_products_category = $db->Execute($the_products_category_query);
    
        return $the_products_category->fields['master_categories_id'];
      }
    Is this the master cat. id:

    Name:  screenshot mast cat.jpg
Views: 90
Size:  59.1 KB


    i found this in functions lookups php :

    function zen_get_products_category_id($products_id) {
    global $db;

    $the_products_category_query = "select products_id, master_categories_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'";
    $the_products_category = $db->Execute($the_products_category_query);

    return $the_products_category->fields['master_categories_id'];
    }


    thanks

    Nandor

 

 
Page 1 of 6 123 ... LastLast

Similar Threads

  1. v150 Buying using both Discount Coupon and Gift Voucher - Disable One?
    By PetleyJ in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 5 May 2012, 02:48 PM
  2. Replies: 1
    Last Post: 19 Aug 2008, 05:15 AM
  3. Inventory only in one Category is it possible
    By Dashizna in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 19 Mar 2007, 01:47 AM
  4. Only one product type in list; only in one category. Why?
    By whitefael in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 Jan 2007, 06:13 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