Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    Hello,

    So easy enough I'd like to have two columns to upload in EP.
    1. v_products_id
    2. v_products_quantity

    This us what was received and will add to current stock.

    At my line 1561 a query selects the current contents...

    $sql = "SELECT
    p.products_quantity as v_products_quantity,

    I see in my line 1980 this...

    $query = "UPDATE " . TABLE_PRODUCTS . " SET
    products_quantity = '" . zen_db_input($v_products_quantity) . "' ,

    When updating, using + to SUM together, how do I parse the current qty and the incoming quantity?

    Or is it simply '" . zen_db_input($v_products_quantity + products_quantity) . "'

  2. #2
    Join Date
    Nov 2011
    Posts
    34
    Plugin Contributions
    0

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    I'm need to add an option for read the html content on external txt file for create product description, something like this:

    $desc_ext = 'http://www.siteweb.com/test_to_copy.txt';

    $content = file_get_contents($desc_ext);
    if ($content !== false) {
    $v_products_description[$l_id] = $content;
    } else {
    $v_products_description[$l_id] = 'No description';
    }

    but $v_products_description result always as "No description".

    If i try to include the text directly in:

    includes/templates/mytemplate/templates/tpl_product_info_display.php:

    <!--bof Product description -->
    <?php

    echo file_get_contents('http://www.siteweb.com/test_to_copy.txt');

    etc...

    it work but i need to read string on my sql db of course.

    Any help?

  3. #3
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    hmmm threadjacking?

    To summarize my first post, my goal is to ADD to current qty, not overwrite with Easy Populate.

    Is it this?......

    PHP Code:
    $query "UPDATE " TABLE_PRODUCTS " SET
    products_quantity = '" 
    zen_db_input($v_products_quantity products_quantity) . "' , 

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    If you want to add a value to the current value (eg: 6 currently in stock, PLUS 2 = 8 in stock)

    Then the following should work, run through Install SQL Patches under your tools menu:

    UPDATE products SET products_quantity = (products_quantity + 2);

    This will take the EXISTING quantity of ALL products and add TWO more to it.

    To constrain the calculation, you can use WHERE statements:

    UPDATE products SET products_quantity = (products_quantity + 2) WHERE products_id = 1322;

    ... will apply the calculation ONLY to the product with the ID 1322.
    19 years a Zencart User

  5. #5
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    Thanks schoolboy,

    That's a very useful tool for global qty updating (or per product id).

    I would like to apply dozens of different quantities to dozens of products as a CSV upload.

    Right now, I download from EP to get current qty and custom fields for order quantities and reorder levels. I would then save a CSV with products_id and products_qty columns. The product arrives (say 146 items with different quantities) and then I can upload in one shot the product received with the CSV. As it stands, we manually update each individual item at the product pages.

    I'm sure other companies are not doing this archaic and laborious way of receiving inventory.

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    EP 1,2,5,7 is not a reliable version.

    Depending on what ZC version you are using, you should be useing EP1.2.5.4 (ZC 1.3.9), or EP4 (ZC 1.5).

    And yes... updating product quantity is easy with EP.

    Recently, we have been using APSONA SHOPADMIN, which we believe to be better and more reliable.

    I have a WIKI ARTICLE on Easy Populate 1,2,5,4
    http://www.zen-cart.com/wiki/index.php/Easy_Populate
    19 years a Zencart User

  7. #7
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    1.3.8a
    During the initial post with this new site layout, there was a drop down selection for ZC version - thought that appeared somewhere on the post.

    I recently added Apsona as well, though I inquired about adding product qty to existing. They said it is not available. They suggested downloading that manufacturer's products and manually changing all the quantities.

    Well, with 1,200 products from one of our companies, 300 may come in. So manually filtering though 1,200 items, updating 300 manually then uploading back up is not real-time. Could take 15 minutes - meanwhile 5 products may have been purchased since then and quantities changed on you.

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    Quote Originally Posted by sbbemn View Post
    1.3.8a
    Before you worry about how you are going to change product quantities, UPGRADE the Zc software.

    This version is very vulnerable. If you get hacked (strong possibility) then you will have a LOT more to worry about than how many products you have in stock.

    If you have a lot of add-ons, then AT LEAST upgrade to 1.3.9h, and do it tonight.
    19 years a Zencart User

  9. #9
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    Quote Originally Posted by schoolboy View Post
    Before you worry about how you are going to change product quantities, UPGRADE the Zc software.

    This version is very vulnerable. If you get hacked (strong possibility) then you will have a LOT more to worry about than how many products you have in stock.

    If you have a lot of add-ons, then AT LEAST upgrade to 1.3.9h, and do it tonight.
    We've been sweating over this for a while. We have way too many new and existing customized pages to the point where we feel too overwhelmed to upgrade. Would take a LOT of merging, which at this point is the only option.

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Easy Populate 1.2.5.7 - add to products_quantity, not overwrite

    That's why I suggest an upgrade to at least 1.3.9h. The Changelog is quite easy to follow, and about a year ago we did a rather detailed upgrade of a new client's site where they had ignored the over-ride procedure.

    It was a bit of a hassle, but the whole process took us about 2 hours.

    ... compared to the 20 or so hours it can take to try to fix a hack...
    19 years a Zencart User

 

 

Similar Threads

  1. v150 Easy Populate 4 vs. Easy Populate CSV - What's going on with so many Easy Populates?
    By oleancomputers in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 20 Jun 2013, 05:58 PM
  2. v138a I want to add to stock via EP, not overwrite
    By sbbemn in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 16 Aug 2012, 11:19 PM
  3. Add Fields with Easy Populate?
    By defchino in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 21 Dec 2008, 07:45 AM
  4. Easy Populate add-in
    By Schatham in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 14 Sep 2008, 02:34 PM
  5. Help Easy Populate Not So Easy :)
    By hcd888 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 May 2008, 01:49 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