Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

ralph,

thanks for your answer.

 

the lines you mean where:

 

...

 

i changed all. still no running...

Ahh yes. I was on the right track. Keep those changes - that's a piece of the puzzle. Now, when there are no attributes for a product you never set values for $lc_text_option1 and $lc_text_option2 so they retain the values from the previous product. Try adding this:

 

  $lc_text_option1 = '';
 $lc_text_option2 = '';

 

right before:

 

  if ($products_attributes['total'] > 0) {

 

BTW, very nice site. :) It really shows how much the look of a site can be changed. So many osCommerce sites look very much like the default osCommerce site even with a lot of different graphics. Your site surprised me with how much nicer it looks.

Link to comment
Share on other sites

ralph,

thanks for your answer.

 

the lines you mean where:

 

...

 

i changed all. still no running...

Ahh yes. I was on the right track. Keep those changes - that's a piece of the puzzle. Now, when there are no attributes for a product you never set values for $lc_text_option1 and $lc_text_option2 so they retain the values from the previous product. Try adding this:

 

  $lc_text_option1 = '';
 $lc_text_option2 = '';

 

right before:

 

  if ($products_attributes['total'] > 0) {

 

BTW, very nice site. :) It really shows how much the look of a site can be changed. So many osCommerce sites look very much like the default osCommerce site even with a lot of different graphics. Your site surprised me with how much nicer it looks.

Link to comment
Share on other sites

I am having a problem with QTpro. :blush:

 

INSTALL

- I have installed version 4.

- I have merged files BUT none of the admin files.

- All admin files have been copied directly from the contribution to the admin directory.

 

SETUP

- I have all attributes set to Track Stock? YES.

- I have added new products and added many attributes.

 

PROBLEM

- When I click stock button from catagories.php I get no attributes.

- I only see product quantity, which does not seem to update the stock quantity.

The product_stock table is empty.

 

CONFIG

Product Info Attribute Display Plugin multiple_dropdowns

Show Out of Stock Attributes True

Mark Out of Stock Attributes Right

Display Out of Stock Message Line True

Prevent Adding Out of Stock to Cart True

 

I Hope someone has an idea of what the probem maybe B) and is willing to share it with me.

 

Any suggestions...

 

Many thanks, Gareth.

Link to comment
Share on other sites

I am having a problem with QTpro. :blush:

 

INSTALL

- I have installed version 4.

- I have merged files BUT none of the admin files.

- All admin files have been copied directly from the contribution to the admin directory.

 

SETUP

- I have all attributes set to  Track Stock?  YES.

- I have added new products and added many attributes.

 

PROBLEM

- When I click stock button from catagories.php I get no attributes.

- I only see product quantity, which does not seem to update the stock quantity.

The product_stock table is empty.

 

CONFIG

Product Info Attribute Display Plugin multiple_dropdowns 

Show Out of Stock Attributes True 

Mark Out of Stock Attributes Right 

Display Out of Stock Message Line True 

Prevent Adding Out of Stock to Cart True 

 

I Hope someone has an idea of what the probem maybe  B)  and is willing to share it with me.

 

Any suggestions...

 

Many thanks, Gareth.

Hmmmm... Strange. I don't see too much that would cause this behavior. Two possibilities come to mind looking at the code. The first would be if you are using a version of PHP earlier than 4.1.0. The second would be if the options were added with one language and you are set to another language when going into the stock page. If the first is the case then you need to change $_SERVER to $HTTP_SERVER_VARS and add the global for it.

 

I neither is the case, I'm puzzled. Try cutting and pasting the big nasty query starting on line 100 into phpmyadmin, plug in the proper product id and language id and see if it returns anything. Or pop an echo into the code before it to spit out $VARS['product_id'] and $languages_id and one after it to spit out the number of rows returned. If its returning rows then it should be working. If its not returning rows and the product id and language id look ok then attributes aren't properly set up.

Link to comment
Share on other sites

Hmmmm... Strange.? I don't see too much that would cause this behavior.? Two possibilities come to mind looking at the code.? The first would be if you are using a version of PHP earlier than 4.1.0.? The second would be if the options were added with one language and you are set to another language when going into the stock page.? If the first is the case then you need to change $_SERVER to $HTTP_SERVER_VARS and add the global for it.

 

I neither is the case, I'm puzzled.? Try cutting and pasting the big nasty query starting on line 100 into phpmyadmin, plug in the proper product id and language id and see if it returns anything.? Or pop an echo into the code before it to spit out $VARS['product_id'] and $languages_id and one after it to spit out the number of rows returned.? If its returning rows then it should be working.? If its not returning rows and the product id and language id look ok then attributes aren't properly set up.

 

Thanks for the help :)

 

my PHP Version is 4.0.6 (well my hosting comp. >_< ) .... So it looks like thats the problem. I have already made some changes because of this. I removed , &$ and replaced with $ in the padbase and dropdown files because of a php related errors!.

 

I have not used different language ids and I am sure attributes are correct; I even check it in phpmyadmin.

 

Any further help would be much appreciated making my code php4.06 friendly.

Edited by WS Evolution
Link to comment
Share on other sites

I have installed Qtpro 2.1 update and it is working fine,

 

I then upgraded to qtpro 3 but had problems with the temporary tables.

 

Today i tried qtpro 4.0_1_2_1,

 

When i view a product I get this error message as well as everything else that should be there.

 

 

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_multiple_dropdowns.php on line 119

 

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_multiple_dropdowns.php on line 119

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 119

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 120

 

 

If anyone could help it would be greatly appreciated

Link to comment
Share on other sites

Thanks for the help :)

 

my PHP Version is 4.0.6 (well my hosting comp.  >_< ) .... So it looks like thats the problem. I have already made some changes because of this. I removed , &$ and replaced with $ in the padbase and dropdown files because of a php related errors!.

 

I have not used different language ids and I am sure attributes are correct; I even check it in phpmyadmin.

 

Any further help would be much appreciated making my code php4.06 friendly.

 

Yeah, I slipped and put the &'s on the method calls as well as the method definition. :-" Most PHP installs let you get away with it. Sometimes PHP is just too forgiving. Just don't remove the & from the method definition or things won't work right.

 

I'm not aware of any other older PHP version incompatibilities. But then again I didn't realize this one was there until I was looking for your problem. I did do a search for other instances of $_SERVER and I didn't introuduce any others but there is one in catalog/includes/functions/general.php inherited from the base osCommerce MS2 code.

 

HTH - Ralph

Link to comment
Share on other sites

I have installed Qtpro 2.1 update and it is working fine,

 

I then upgraded to qtpro 3 but had problems with the temporary tables.

 

Today i tried qtpro 4.0_1_2_1,

 

When i view a product I get this error message as well as everything else that should be there.

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_multiple_dropdowns.php on line 119

 

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_multiple_dropdowns.php on line 119

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 119

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 120

If anyone could help it would be greatly appreciated

This sounds like two problems:

 

1) There is a problem in the plugins that cause the call-time pass by reference error in some PHP installations. To fix this edit catalog/includes/classes/pad_multiple_dropdowns, pad_sequenced_dropdowns, pad_single_dropdown and pad_single_radioset. Change all instances of "&$" to "$". *Don't* do this in pad_base or you will break things.

 

2) The couldn't find constant error sounds like you didn't run config.sql to insert the default configuration values.

Link to comment
Share on other sites

Thanks for the help, you were spot on with replacing the "&$" with "$".

 

Unfortunately I still get the error message

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 119

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 120

 

 

and i have run the config.sql again, still no luck.

Link to comment
Share on other sites

Thanks for the help, you were spot on with replacing the "&$" with "$".

 

Unfortunately I still get the error message

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 119

 

Warning: constant(): Couldn't find constant PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK in C:\Program Files\Apache Group\Apache2\htdocs\qtpro4\catalog\includes\classes\pad_base.php on line 120

and i have run the config.sql again, still no luck.

 

Perhaps your config.sql is failing for some reason or somehow the two lines that add those values are missing. Those two values get added by the last two lines of config.sql. Based on the lack of other errors the lines above those in config.sql seemed to have worked. Check the configuration table to verify that rows exist with configuration_key values of PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE and PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK. If they are not there you had a problem with the config.sql. You can add the rows in phpmyadmin with:

 

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Display Out of Stock Message Line', 'PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE', 'True', 'Controls the display of a message line indicating an out of stock attributes is selected.', 888001, 30, now(), NULL, 'tep_cfg_select_option(array(\'True\', \'False\'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Prevent Adding Out of Stock to Cart', 'PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK', 'True', 'Prevents adding an out of stock attribute combination to the cart.', 888001, 40, now(), NULL, 'tep_cfg_select_option(array(\'True\', \'False\'),');

Link to comment
Share on other sites

Perhaps your config.sql is failing for some reason or somehow the two lines that add those values are missing.  Those two values get added by the last two lines of config.sql.  Based on the lack of other errors the lines above those in config.sql seemed to have worked.  Check the configuration table to verify that rows exist with configuration_key values of PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE and PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK.  If they are not there you had a problem with the config.sql.  You can add the rows in phpmyadmin with:

 

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Display Out of Stock Message Line', 'PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE', 'True', 'Controls the display of a message line indicating an out of stock attributes is selected.', 888001, 30, now(), NULL, 'tep_cfg_select_option(array(\'True\', \'False\'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Prevent Adding Out of Stock to Cart', 'PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK', 'True', 'Prevents adding an out of stock attribute combination to the cart.', 888001, 40, now(), NULL, 'tep_cfg_select_option(array(\'True\', \'False\'),');

 

 

Ok I tried running the two lines of mysql that you kindly provided and i got four error messages all saying

"Error:

Unkown command '\''.

Link to comment
Share on other sites

Ok I tried running the two lines of mysql that you kindly provided and i got four error messages all saying

"Error:

Unkown command '\''.

Hmmm.. I just cut and pasted them into phpmyadmin and they work fine. I'm pretty puzzled. The only thing I can think of to try is changing the \' in the lines to \\'' and see if that works. Or you could try adding the rows usig the mysql insert tab. If those don't work maybe someone who's more experienced with mysql can help.

Link to comment
Share on other sites

hello ralph,

i just came at home from a two day berlin trip. here in germany it is 1 am. i found your answer concerning my problem.

i was too blind to see it. i thank you so much for your help!

i changed the code and now it works wonderfull.

thank you also for your nice compliment.

i spend 4 months at realizing this shop. as you could see my php skills are limited but i tried the best to make this thing work in the look i wanted to.

your little contrib is an important brick in this.

 

i hope i can give back some help sometime

 

with greetings from germany

Link to comment
Share on other sites

Yeah, I slipped and put the &'s on the method calls as well as the method definition.  :-"  Most PHP installs let you get away with it.  Sometimes PHP is just too forgiving.  Just don't remove the & from the method definition or things won't work right.

 

I'm not aware of any other older PHP version incompatibilities.  But then again I didn't realize this one was there until I was looking for your problem.  I did do a search for other instances of $_SERVER and I didn't introuduce any others but there is one in catalog/includes/functions/general.php inherited from the base osCommerce MS2 code.

 

HTH - Ralph

 

The top of stock.php for older php versions should be:

 

  require('includes/application_top.php');

 if ($HTTP_SERVER_VARS['REQUEST_METHOD']=="GET") {
   $VARS=$HTTP_GET_VARS;
 } else {

 

Thats sorted it for me :D

 

Thanks Ralph :thumbsup:

Link to comment
Share on other sites

I have tried again today to install version 4.0_1_2_1

 

I'm 99% sure that I've got the config.sql working

 

But now I've got two new error messages which say

 

Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\qtpro6\catalog\product_info.php on line 162

 

Fatal error: main(): Failed opening required 'includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php' (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\qtpro6\catalog\product_info.php on line 162

 

Can anyone offer any ideas?

 

Thanks

Link to comment
Share on other sites

I have tried again today to install version 4.0_1_2_1

 

I'm 99% sure that I've got the config.sql working

 

But now I've got two new error messages which say

 

Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\qtpro6\catalog\product_info.php on line 162

 

Fatal error: main(): Failed opening required 'includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php' (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\qtpro6\catalog\product_info.php on line 162

 

Can anyone offer any ideas?

 

Thanks

This looks like another config.sql problem. Now the PRODINFO_ATTRIBUTE_PLUGIN isn't getting inserted into the configuration table.

Link to comment
Share on other sites

Hi all,

Im kind of a newbie to all of this, and im having trouble figuring out how to install QTP. This thread seems like a foreign language to me, is there any way to just get this option pre-installed onto a copy of osCommerce? Im just starting my store and i really need this. Any help would be appreciated.

Link to comment
Share on other sites

  • 2 weeks later...
Hi all,

Im kind of a newbie to all of this, and im having trouble figuring out how to install QTP. This thread seems like a foreign language to me, is there any way to just get this option pre-installed onto a copy of osCommerce?  Im just starting my store and i really need this. Any help would be appreciated.

 

You could pay someone to do it for you. *cough*

Link to comment
Share on other sites

why bother replying mjm?

 

dragonskiz: dont be scared, just install a new copy of oscommerce in your local computer and follow the instructions, its not very hard. really. try and let us know how you get on.

 

j

Link to comment
Share on other sites

This may have already been covered, but is there a way to, using QT Pro, add the products attributes/options to the product listing and search results module so that product option selections can be made on those pages? It would be great if there is. Thanks!

 

-Aaron

Link to comment
Share on other sites

I just installed this, which took me a little bit and Come to find out i missed two lines of code! LOL

Thanks for Contr.

 

Anyway...I was using quanity display, which tells how many is in stock.

 

How do i show available quantity?

Like if i have one product, with 4 different variations of it. Would like to show how many of each are in stock.

 

A fix would be good, some code, or even some hints, lol.

 

thanks

mike

Link to comment
Share on other sites

I just installed this, which took me a little bit and  Come to find out i missed two lines of code!  LOL

Thanks for Contr.

 

Anyway...I was using quanity display, which tells how many is in stock.

 

How do i show  available quantity?

Like if i have one product, with 4 different variations of it.  Would like to show how many of each are in stock.

 

A fix would be good, some code, or even some hints, lol.

 

thanks

mike

 

Its pretty easy if you're using the single dropdown or single radioset plugins. You'll need to dig into the _build_attributes_combinations method in pad_base. Where it checks stock you can add a call to tep_get_products_stock. Then you can add it to the attribute combination text (like the out of stock message is added).

 

If you're using multiple dropdowns or sequenced dropdowns you'll need to stash the quantity in the $combinations array instead of adding it to the text. Then in the _draw_js_stock_array method in pad_base you'll need to pull the quantity out of $combinations and use it as the value in the array instead of "1". In pad_multiple_dropdowns method _draw_out_of_stock_message_js you'll need to change the chkstk function to return the quantity and the stkmsg function to display it. If you use sequenced dropdowns you'll still need to make the change to pad_multiple_dropdowns but also change pad_sequenced_dropdowns method _draw_stocked_attributes to add an onchange to the last option to call stkmsg to display the quantity when the last option is selected.

 

I'm pretty sure that will all work. Hope it helps.

Link to comment
Share on other sites

This may have already been covered, but is there a way to, using QT Pro, add the products attributes/options to the product listing and search results module so that product option selections can be made on those pages? It would be great if there is. Thanks!

 

-Aaron

gomtuu did this for his store, merging in the List Attributes contrib. Its probably custom to his store and not all functions will work but you might PM him to see if he'll send you the code to give you a leg up.

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