Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Update Quantity(add or subtract from Quantity)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-26-2005, 02:47 PM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default Update Quantity(add or subtract from Quantity)

OK This mod allow you to update you quantity relative to the current quantity. Tested on 4.0.13

If you check Relative update it will add to the quantity if the number is positive and subtract if the number is negative.

Find: (provider/inv_update.php)
Code:
while ($columns = fgetcsv ($fp, 65536, $delimiter)) { if (empty($columns[0])) { continue; } $columns[0] = addslashes($columns[0]); $pid = func_query_first_cell ("SELECT productid FROM $sql_tbl[products] WHERE productcode='$columns[0]' $provider_condition");
Below this last line Add the following code:
Code:
if (!empty($rel)){ $pquan = func_query_first_cell ("SELECT avail FROM $sql_tbl[products] WHERE productcode='$columns[0]' $provider_condition"); $pquan = $pquan + $columns[1]; } else { $pquan = $columns[1]; }

Now find (in provider/inv_update.tpl):
Code:
<TD>{$lng.lbl_csv_file}</TD> <TD><INPUT type="file" name="userfile">

Make Look Like this:
Code:
<TD>{$lng.lbl_csv_file}</TD> <TD><INPUT type="file" name="userfile"> <INPUT type="checkbox" name="rel">Relative Qauntity Change

Cheers
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
  #2  
Old 05-28-2005, 07:33 AM
  CC's Avatar 
CC CC is offline
 

eXpert
  
Join Date: Jun 2004
Posts: 349
 

Default

I am not quite sure what you mean by this...

What does it do exactly?
__________________
XC 4.2 inc (unofficial) patch release.
Reply With Quote
  #3  
Old 05-28-2005, 01:00 PM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default

If I have a .csv file that looks like this:

Code:
MIN-98D, -1 XL-837-R, 2

And I had the Relative Quantity option enabled. When I upload the .csv with SKU and Quantity If the Quantity is a positive number "2" it will add 2 to the current Quantity and If the Quantity is a negaitve number "-1" it will subetract 1 from the current Quantity.

Currently the default inventory update just replaces the current quantity with the quantity shown in the .csv

I sell items on ebay over the phone and at our show room. I update the inventory online daily with our stores Quickbooks inventory list but our Ebay items are not removed from the Quickbooks inventory so I have a list of all Ebay items that I want to remove from the online inventory after I update it with Quickbooks inventory. I could not do this because I need to have a list subtract one from the online inventory and x-cart only lets you replace the value.

Hope this helps
Scott
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:29 PM.

   

 
X-Cart forums © 2001-2020