Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Removing the Add to cart?

    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?

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Removing the Add to cart?

    You could define the products as a "document-general" product type; those products don't support adding to the cart.

  3. #3
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Removing the Add to cart?

    Maybe. How/Where is that done?

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Removing the Add to cart?

    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.

  5. #5
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Removing the Add to cart?

    OK good to know. Now, can I change it on the 4 products already in the store?

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Removing the Add to cart?

    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.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Removing the Add to cart?

    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):
    Code:
    UPDATE products SET products_type = 3 where products_id = xxx
    Substitute xxx with the products_id of a single product to be modified to suit.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Removing the Add to cart?

    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().
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  9. #9
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Removing the Add to cart?

    Quote Originally Posted by mc12345678 View Post

    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):
    Code:
    UPDATE products SET products_type = 3 where products_id = xxx
    Just to clarify, how do I do that "manual SQL" instruction?

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Removing the Add to cart?

    Quote Originally Posted by CaroleAs View Post
    Just to clarify, how do I do that "manual SQL" instruction?
    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.

    Code:
    UPDATE products SET products_type = 3 WHERE products_id = 31;
    Then repeat for the other three replacing 31 with the next/each products id to modify.

    Another way to do this slightly "faster" is to identify all four products_id in a single statement:
    Code:
    UPDATE products SET products_type = 3 WHERE products_id in (31, num_two, num_three, num_four);
    Where the actual number replaces each of num_two, num_three, and 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:
    Code:
    UPDATE products SET products_type = 3 WHERE products_type = 1 AND products_id = 31;
    So, does that make it clearer and/or executable?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Removing the Add to cart button from certain products
    By rwhporg in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 14 Dec 2010, 12:20 AM
  2. Removing the add to cart button
    By ali123 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 30 Jul 2010, 09:52 PM
  3. Listing a product but removing the add to cart button
    By lj111970 in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 14 Oct 2008, 01:00 PM
  4. Removing add to cart
    By judah in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Jan 2008, 04:36 PM
  5. Swap over the 'add to cart' text/box and the 'add to cart' image
    By budfox in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 Apr 2007, 11:24 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