Re: Easy Populate 1.2.5.4 support
In order to add to products_quantity, is it simply '" . zen_db_input($v_products_quantity + p.products_quantity) . "'
Quote:
Originally Posted by
djdavedawson
PHP Code:
zen_db_input($v_products_quantity + $row['p.products_quantity'])
or
PHP Code:
// Put Higher up in code
$existing_qty = $row['p.products_quantity'];
// Then in Statement
zen_db_input($v_products_quantity + $existing_qty)
Thanks dj,
All 3 suggestions - my 1 and your 2 all overwrite the products_quantity, testing each a couple times to make sure.
What is missing?
At my line 1551, I see that there is a query to get the record's current contents which selects p.products_quantity as v_products_quantity - so it should be drawing current qty and adding the incoming v_ quantity.
Re: Easy Populate 1.2.5.4 support
I know this may be redundant but try this.
PHP Code:
// Put Higher up in code
$combined_qty = ($v_products_quantity + $row['p.products_quantity']);
// Then in Statement
zen_db_input($combined_qty)
If that doesn't work try this to make sure you're even in the right spot.
PHP Code:
zen_db_input(($v_products_quantity + 1))
Re: Easy Populate 1.2.5.4 support
Quote:
// Put Higher up in code
$combined_qty = ($v_products_quantity + $row['p.products_quantity']);
// Then in Statement
zen_db_input($combined_qty)
dj,
Definitely in the right direction. It did overwrite again, but when changing the variable $combined_qty to
PHP Code:
$combined_qty = ($v_products_quantity + 1);
it did just that, starting with a qty of 5 in the upload and added 1 for a total of 6. So it is working. For some reason it's not grabbing the current p.products_quantity and adding, it's only taking the v_products_quantity from the upload.
Re: Easy Populate 1.2.5.4 support
How about this?
PHP Code:
$combined_qty = ($v_products_quantity + $row['v_products_quantity']);
Re: Easy Populate 1.2.5.4 support
strange. still overwriting.
I tried this too.
PHP Code:
$combined_qty = ($v_products_quantity + $row['products_quantity']);
I assume since the sql select statement is pulling the data appropriately it should work. But what if the current data is not recognizable as it wants to overwrite p.products_quantity with v_products_quantity. Seems like it is not possible to draw current products_quantity with Easy Populate?
Re: Easy Populate 1.2.5.4 support
What happens when you do this?
Find this around 1456:
PHP Code:
while ($row){
$product_is_new = false;
Replace With this:
PHP Code:
while ($row){
$product_is_new = false;
$existing_qty = $row['v_products_quantity'];
Then in your statement around line 1962
PHP Code:
products_quantity="' . zen_db_input(zen_db_input($v_products_quantity + $existing_qty)
Re: Easy Populate 1.2.5.4 support
AHA - searching for an existing product!
It looks like we have a winner - thank you dj!
In conclusion, if someone wants to use Easy Populate to mass upload received product (saves us up to 30 minutes per order received)
A. download current quantities. (we have 2 custom fields as well - order point and order quantity - then excel formula what needs to be ordered. I also disregard the formula if doing custom ordering)
B. strip down to 3 columns - v_products_id v_products_model v_products_quantity
C. Save csv for when product arrives.
D. Receive product, make sure you received what is on your csv
E. Upload csv
Use the following code in EP
Find this around 1456:
PHP Code:
while ($row){
$product_is_new = false;
Replace With this:
PHP Code:
while ($row){
$product_is_new = false;
$existing_qty = $row['v_products_quantity'];
Then in your statement around line 1962
PHP Code:
products_quantity="' . zen_db_input(zen_db_input($v_products_quantity + $existing_qty)
Re: Easy Populate 1.2.5.4 support
You're welcome. :)
Be sure to backup backup and test test test before you rely on this.
I do this kind of thing in excel using vlookup with absolute table refs from one worksheet to another and adding the values all in one column.
Then I just copy the column and 'paste values' right on the of the outputs.
~D
Re: Easy Populate 1.2.5.4 support
Hello guys, i have an issue and i was wondering if this code will work for my situation. I have an .xls sheet with all my innovatory, fields are like this: Product unique name, product ID, product price, product description, product size (and quantities for that size). Write now i am adding sizes and quantities for each product manually in the data base. I have a lot of products, so naturally its taking me a while to do that. I would like to use some kind of a script that can read product id, product sizes for that id, and product quantities for those sizes, and then export everything in to data base. I have been struggling with this for a week now, any help would be appreciated.
Re: Easy Populate support
I just installed Easy populate and renamed the admin folder to match my admin folder. When I go to tools there is no Easy Populate option, can someone help me out ?
thanks