Page 80 of 113 FirstFirst ... 3070787980818290 ... LastLast
Results 791 to 800 of 1125
  1. #791
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hi,

    I have mass populated my products_with_attributes_stock with all product variant qty's.

    I have now realised ALL 4000+ lines need resyncing with the overall product qty.

    I there a way for me to run an sql query to do this to ALL lines???

    Also, I assume that this needs doing everytime I update my variant qtys.

    Many Thanks

    Phil

  2. #792
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Stocks by attributes

    Quote Originally Posted by philip937 View Post
    I there a way for me to run an sql query to do this to ALL lines???
    I don't have a SQL script handy that does this, and I would need help myself to construct one (seems there would be a bit of complexity in this kind of update script that is beyond my basic SQL knowledge) but to answer your question generally, yes, you could construct some SQL to do this update..

    Quote Originally Posted by philip937 View Post
    Also, I assume that this needs doing everytime I update my variant qtys.
    Only if you update the variant quantities via a direct upload..
    Last edited by DivaVocals; 7 Oct 2009 at 07:18 PM.

  3. #793
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default

    Quote Originally Posted by DivaVocals View Post
    I don't have a SQL script handy that does this, and I would need help myself to construct one (seems there would be a bit of complexity in this kind of update script that is beyond my basic SQL knowledge) but to answer your question generally, yes, you could construct some SQL to do this update..

    Only if you update the variant quantities via a direct upload..
    Does anyone know the query that gets sent to the database when clicking the sync qtys button? If I knew this I should imagine I could simply add this to the end of my update qty syntax???
    Posted via Mobile Device

  4. #794
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Stocks by attributes

    Quote Originally Posted by philip937 View Post
    Does anyone know the query that gets sent to the database when clicking the sync qtys button? If I knew this I should imagine I could simply add this to the end of my update qty syntax???
    Posted via Mobile Device
    Don't know why I didn't think of that.. I personally don't know the query off the top of my head, but if you dig through the files for this add-on, it should be easy to locate it yourself..

  5. #795
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    In the products_with_attributes_stock class you'll find this short function
    Code:
    function update_parent_products_stock($products_id)
    {
      global $db;
      $query = 'select sum(quantity) as quantity from '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' where products_id = "'.(int)$products_id.'"';
      $quantity = $db->Execute($query);
      $query = 'update '.TABLE_PRODUCTS.' set  products_quantity="'.$quantity->fields['quantity'].'" where products_id="'.(int)$products_id.'"';
      $db->Execute($query);
    }
    It first collects the summed total for a product's attribute variants and then applies it to the product table for that product.

    To avoid the php and apply it to all products, you would probably want to create a database view or a temporary table based on the first query and then apply the resulting rows in that to all matching rows in the product table.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #796
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Thanks kuroi, I shall take a look at this synatx and see if I can create one that repeats the same funtion on all products. So am I right in thinking:

    it looks at the attributes qty table and all matching rows of a particular product id, adds up all the corrosponding values in the quantity column and the updates the product id qty with the result in the products table??
    Posted via Mobile Device

  7. #797
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hi All

    I am having an issue with my stock by attributes. When I select Catalog > Products with attributes stock, Most of the timne I get a message saying a script has stopped working? something to do with Ajax??

    Also it says: Suchen: ??what does this mean?

    has anyone else got this problem, and or know any other problems before I go live with this add on???

    Regards,
    Phil

  8. #798
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Stocks by attributes

    Let me answer with a quote from Kuroi.. (who IMO has written the ONLY version of this add-on that is worth installing)
    Quote Originally Posted by kuroi View Post
    It maynot have all the bells and whistles, but the plain 4.7 version has been thoroughly tested to a professional standard, has no known bugs, and provided it's installed correctly will work fine.
    I've posted in this thread what my opinion is about the "others" (AKA the Ajax and the MultiAdd versions of SBA). I won't repeat it, but here's the link:
    http://www.zen-cart.com/forum/showpo...&postcount=776

    Quote Originally Posted by philip937 View Post
    Hi All

    I am having an issue with my stock by attributes. When I select Catalog > Products with attributes stock, Most of the timne I get a message saying a script has stopped working? something to do with Ajax??

    Also it says: Suchen: ??what does this mean?

    has anyone else got this problem, and or know any other problems before I go live with this add on???

    Regards,
    Phil

  9. #799
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by DivaVocals View Post
    Let me answer with a quote from Kuroi.. (who IMO has written the ONLY version of this add-on that is worth installing)

    I've posted in this thread what my opinion is about the "others" (AKA the Ajax and the MultiAdd versions of SBA). I won't repeat it, but here's the link:
    http://www.zen-cart.com/forum/showpo...&postcount=776
    oh dear well I know Kuroi knows their stuff.

    In this case, can someone please give me step by step as to how to roll back to 4.7...? I dont want to mess this up...

  10. #800
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Stocks by attributes

    Quote Originally Posted by philip937 View Post
    oh dear well I know Kuroi knows their stuff.

    In this case, can someone please give me step by step as to how to roll back to 4.7...? I dont want to mess this up...
    Yes he does..

    I'm afraid no one has written a step by step to remove one of the errant versions of SBA..

    Best way to approach this is to open up the folder where you have the source files that you used for your install and one by one open each folder and remove those same files from your store..

    That said, I cannot say for sure, but you may be able to simply install the Kuroi version over the Ajax version.. I haven't tried that personally to know if it works..

 

 
Page 80 of 113 FirstFirst ... 3070787980818290 ... LastLast

Similar Threads

  1. v139h Stocks of certain products disappearing automatically
    By Lowwi in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2015, 09:09 PM
  2. Installing Stocks by Attribute
    By dragon03kf in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Oct 2008, 07:42 PM
  3. Stocks by attributes
    By hcd888 in forum General Questions
    Replies: 1
    Last Post: 12 May 2008, 08:52 AM
  4. Multiple stocks per product
    By jaycode in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2007, 11:55 AM
  5. Products with attribute stocks
    By Svanis in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 5 Jul 2006, 03:19 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