Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

This post is regaurding earlier posts about the missing table. I am new myself to all of this .php but have caught on quickly.

 

Here is my error:

 

"1146 - Table 'vatikan_avenuedb.TABLE_PRODUCTS_STOCK' doesn't exist"

 

So lets say that I am supposed to "convert" my TABLE_PRODUCTS_STOCK to the right table name, where would I do this at? I have looked at includes/database_tables.php and have no idea what I'm supposed to be looking for. I see that a few have fixed this problem by changing the name of the table, or either changing the table name that is being requested. Any additional help would be greatly appreciated.

Link to comment
Share on other sites

This post is regaurding earlier posts about the missing table. I am new myself to all of this .php but have caught on quickly.

 

Here is my error:

 

"1146 - Table 'vatikan_avenuedb.TABLE_PRODUCTS_STOCK' doesn't exist"

 

So lets say that I am supposed to "convert" my TABLE_PRODUCTS_STOCK to the right table name, where would I do this at?  I have looked at includes/database_tables.php and have no idea what I'm supposed to be looking for. I see that a few have fixed this problem by changing the name of the table, or either changing the table name that is being requested. Any additional help would be greatly appreciated.

 

You should have these lines in *both* datebase_tables.php files (catalog/includes and catalog/admin/includes):

 

//++++ QT Pro: Begin Changed code
 define('TABLE_PRODUCTS_STOCK', 'products_stock');
//++++ QT Pro: End Changed Code

 

Ths defines the PHP constant TABLE_PRODUCTS_STOCK to be the correct mysql table name.

Link to comment
Share on other sites

ralph if you can tell me how to put the logging thing i ll do it

 

thankx

Sprinkle this about substituting some meaningful information about where in the code it is intead of "Made it here":

$time=date("d M Y H:i:s");
$logfile=fopen(DIR_FS_CATALOG . 'logfile.txt',"a");
fputs($logfile,$time . " - Made it here\n");
fclose($logfile);

This will write a log file with the name logfile.txt in the directory osCommerce is installed in. I'd start with putting it at the beginning of the updateProducts function in order.class.php, at the beginning (after the application_top require_once) of ipn.php and at the beginning of checkout_update.inc.php. If none of them produces any log entries then paypal isn't even posting status back indicating a probable configuration issue with paypal IPN. If ipn logs but the others don't you'll need to sprinkle more about in ipn to figure out why its not calling checkout_update.inc.php. If ipn and checkout_update.inc.php log but updateproducts doesn't then sprinkle more in checkout_update.inc.php. If all three log then sprinkle more in updateproducts.

Link to comment
Share on other sites

When orders are being made 2 pieces are being deducted from stock. Any ideas? I'm using 4.2 and PayPal IPN

Lucky you. The others here are having a hard time getting Paypal IPN to subtract any stock. :P

 

The only reason I can think that you are getting stock subtracted twice is if you copied the QT Pro stock subtract code into more than one place in the Paypal IPN code - perhaps both checkout_process_inc.php and order.class.php?

Link to comment
Share on other sites

Sprinkle this about substituting some meaningful information about where in the code it is intead of "Made it here":

$time=date("d M Y H:i:s");
$logfile=fopen(DIR_FS_CATALOG . 'logfile.txt',"a");
fputs($logfile,$time . " - Made it here\n");
fclose($logfile);

This will write a log file with the name logfile.txt in the directory osCommerce is installed in.  I'd start with putting it at the beginning of the updateProducts function in order.class.php, at the beginning (after the application_top require_once) of ipn.php and at the beginning of checkout_update.inc.php.  If none of them produces any log entries then paypal isn't even posting status back indicating a probable configuration issue with paypal IPN.  If ipn logs but the others don't you'll need to sprinkle more about in ipn to figure out why its not calling checkout_update.inc.php.  If ipn and checkout_update.inc.php log but updateproducts doesn't then sprinkle more in checkout_update.inc.php.  If all three log then sprinkle more in updateproducts.

 

hey budy i have followed your directions and successfully added the log code in 2 files

 

one in checkout_update_.inc.php ( test/includes/modules/payment/paypal/catalog/ )

and one in

order.class.php (test/includes/modules/payment/paypal/classes/osC/ )

 

3rd file ipn.php i have located it here test/includes/modules/payment/paypal/

but cant find ( after the application_top require_once) so i can put the code in it.

 

here are the 3 files, so you can see if i have placed the code right

download 3 files

 

i tried to place an order with paypal after the code was in the 2 files, but no log file was created in test directory. Also tried to create logfile.txt / uploaded it to test directory and then tried to buy something. still nothing was writted in that file.

 

thankx

Link to comment
Share on other sites

hey budy i have followed your directions and successfully added the log code in 2 files

 

one in checkout_update_.inc.php ( test/includes/modules/payment/paypal/catalog/ )

and one in

order.class.php (test/includes/modules/payment/paypal/classes/osC/ )

 

3rd file ipn.php i have located it here test/includes/modules/payment/paypal/

but cant find ( after the application_top require_once)  so i can put the code in it.

 

here are the 3 files, so you can see if i have placed the code right

download 3 files

 

i tried to place an order with paypal after the code was in the 2 files, but no log file was created in test directory. Also tried to create logfile.txt / uploaded it to test directory and then tried to buy something. still nothing was writted in that file.

 

thankx

 

The change to checkout_update.inc.php is fine. You need to move the logging lines below the "function updateProducts" line in order.class.php.

 

In the copy of Paypal IPN 3.1.5 that I have downloaded ipn.php is in catalog/ipn.php, not catalog/includes/modules/payment/paypal/ipn.php and is totally different than what you posted. Your ipn.php looks like an older version of the 3.1.5 file catalog/includes/modules/payment/paypal/classes/IPN/IPN.class.php. The logging code should go after the line:

  require_once('includes/modules/payment/paypal/application_top.inc.php');

in catalog/ipn.php

Link to comment
Share on other sites

The change to checkout_update.inc.php is fine.  You need to move the logging lines below the "function updateProducts" line in order.class.php.

 

In the copy of Paypal IPN 3.1.5 that I have downloaded ipn.php is in catalog/ipn.php, not catalog/includes/modules/payment/paypal/ipn.php and is totally different than what you posted.  Your ipn.php looks like an older version of the 3.1.5 file catalog/includes/modules/payment/paypal/classes/IPN/IPN.class.php.  The logging code should go after the line:

 ?require_once('includes/modules/payment/paypal/application_top.inc.php');

in catalog/ipn.php

 

hey budy it worked this time.

 

this is what i got in logfile.txt

 

12 Jun 2005 13:12:59 - Made it here

12 Jun 2005 13:13:00 - Made it here

12 Jun 2005 13:13:00 - Made it here

 

i hope it can help you some how :rolleyes:

Link to comment
Share on other sites

I have "show out-of-stock" attributes set to False. I also have sequential drop-down boxes. There are two styles of jeans: Light wash and Medium Wash. There only 4 sizes in the medium wash. Now, when the customer selects the first option "Medium Wash", shouldn't that prevent the sizes that aren't available from showing up in the next option "Size"? It still shows all sizes in both styles. Also, if you choose a size that is not available in the medium wash, it will NOT notify you. I have allow checkout = False, and "prevent adding out-of-stock to cart" = True.

Link to comment
Share on other sites

hey budy it worked this time.

 

this is what i got in logfile.txt

 

12 Jun 2005 13:12:59 - Made it here

12 Jun 2005 13:13:00 - Made it here

12 Jun 2005 13:13:00 - Made it here

 

i hope it can help you some how  :rolleyes:

As I said before you need to change "Made it here" to something that indicates where you put the code - e.g. "Start of ipn.php", "Start of checkout_process.inc.php", "Start of updateProducts in order.class.php" otherwise I can't tell if ipn.php was called 3 times without calling the others or if it was called once and properly called the others.

Link to comment
Share on other sites

I have "show out-of-stock" attributes set to False. I also have sequential drop-down boxes. There are two styles of jeans: Light wash and Medium Wash. There only 4 sizes in the medium wash. Now, when the customer selects the first option "Medium Wash", shouldn't that prevent the sizes that aren't available from showing up in the next option "Size"? It still shows all sizes in both styles. Also, if you choose a size that is not available in the medium wash, it will NOT notify you. I have allow checkout = False, and "prevent adding out-of-stock to cart" = True.

You understand it right. The first dropdown should initially have have something like "First select style" showing in it and when dropped down Light Wash and Medium Wash are available. The second dropdown should initially have something like "Then select size" showing in it and nothing else when dropped down. Once a style has been selected then the size dropdown will show the currently in-stock sizes for that style.

 

I want to verify you are actually getting sequenced dropdowns. Is "First select style" and "Then select size" showing up in the dropdowns?

Link to comment
Share on other sites

Is there anything I can do to help resolve this issue of paypal IPN and QTpro?

It's causing me a real headache as I have a live shop and am currently having to subtract stock manually....

thanks,

James

Look back a few posts to the logging code I posted for sinryder. If you'd like to add that to a test store and report your results it would help to narrow down where the problem is. You might even have a different problem than sinryder so waiting for his results might not fix your problem.

Link to comment
Share on other sites

Re: Correct location to place files.

 

So I?m pretty new to this but am catching on pretty fast.

I?ve read the Manual.html files to install QT Pro Version 4.2.

Trouble is the instructions says to ?Simply copy the contents of the QT Pro catalog folder to your store folder?

 

Exactly after the store name where should I place them? The I can find at least 3 locations in the English sections where folder "admin" exist?.

 

Can anyone clear this up for me?

 

Thank you in advanced for your time and counsel.

Link to comment
Share on other sites

Re: Correct location to place files.

 

So I?m pretty new to this but am catching on pretty fast.

I?ve read the Manual.html files to install QT Pro Version 4.2.

Trouble is the instructions says to ?Simply copy the contents of the QT Pro catalog folder to your store folder?

 

Exactly after the store name where should I place them? The I can find at least 3 locations in the English sections where folder "admin" exist?.

 

Can anyone clear this up for me?

 

Thank you in advanced for your time and counsel.

 

Everything in the QT Pro catalog folder and all of its subfolders should be copied into your osCommerce store folder retaining the folder structure. For example,

 

QTPro catalog/checkout_process.php should be copied to yourstore/checkout_process.php

 

QT Pro catalog/admin/stock.php should be copied to yourstore/admin/stock.php

 

In general, you should just be able to copy the QT Pro catalog folder in its entirety to your store folder and everything in it will copy correctly.

Link to comment
Share on other sites

As I said before you need to change "Made it here" to something that indicates where you put the code  - e.g. "Start of ipn.php", "Start of checkout_process.inc.php", "Start of updateProducts in order.class.php" otherwise I can't tell if ipn.php was called 3 times without calling the others or if it was called once and properly called the others.

 

 

hey budy sorry for the delay in reply, I was out of town thats why couldnt get back to you earlier.

i just made the changes you said and this is the new log

 

18 Jun 2005 13:57:58 - Start of ipn.php

18 Jun 2005 13:57:59 - Start of checkout_update.php

18 Jun 2005 13:57:59 - Start of order.class.php

 

 

in your last msg you said to add " start of checkout_process.inc.php"

but we never made any changes to this file? also didnt add any tracking code to it.

instead of checkout_process.inc.php we added the code in checkout_update.php

 

thankyou

Link to comment
Share on other sites

Hi guys!

I have a serious problem and I need your help. Since I installed qpro 4.2 i get an error in checkout_process around here:

 

//------insert customer choosen option eof ----
   $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
   $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
   $total_cost += $total_products_price;

   $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 }

 

During checkout just before the confirmation page I get a 'Parse error' on the last line above. If I remove that bracket then the order goes through. However, only order total information is saved (total price, freight, total tax etc) but no product information at all (such as name, price etc).

 

Please help me with this one!

Link to comment
Share on other sites

Hi guys!

I have a serious problem and I need your help. Since I installed qpro 4.2 i get an error in checkout_process around here:

 

//------insert customer choosen option eof ----
? ?$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
? ?$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
? ?$total_cost += $total_products_price;

? ?$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
?}

 

During checkout just before the confirmation page I get a 'Parse error' on the last line above. If I remove that bracket then the order goes through. However, only order total information is saved (total price, freight, total tax etc) but no product information at all (such as name, price etc).

 

Please help me with this one!

Go back over the QT Pro code changes and make sure you got them right. It sounds like you might have thrown in a extra } somewhere. Using a good 3-way compare program program like kdiff3 or Beyond Compare makes it easier to find things like this.

Link to comment
Share on other sites

hey budy sorry for the delay in reply, I was out of town thats why couldnt get back to you earlier.

i just made the changes you said and this is the new log

 

18 Jun 2005 13:57:58 - Start of ipn.php

18 Jun 2005 13:57:59 - Start of checkout_update.php

18 Jun 2005 13:57:59 - Start of order.class.php

in your last msg you said to add " start of checkout_process.inc.php"

but we never made any changes to this file? also didnt add any tracking code to it.

instead of checkout_process.inc.php we added the code in checkout_update.php

 

thankyou

Yep, that was right. Ok everything is getting called right. Use this version of order.class.php. I've added a bunch more logging to help track this down. Post your log file when you're done.

 

order.class.php with logging

Link to comment
Share on other sites

hey here is the new log

 

19 Jun 2005 15:14:24 - Start of ipn.php

19 Jun 2005 15:14:25 - Start of checkout_update.php

19 Jun 2005 15:14:25 - Start of updateProducts

19 Jun 2005 15:14:25 - Download not enabled 503

19 Jun 2005 15:14:25 - Has attributes

19 Jun 2005 15:14:25 - Attribute 0: 1-1, 0

19 Jun 2005 15:14:25 - Not all special 1-1

19 Jun 2005 15:14:25 - Found stock row 1-1 10

19 Jun 2005 15:14:25 - Attribute stock updated 1-1 9

19 Jun 2005 15:14:25 - Product stock calculated

19 Jun 2005 15:14:25 - Product stock updated

 

i hope it helps

 

thankx

Link to comment
Share on other sites

hey  here is the new log

i hope it helps

 

thankx

This looks like everything worked fine.

 

Product ID 503, Option id 1, Option value id 1 was purchased. 10 were in stock and one was bought. Stock was reduced to 9.

 

Is this the right product and option? How does this match with what you are seeing?

Link to comment
Share on other sites

This looks like everything worked fine.

 

Product ID 503, Option id 1, Option value id 1 was purchased.  10 were in stock and one was bought.  Stock was reduced to 9.

 

Is this the right product and option?  How does this match with what you are seeing?

 

 

OH WOW , it did work :)

 

thankyou soooooooooooooooooo much

 

so should i take the log code out now ? or still needs it.

Just noticed that when i try to delete an item and check the restock option its not restocking, but it really doesnt matter the main problem is solved :thumbsup:

 

thankx again buddy

Link to comment
Share on other sites

OH WOW , it did work :)

 

thankyou soooooooooooooooooo much

 

so should i take the log code out now ? or still needs it.

Just noticed that when i try to delete an item and check the restock option its not restocking, but it really doesnt matter the main problem is solved  :thumbsup:

 

thankx again buddy

Strange, I made no code changes other than adding the logging to what you posted earlier. You can rip the logging back out, it shouldn't need it.

 

Delete with restock is fixed in QT Pro 4. Only for orders created with QT Pro 4 as it needs to stash a few things in the order tables. Since you're still using 3.x it won't work.

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.
Note: Your post will require moderator approval before it will be visible.

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