I have some products that I want available without going through the checkout process so I have added a direct download link in the description. Is there a way to remove the Add to Cart button for those products only?
Printable View
I have some products that I want available without going through the checkout process so I have added a direct download link in the description. Is there a way to remove the Add to Cart button for those products only?
You could define the products as a "document-general" product type; those products don't support adding to the cart.
Maybe. How/Where is that done?
When you create a product via the Catalog->Categories/Products->(New Product) button, there's a dropdown selection that defaults to "Product - General" just to the right of that button.
Change that selection to "Document - General" and click the "New Product" button to create that product type.
OK good to know. Now, can I change it on the 4 products already in the store?
I think you have to update the database. You want the products_type field in the products table (for the 4 products mentioned). Be sure to test to ensure your template can handle other product types.
Generally speaking, it is not always a good idea to transition from one product type to another manually because different product type may need additional information not made available by/to the "other" product types. But transitioning from product general (default product type) to a standard document general product type does not have anything specifically "extra".
Since only doing the 4 products a manual SQL instruction will do for the four product (either one at a time or some variation that affects multiple):
Substitute xxx with the products_id of a single product to be modified to suit.Code:UPDATE products SET products_type = 3 where products_id = xxx
There are other options, of course. For example, you could extend zen_get_products_allow_add_to_cart() to check for the products in question. To make it more maintainable, you could add a new field to the products table and check the field (rather than specific product ids) in zen_get_products_allow_add_to_cart().
I apologize if this is made more basic than desired, expected, or necessary; however, based on the question I'm nearly starting at the beginning...
Okay, so there appear to be four product that are to be reassigned from a product_general to a document_general product type. First need to identify the products_id for each of the four product.
This can be found in a number of ways: navigation of the store side of the site and noting the uri for each of the four product (contains products_id=XXX where XXX is the products_id) when using a standard ZC installation, navigating the admin side in the catalog->Products/categories section and navigating to the category that contains the product the products_id will be on the left side of the listing, there are yet other ways to identify the products_id within the admin and otherwise.
Anyways, now that the products_id is in hand, one for each product, the goal is to now change the products_type from product_general to document_general...
Now, to do this requires executing a sql statement. ZC has been written to include a sql statement executor that doesn't require the datatable prefix, because it applies it automatically now. What this means is that a "generic" SQL statement can be written and when executed in the tools->Install SQL Patches section that SQL statement will "work" for any store. (Quoted work because there are some obvious reasons that a SQL statement may not work such as a modification of a field that exists only in a plugin and the plugin is not installed on the system, or in the case of security a select statement doesn't display information, etc...)
So if we assume that the products_id of the first of four product to modify is say 31, then when in the admin screen, select tools->Install SQL patches
In the text block that appears, place the following therein. It must end with a semi-colon as provided.
Then repeat for the other three replacing 31 with the next/each products id to modify.Code:UPDATE products SET products_type = 3 WHERE products_id = 31;
Another way to do this slightly "faster" is to identify all four products_id in a single statement:
Where the actual number replaces each of num_two, num_three, and num_four.Code:UPDATE products SET products_type = 3 WHERE products_id in (31, num_two, num_three, num_four);
An added "safety" to each of those statements would be to include a sort of validation/prevention of changing the products_type of a product that has otherwise already been modified, such as:
So, does that make it clearer and/or executable?Code:UPDATE products SET products_type = 3 WHERE products_type = 1 AND products_id = 31;