hungryfrank Posted November 22, 2016 Share Posted November 22, 2016 hi why this line don't work tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . $QuantityPurchased . " and products_quantity = products_quantity- " . $QuantityPurchased . " where products_id = '" . tep_get_prid($SKU) . "'"); } in the next lines it enters the correct info into a different table you can cut up to 4 pages of your checkout by using my three add_ons login create account in one page Express checkout login pop up modal Link to comment Share on other sites More sharing options...
♥BrockleyJohn Posted November 22, 2016 Share Posted November 22, 2016 Try separating the minus from products_quantity with a space edit to add: It would be safer to cast the variable to integers too, eg. . (int) $QuantityPurchased . Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
tgely Posted November 22, 2016 Share Posted November 22, 2016 Tip: Stock Keeping Unit mainly associated with SKU number or products_model and rarely with products_id. osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
hungryfrank Posted November 22, 2016 Author Share Posted November 22, 2016 thanks guys . @@action Hero. i am trying to enter my ebay orders into osc orders so i use the sku to know what attributes were used in the ebay listing.everything seems to work but i have two problems this is one and the other i will post shortly. but i still have a problem if i use tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $QuantityPurchased) . " where products_id = '" . $e_id . "'"); tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . sprintf('%d', $QuantityPurchased) . " where products_id = '" . $e_id . "'"); it works but if i use one call then products_ordered turns to zero and product s_quantity dosen't change tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $QuantityPurchased). " and products_quantity = products_quantity - " . sprintf('%d', $QuantityPurchased). " where products_id = '" . $e_id . "'"); you can cut up to 4 pages of your checkout by using my three add_ons login create account in one page Express checkout login pop up modal Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 22, 2016 Share Posted November 22, 2016 The format of the update is set a=value, b=value, not set a=value and b=value. Also, there's no need for the spintf calls. just cast the values to int as mentioned previously: (int)$QuantityPurchased Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
hungryfrank Posted November 23, 2016 Author Share Posted November 23, 2016 thx Jack you can cut up to 4 pages of your checkout by using my three add_ons login create account in one page Express checkout login pop up modal Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.