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
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 . "'");
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 ...
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
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.
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Nandor
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
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.
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
stevesh
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
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
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
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'];
}
1 Attachment(s)
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
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:
Attachment 12306
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