ralphday Posted June 1, 2005 Share Posted June 1, 2005 Hello. I just finished an eshop with QTpro 4.2 on it, plus some small contributions, AND paypal IVN. I have a serious problem, since the purchased items are NOT being subtracted from the QTpro Attribute Stock...... Please, help, if there is a solution about it, or any other files i need to change. Thank you very, VERY much... George. <{POST_SNAPBACK}> Paypal IPN duplicates the code in checkout_process.php across several other files. The one you are concerned with is order.class.php. You need to duplicate the changes to reduce attribute stock form the QT Pro version of checkout_process.php into order.class.php. Also, see my post right before this about a change to order.php that I think will be necessary to get Paypal IPN working. The line numbers will be different for you since you are using QT Pro 4.2. Just take the QT Pro changes in order.php that are marked and replicate them to the duplicated code earlier in the file. Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 1, 2005 Share Posted June 1, 2005 hey budy thankx for helping, i tried what you said but its still didnt work. Not sure if i did something wrong. i am attaching my catalog/inlcudes/calsses/order.php file, if you can please take a look and see if anything is wrong. download file thankx again I think I see the problem. Base osCommerce creates the order object in checkout_process without an order id which pulls the order information from the cart. Paypal IPN creates it with an order ID which pulls the order information from the database. QT Pro only mods the cart portion of the order class to capture the "special" (QT Pro 3) or "Track Stock" (QT Pro 4) flag. The same mod needs to be made to the database portion of the order class. So in catalog/includes/classes/order.php at line 118-124 you'll see pretty much the same code that QT Pro modifies at line 233-242. Apply the same modifications to the line 118-124 code and I think it will work. Be sure to merge the QT Pro changes with the Paypal IPN canges to the same lines. The line numbers given are for the QT Pro 3.1 version of order.php Hope this works for you. Ralph <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 1, 2005 Share Posted June 1, 2005 hey budy thankx for helping,i tried what you said but its still didnt work. Not sure if i did something wrong. i am attaching my catalog/inlcudes/calsses/order.php file, if you can please take a look and see if anything is wrong. download file thankx again <{POST_SNAPBACK}> I don't see your code changes in ther, but no matter. With my quick look earlier I thought it would be easier than it is. To do it right you should add a column to the orders_products_attributes table to save the special flag in the order. That's a little more work than I'm up to right now so here's a qucik hack joining over to the products_options table to get the special flag. Try these changes at line 127 in orders.php: //begin PayPal_Shopping_Cart_IPN //begin QT PRO/Paypal IPN $attributes_query = tep_db_query("select opa.products_options_id, opa.products_options_values_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix, popt.special from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " opa, " . TABLE_PRODUCTS_OPTIONS . " popt where opa.orders_id = '" . (int)$order_id . "' and opa.orders_products_id = '" . (int)$orders_products['orders_products_id'] . "' and popt.products_options_id = opa.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); //end QT PRO/Paypal IPN //end PayPal_Shopping_Cart_IPN if (tep_db_num_rows($attributes_query)) { while ($attributes = tep_db_fetch_array($attributes_query)) { $this->products[$index]['attributes'][$subindex] = array( //begin PayPal_Shopping_Cart_IPN 'option_id' => $attributes['products_options_id'], 'value_id' => $attributes['products_options_values_id'], //end PayPal_Shopping_Cart_IPN //begin QT PRO/Paypal IPN 'special' => $attributes['special'], //end QT PRO/Paypal IPN 'option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price']); No testing, just a raw brain dump into code so you'll likely have to clean up some syntax problems particularly in the DB query. Ralph Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 1, 2005 Share Posted June 1, 2005 hey Ralph , thankyou soo much for replying and helping me out. i tried what you said but still the quantity is not getting substracted :( here is the new orders.php file with your changes please take a look thankx agian Quote Link to comment Share on other sites More sharing options...
georgemgr Posted June 2, 2005 Share Posted June 2, 2005 No luck. I changes chechout_process, order, order.class for ipn and qtpro, but STILL it doesn't subtract the quantities... The MOST strange thing, is that oscommerce won't even RESTOCK the quantities of QTpro, when i delete an order and i select the "restock items" selection... Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 2, 2005 Share Posted June 2, 2005 hey Ralph , thankyou soo much for replying and helping me out.i tried what you said but still the quantity is not getting substracted :( here is the new orders.php file with your changes please take a look thankx agian <{POST_SNAPBACK}> Hmmm. I thought I had it there. Your changes look good. Well, the changes definitely needed to be made or it wasn't likely to work. Now I'm back to being puzzled. I'll let you know if I come up with something. Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 2, 2005 Share Posted June 2, 2005 No luck. I changes chechout_process, order, order.class for ipn and qtpro, but STILL it doesn't subtract the quantities... The MOST strange thing, is that oscommerce won't even RESTOCK the quantities of QTpro, when i delete an order and i select the "restock items" selection... <{POST_SNAPBACK}> I'm baffled as to why it won't work right now. As for the delete with restock it sounds like a missing change to checkout_process.php that stores the attribute information in the order for the delete or a missing change to admin/includes/general.php to add the code for restocking attribute quantities. Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 2, 2005 Share Posted June 2, 2005 Hmmm. I thought I had it there. Your changes look good. Well, the changes definitely needed to be made or it wasn't likely to work. Now I'm back to being puzzled. I'll let you know if I come up with something. <{POST_SNAPBACK}> thankx buddy :) Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 4, 2005 Share Posted June 4, 2005 hey guys i am trying to combine these 2 files /admin/stock.php ( qtp file) in /admin/new_attributes.php ( new attribute manager file ) contribution can be downlaoded here here are these 2 files. stock.php and new_attributes.php what i want is to add qtp stock quantity on new_attributes.php Page please view this picture from admin side > /admin/new_attributes.php?action=select¤t_product_id=213&cPath=43 any help is greatly appreciated thankyou Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2005 Share Posted June 4, 2005 can i use the QTpro 4.2a with attribute features 1.7.1 and with the pizza_contrib ? Quote Link to comment Share on other sites More sharing options...
karissal Posted June 5, 2005 Share Posted June 5, 2005 Hi all, I'm getting a little blurry eyed from staring at the screen so long tonight. Maybe somebody can help me out with this one...I can't seem to find a solution on the boards yet. I installed QTPro 4.2a on a clean, new OSC 2.2M install and it's not working quite right. There are two errors I am getting... 1) On the Stock page I get the following error: 1146 - Table 'fliptops_osc3.TABLE_PRODUCTS_STOCK' doesn't exist select * from TABLE_PRODUCTS_STOCK where products_id=28 order by products_stock_attributes 2) on /catalog/admin/configuration.php if I try to edit "Product Info Attribute Display Plugin" I get the following error - Fatal error: Call to undefined function: tep_cfg_pull_down_class_files() in /home/fliptops/public_html/catalog/admin/configuration.php(125) : eval()'d code on line 1 This is similar to a problem somebody mentioned on this thread but their table was missing, I believe. I have confirmed that the table does exist. Any ideas? I'd appreciate the help...I feel like I'm allllllmooosssst there! :blush: -Karissa Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 5, 2005 Share Posted June 5, 2005 Hi all,I'm getting a little blurry eyed from staring at the screen so long tonight. Maybe somebody can help me out with this one...I can't seem to find a solution on the boards yet. I installed QTPro 4.2a on a clean, new OSC 2.2M install and it's not working quite right. There are two errors I am getting... 1) On the Stock page I get the following error: 1146 - Table 'fliptops_osc3.TABLE_PRODUCTS_STOCK' doesn't exist select * from TABLE_PRODUCTS_STOCK where products_id=28 order by products_stock_attributes 2) on /catalog/admin/configuration.php if I try to edit "Product Info Attribute Display Plugin" I get the following error - Fatal error: Call to undefined function: tep_cfg_pull_down_class_files() in /home/fliptops/public_html/catalog/admin/configuration.php(125) : eval()'d code on line 1 This is similar to a problem somebody mentioned on this thread but their table was missing, I believe. I have confirmed that the table does exist. Any ideas? I'd appreciate the help...I feel like I'm allllllmooosssst there! :blush: -Karissa <{POST_SNAPBACK}> It sounds like you didn't copy all of the files into the admin directory. The problem with TABLE_PRODUCTS_STOCK missing is that you don't have the QT Pro catalog/admin/includes/database_tables.php installed. The call to undefined function tep_cfg_pull_down_class_files is because you don't have the QT Pro catalog/admin/includes/functions/general.php installed. Try copying over all of the QT Pro files again. Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 5, 2005 Share Posted June 5, 2005 can i use the QTpro 4.2a with attribute features 1.7.1 and with the pizza_contrib ? <{POST_SNAPBACK}> I'm sure you can use these contributions together, its just a matter of how much work it will be to merge them together. I'm not real familiar with either contribution you mention so I can't comment on how easy or difficult it will be. Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 5, 2005 Share Posted June 5, 2005 hey guys i am trying to combine these 2 files /admin/stock.php ( qtp file) in /admin/new_attributes.php ( new attribute manager file ) contribution can be downlaoded here here are these 2 files. stock.php and new_attributes.php what i want is to add qtp stock quantity on new_attributes.php Page <{POST_SNAPBACK}> I didn't take a close look at attributes manager, but I think you're trying to cross apples with oranges. Attributes manager looks like it deals with attributes. QT Pro deals with attribute combinations. IOW, attribute manager will manage sizes for a product and colors for a product separately but not the color/size combinations. QT Pro manages stock for attribute combinations (color/size). So you can't really add stock to a page thats just displaying sizes. Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 5, 2005 Share Posted June 5, 2005 I didn't take a close look at attributes manager, but I think you're trying to cross apples with oranges. Attributes manager looks like it deals with attributes. QT Pro deals with attribute combinations. IOW, attribute manager will manage sizes for a product and colors for a product separately but not the color/size combinations. QT Pro manages stock for attribute combinations (color/size). So you can't really add stock to a page thats just displaying sizes. <{POST_SNAPBACK}> got it thankx :P Quote Link to comment Share on other sites More sharing options...
karissal Posted June 5, 2005 Share Posted June 5, 2005 It sounds like you didn't copy all of the files into the admin directory. The problem with TABLE_PRODUCTS_STOCK missing is that you don't have the QT Pro catalog/admin/includes/database_tables.php installed. The call to undefined function tep_cfg_pull_down_class_files is because you don't have the QT Pro catalog/admin/includes/functions/general.php installed. Try copying over all of the QT Pro files again. Yup! You were right - I copied them over somewhere else, I think. It's all working fine now! Thanks so much for helping w/ something so silly. :blush: -K Quote Link to comment Share on other sites More sharing options...
newclearbomb Posted June 6, 2005 Share Posted June 6, 2005 Paypal IPN duplicates the code in checkout_process.php across several other files. The one you are concerned with is order.class.php. You need to duplicate the changes to reduce attribute stock form the QT Pro version of checkout_process.php into order.class.php. Also, see my post right before this about a change to order.php that I think will be necessary to get Paypal IPN working. The line numbers will be different for you since you are using QT Pro 4.2. Just take the QT Pro changes in order.php that are marked and replicate them to the duplicated code earlier in the file. <{POST_SNAPBACK}> Hi Ralph, I've also got QTpro 4.2 installed with Paypal IPN (V1.1 I believe) and it works fine, people can place orders no problem, but I'm finding the stock levels are not auto updating :( Your post above sounded great and made sense of why it's not updating, except that I don't appear to have a file called ORDER.CLASS.PHP :mellow: The closest I can find is ORDERS_TBL_CLASS.PHP Please could you clarify wht the filename should be and what changes need making to it? thanks in advance, James Quote Link to comment Share on other sites More sharing options...
ralphday Posted June 6, 2005 Share Posted June 6, 2005 Hi Ralph,I've also got QTpro 4.2 installed with Paypal IPN (V1.1 I believe) and it works fine, people can place orders no problem, but I'm finding the stock levels are not auto updating :( Your post above sounded great and made sense of why it's not updating, except that I don't appear to have a file called ORDER.CLASS.PHP :mellow: The closest I can find is ORDERS_TBL_CLASS.PHP Please could you clarify wht the filename should be and what changes need making to it? thanks in advance, James <{POST_SNAPBACK}> You might have a different Paypal IPN than the one being discussed here. order.class.php is in catalog/includes/modules/payment/paypal/classes/osC If you don't have it there then you are working with a different contribution. Look back at my later replies to sinryder on what the changes need to be. Unfortunately, they still didn't solve this problem for him. I haven't come up with any new ideas yet. I don't do anything with Paypal so I don't have a test bed setup to debug it. I really need someone to add some kind of logging (print/echo/log to file) into the code to figure out why its not updating the stock. Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 7, 2005 Share Posted June 7, 2005 Hi Ralph,I've also got QTpro 4.2 installed with Paypal IPN (V1.1 I believe) and it works fine, people can place orders no problem, but I'm finding the stock levels are not auto updating :( Your post above sounded great and made sense of why it's not updating, except that I don't appear to have a file called ORDER.CLASS.PHP :mellow: The closest I can find is ORDERS_TBL_CLASS.PHP Please could you clarify wht the filename should be and what changes need making to it? thanks in advance, James <{POST_SNAPBACK}> hey budy, start reading from post #338 , before installing the new paypal ipn verison i was running paypal ipn v2.3 ,i think it has the same file structure as v1.1. Ralph helped me with that code and qtp paypal were working perfect together. It was substracting the quantities when ever customer pays through paypal and payment was successfull. really need someone to add some kind of logging (print/echo/log to file) into the code to figure out why its not updating the stock. ralph if you can tell me how to put the logging thing i ll do it thankx Quote Link to comment Share on other sites More sharing options...
newclearbomb Posted June 7, 2005 Share Posted June 7, 2005 hey budy, start reading from post #338 , before installing the new paypal ipn verison i was running paypal ipn v2.3 ,i think it has the same file structure as v1.1. Ralph helped me with that code and qtp paypal were working perfect together. It was substracting the quantities when ever customer pays through paypal and payment was successfull. ralph if you can tell me how to put the logging thing i ll do it thankx <{POST_SNAPBACK}> Thanks guys, I've done a fair bit of reading of this thread today and kind of understand where my problem lies and have tried to fix it, but without success :( I'm running Paypal IPN v 1.1.2.11 and in this version, it seems the checkout process is not split into seperate files, but all stored in the main paypal_ipn.php file in catalog/includes/modules/payments I've used Kdiff to copy the changes across from the checkout_process.php file to the paypal_ipn.php file and am pretty confident I have it right, but it's made no difference at all (at least I haven't broken anything :)) I've uploaded the 2 files here paypal_ipn.php checkout_process.php and would really appreciate it if someone could take a quick look. I'm happy to make changes, report back and help sort out this QTpro /paypal_IPn problem cos it seems it's quite a common one thanks in advance, James Quote Link to comment Share on other sites More sharing options...
saubz Posted June 8, 2005 Share Posted June 8, 2005 Has anybody merged QTpro with Attributes Sets? I have OSc with Attributes Sets installed already and I was wondering if there are any issues with installation I should be aware of? Any help is much needed and appreciated. Quote Link to comment Share on other sites More sharing options...
saubz Posted June 8, 2005 Share Posted June 8, 2005 wow, nevermind. i used kdiff and this thing merged easily. and qtpro rocks! Quote Link to comment Share on other sites More sharing options...
tommy11011 Posted June 8, 2005 Share Posted June 8, 2005 wow, nevermind. i used kdiff and this thing merged easily. and qtpro rocks! <{POST_SNAPBACK}> what does attribute sets do? Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 9, 2005 Share Posted June 9, 2005 Thanks guys, I've done a fair bit of reading of this thread today and kind of understand where my problem lies and have tried to fix it, but without success :( I'm running Paypal IPN v 1.1.2.11 and in this version, it seems the checkout process is not split into seperate files, but all stored in the main paypal_ipn.php file in catalog/includes/modules/payments I've used Kdiff to copy the changes across from the checkout_process.php file to the paypal_ipn.php file and am pretty confident I have it right, but it's made no difference at all (at least I haven't broken anything :)) I've uploaded the 2 files here paypal_ipn.php checkout_process.php and would really appreciate it if someone could take a quick look. I'm happy to make changes, report back and help sort out this QTpro /paypal_IPn problem cos it seems it's quite a common one thanks in advance, James <{POST_SNAPBACK}> hey cant download any of these files. add these to a zip file and upload it again Quote Link to comment Share on other sites More sharing options...
sinryder Posted June 9, 2005 Share Posted June 9, 2005 Thanks guys, I've done a fair bit of reading of this thread today and kind of understand where my problem lies and have tried to fix it, but without success :( I'm running Paypal IPN v 1.1.2.11 and in this version, it seems the checkout process is not split into seperate files, but all stored in the main paypal_ipn.php file in catalog/includes/modules/payments I've used Kdiff to copy the changes across from the checkout_process.php file to the paypal_ipn.php file and am pretty confident I have it right, but it's made no difference at all (at least I haven't broken anything :)) I've uploaded the 2 files here paypal_ipn.php checkout_process.php and would really appreciate it if someone could take a quick look. I'm happy to make changes, report back and help sort out this QTpro /paypal_IPn problem cos it seems it's quite a common one thanks in advance, James <{POST_SNAPBACK}> hey cant download any of these files. add these to a zip file and upload it again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.