Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: My add to cart only adds one

    You could write a SQL patch to alter the relevant database field for all products; if you want different products or categories to have different unit quantities, it would get trickier. It would take some research to find the correct field to modify.

  2. #12
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: My add to cart only adds one

    Quote Originally Posted by actionjackson57 View Post
    Thank you. I tried that and it did work but it has been working for several years without my ever having entered '6' in that area of the product edit. Customers have been ordering 12 & 18's or if something is offered in 3's, 2 clicks got them 6 of that product. Now I would have to go thru 1800 products to add that into every one, unless there is some way to change it globally for a certain category or in some way. I appreciate your getting back to me and your accurate info. I don't understand how it changed from working before to now.
    There's a number of ways that it could be/could have been addressed, between custom code multipliers, code changes (possibly an override in a previous template), or database changes.

    If you have an idea of what products will have how much for the units, then a sql statement could be written to set it to a specific current value, or a multiplier of the existing. There's also plugins that allow download of the data that is then modified and uploaded back with the updates. (Easy Populate) there's also options such as making certain products fit into a category and then doing one of the above to adjust the category and then disbanding that category (as necessary) when no longer needed. Etc...

    All depends on what you have, and where you want to go from there.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Nov 2009
    Posts
    102
    Plugin Contributions
    0

    Default Re: My add to cart only adds one

    Thank you for your help. I will have to find someone to see if they can make that change as I wouldn't want to mess with the code any more than I have so far, which is minimal and a few years ago.

    Quote Originally Posted by gjh42 View Post
    You could write a SQL patch to alter the relevant database field for all products; if you want different products or categories to have different unit quantities, it would get trickier. It would take some research to find the correct field to modify.

  4. #14
    Join Date
    Nov 2009
    Posts
    102
    Plugin Contributions
    0

    Default Re: My add to cart only adds one

    Thank you. It's certainly beyond my minimal knowledge but perhaps I can find someone to write that bit of code, then try it on a copy of the data to see if it works. It would probably be easier to change all the products to 6 in that field, then go back thru and change eh ones that are not supposed to be set to 6, as there are far less of them. I appreciate your help and advice.

    Quote Originally Posted by mc12345678 View Post
    There's a number of ways that it could be/could have been addressed, between custom code multipliers, code changes (possibly an override in a previous template), or database changes.

    If you have an idea of what products will have how much for the units, then a sql statement could be written to set it to a specific current value, or a multiplier of the existing. There's also plugins that allow download of the data that is then modified and uploaded back with the updates. (Easy Populate) there's also options such as making certain products fit into a category and then doing one of the above to adjust the category and then disbanding that category (as necessary) when no longer needed. Etc...

    All depends on what you have, and where you want to go from there.

  5. #15
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: My add to cart only adds one

    The table is the products table, the field is the products_quantity_order_units.

    So, you would do an update query on the products table to set the field equal to the new value you want. If you want every product in your store tobe set to the new value then it is really easy to do. Otherwise would want to know what specific data would uniquely identify the items to be updated.

    Probably the most generic queries that could be run (and if using this or other suggested queries, be sure to backup your database before using a query) might be:

    UPDATE products SET products_quantity_order_units=6;
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #16
    Join Date
    Nov 2009
    Posts
    102
    Plugin Contributions
    0

    Default Re: My add to cart only adds one

    Thanks again for your excellent advice. We have about 6 categories of products. 4 of them are similar with differing quantities as a minimum purchase. Do you know how I could change the products_quantity_order_units to allow them to be changed 'globally' only within that category?


    Quote Originally Posted by mc12345678 View Post
    The table is the products table, the field is the products_quantity_order_units.

    So, you would do an update query on the products table to set the field equal to the new value you want. If you want every product in your store tobe set to the new value then it is really easy to do. Otherwise would want to know what specific data would uniquely identify the items to be updated.

    Probably the most generic queries that could be run (and if using this or other suggested queries, be sure to backup your database before using a query) might be:

    UPDATE products SET products_quantity_order_units=6;

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

    Default Re: My add to cart only adds one

    Quote Originally Posted by actionjackson57 View Post
    Thanks again for your excellent advice. We have about 6 categories of products. 4 of them are similar with differing quantities as a minimum purchase. Do you know how I could change the products_quantity_order_units to allow them to be changed 'globally' only within that category?
    Would need to identify the category number (CATN) that can be found when navigating the product catalog on the admin side. (Number adjacent to category name to be substituted below in CATN.)

    Then you would refine the SQL statement to the following adding a WHERE clause.
    Code:
    UPDATE products SET products_quantity_order_units=6 WHERE master_categories_id = CATN;
    So replace CATN with the number from above and all products in that category (does not include linked products, also this will affect disabled products, etc. Fairly non-discriminating and all the more reason to backup your data before attempting the above SQL as it will affect so much of your data at once. (Less now than before, but still.)). BACKUP, BACKUP, BACKUP. There, said it. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #18
    Join Date
    Nov 2009
    Posts
    102
    Plugin Contributions
    0

    Default Re: My add to cart only adds one

    Thank you again. You sure do know your Zen-Cart, inside out. I am sure I can find the CATN. The fact that this change won't modify the linked products is a pain but still doable. It shouldn't matter that it also changes the disabled products, since they are not showing in the store anyhow. Could you please tell me where this bit of code would be inserted to make it all work? Would I then insert this same bit of code with each different CATN, into the same area right below the first one? What goes in the first [CODE] before the term 'UPDATE products SET products'? I will back up for sure. This seems to be just one of many changes my store has since my hosting service updated my Php from 4.something to 5.something. Do you know if this is a common consequence of a Php update? Thanks again.


    Quote Originally Posted by mc12345678 View Post
    Would need to identify the category number (CATN) that can be found when navigating the product catalog on the admin side. (Number adjacent to category name to be substituted below in CATN.)

    Then you would refine the SQL statement to the following adding a WHERE clause.
    Code:
    UPDATE products SET products_quantity_order_units=6 WHERE master_categories_id = CATN;
    So replace CATN with the number from above and all products in that category (does not include linked products, also this will affect disabled products, etc. Fairly non-discriminating and all the more reason to backup your data before attempting the above SQL as it will affect so much of your data at once. (Less now than before, but still.)). BACKUP, BACKUP, BACKUP. There, said it. :)

  9. #19
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: My add to cart only adds one

    Quote Originally Posted by actionjackson57 View Post
    Thank you again. You sure do know your Zen-Cart, inside out. I am sure I can find the CATN. The fact that this change won't modify the linked products is a pain but still doable. It shouldn't matter that it also changes the disabled products, since they are not showing in the store anyhow. Could you please tell me where this bit of code would be inserted to make it all work? Would I then insert this same bit of code with each different CATN, into the same area right below the first one? What goes in the first [CODE] before the term 'UPDATE products SET products'? I will back up for sure. This seems to be just one of many changes my store has since my hosting service updated my Php from 4.something to 5.something. Do you know if this is a common consequence of a Php update? Thanks again.
    Again, what is to be modified depends on your conditions/desires. So, these things that have been written are called SQL statements. You can open your admin panel, go to the tools drop down, then Install SQL patches, and copy the "line(s)" that you want run (remember to replace CATN with a number that relates to the category number associated with it. It is not typical for the PHP version change to effect the way your store operates... Now, if someone did an update because PHP was updated, then it could be that the previous functionality was not restored in the new setup.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. ADD TO CART on Category Listing in One Category only
    By ald0413 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Jan 2011, 07:05 PM
  2. Multiple Items with only one add to cart button per page
    By chriscook in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 8 Jan 2011, 09:12 PM
  3. Replies: 0
    Last Post: 2 Jan 2011, 01:14 PM
  4. Restrict to add only one item in shopping cart
    By arunkarthik in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 1 May 2010, 01:10 PM
  5. Missing Add to Cart Button on only one category
    By trisha1581 in forum General Questions
    Replies: 8
    Last Post: 8 Jul 2009, 02:43 AM

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