Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

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.

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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...

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.

Link to comment
Share on other sites

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&current_product_id=213&cPath=43

 

new_attributes.JPG

 

any help is greatly appreciated

 

thankyou

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

 

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.

Link to comment
Share on other sites

can i use the QTpro 4.2a with attribute features 1.7.1 and with the pizza_contrib ?

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.

Link to comment
Share on other sites

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

 

 

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.

Link to comment
Share on other sites

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.

 

got it thankx :P

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

 

 

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

hey cant download any of these files. add these to a zip file and upload it again

Link to comment
Share on other sites

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

 

hey cant download any of these files. add these to a zip file and upload it again

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...