Here is some stuff I learned recently that may be useful to other site admins.
Apple does not allow its value added resellers to sell Apple products on-line unless you are selling to an existing customer. We had been using Taxonomy Access Control Lite to hide the Apple product taxonomy from anonymous users, and we would grant customers access by giving them an "apple customer" roll.
I have been searching for a way to display these non-salable products on our site within the catalog to everyone, but restrict the sale of the products.
The solution I had come up with was to create an additional product class called productnosale. I then created a node-productnosale.tpl.php that did not include the line print $node->content['add_to_cart']["#value"].""; and placed it in my theme directory.
This worked great in that if there is no add to cart button you can not purchase the product. The problem I still had though is that when looking at all of the products in a category there was still an add to cart button.
Yesterday while researching different project dealing with CCK I cam across a post by torgosPizza regarding Able to Purchase vs. Coming Soon. I had to modify the code slightly from
<?php
function uc_product_coming_soon_add_to_cart($nid, $qty, $data) {
$available = db_result(db_query("SELECT field_available_value FROM {content_type_product} WHERE nid = %d", $nid));if ($available == 'N') {
$result[] = array(
'success' => FALSE,
'message' => t('Sorry, that product is not available to purchase yet.'),
);
}
return $result;
}
?>
to
<?php// $Id$
/**
* @file
* Is the product coming soon?
*
* Example module from Drupal book.
*/
function uc_product_coming_soon_add_to_cart($nid, $qty, $data) {
$available = db_result(db_query("SELECT field_available_value FROM {content_type_productnosale} WHERE nid = %d", $nid));
if ($available == 'N') {
$result[] = array(
'success' => FALSE,
'message' => t('Sorry, that product is not available to be purchased online. Please Call (888) 276-2907'),
);
}
return $result;
}
This makes the products truly non-salable.
In the same vein some manufacturers like Epson require us to follow minimum advertised pricing (MAP) guidelines. We had been showing only list price with a note to "add to cart for a lower price" on all products (something that drives me nuts). We recently converted the non-MAP products to their own class "productnomap" and again created a node-productnomap.tpl.php for our theme that shows list price and sell price. Moving the products was very easy. First we created the product class and then used phpmyadmin to change the node type.
Now when we export our xml data feed for Google Base we export two different feeds one for the products with no MAP that shows our sell price and another that shows list price for the products with MAP guidelines.

or whatever you need...