wolletje Posted November 4, 2015 Posted November 4, 2015 Hi all, I've been using oscommerce for a while now. Tinkering here and there with components and php-scripts. At this moment I'm trying to build some functionallity that is not found in current add-ons. I've found some documentation: - http://library.oscommerce.com/ - http://www.sourcexref.com/xref/oscommerce/nav.html?index.html(v2.3.3) - http://oscdox.com/crossx/nav.html?_functions/index.html(v2.2) But where can I find what what function is doing? Does anyone has a link to a location where the functions are explained/decribed? What I want to build is: As soon as I create an order (manually through the order editor), and add an item, I want be able to look up the last price that that customer paid for this item in a pop-up or have it filled into an extra variable. Any pointers towards extra documentation on tep_x functions is highly appreciated!! Regards, Wolletje
Jack_mcs Posted November 4, 2015 Posted November 4, 2015 As far as I know, nothing like that exists. Others will correct me if I am wrong. For the most part, the functions are named with their purpose so they are usually not difficult to figure out. But there isn't a function that grabs the last paid price for a product so you will need to code that yourself. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
wolletje Posted November 4, 2015 Author Posted November 4, 2015 Hi Jack_mcs, Thanks for your reply. Too bad that the functions themselves are not "described" more than by their name only. Makes the learning curve so much steeper. Meanwhile I've constructed a SQL statement that returns "last price" that the customer paid (in this example the customers_id =15 and the item has products_id = 1374) SELECT orders_id, products_id, products_priceFROM orders_productsWHERE orders_idIN ( SELECT orders_idFROM ordersWHERE customers_id =15 )AND products_id =1374GROUP BY orders_id DESCLIMIT 1 Will start from that then and will see if I can pour that in tep_db_query. Regards, Wolletje
Jack_mcs Posted November 4, 2015 Posted November 4, 2015 I suggest instead (not tested) select products_price from orders_products op left join orders o on op.orders_id - o.orders_id where ot.products_id = 1374 and o.customers_id = 15 GROUP BY o.orders_id DESC LIMIT 1 Also, be sure to use the tep_db_query and tep_db_fetch_array functions to handle it. These are used throughout the code so you can see examples if needed. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
bhavikakbari Posted November 4, 2015 Posted November 4, 2015 Hi all, I've been using oscommerce for a while now. Tinkering here and there with components and php-scripts. At this moment I'm trying to build some functionallity that is not found in current add-ons. I've found some documentation: - http://library.oscommerce.com/ - http://www.sourcexref.com/xref/oscommerce/nav.html?index.html(v2.3.3) - http://oscdox.com/crossx/nav.html?_functions/index.html(v2.2) But where can I find what what function is doing? Does anyone has a link to a location where the functions are explained/decribed? What I want to build is: As soon as I create an order (manually through the order editor), and add an item, I want be able to look up the last price that that customer paid for this item in a pop-up or have it filled into an extra variable. Any pointers towards extra documentation on tep_x functions is highly appreciated!! Regards, Wolletje all tep_x functions you can find at includes/functions/database.php ..
bhavikakbari Posted November 4, 2015 Posted November 4, 2015 tep_db_x functions you can find at includes/functions/database.php ..
Recommended Posts
Archived
This topic is now archived and is closed to further replies.