Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

Anyone that can point me in the right direction for how to call for the quantity of an antribute. I want to show the stock level of each antribute on the product_info page, and on top of that I am trying to integrate QTpro with the Product Quantity Dropdown contribution.

 

This contribution is calling for the total product quantity at the moment. So the following is what I am trying to change:

 

echo "<select size=\"1\" name=\"quantity\">";

for ($i=1; $i <= $product_info['products_quantity'] - $product_info['products_ordered']; $i++)

 

Thanx :thumbsup:

 

ps. I will post it in the contribution if I get it done, because I can see from this forum that there are a lot of people asking for this posibility

Link to comment
Share on other sites

I have installed QTPro, and all seems to be working, but all it does is offer the customer options when looking at the product detail. If they go to buy the item, it seems to revert to the old stock system. There are no size options offered after the customer hits the 'add to basket' button. It behaves as it did before QTPro was installed.

 

A lot of us is running into this problem, and no wonder. It seems to be a proplem with the pad_single_dropdown.php and pad_single_radioset.php files in catelog/includes/classes, because the contribution works fine with either the mutiple_dropdown or the sequenced_dropdown chosen in the admin panel, but not with the two others chosen.

 

Unfortunately I am not a good enough php programmer to fix this proplem, but I hope that some will

Link to comment
Share on other sites

I am having a bad issue with this and I hope that someone can help. This is all I need to finish the cart and I can move on. I will PayPal anyone who helps me solve this $20.

 

After installing it, I am getting the following error when I go into product_info.php

 

Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php) [function.main]: failed to open stream: No such file or directory in /home/shirleya/public_html/catalog/product_info.php on line 165

 

From what I read this could be a problem with the pad_file but I don't know where to start.

 

The line of code in question is the following:

require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

 

from product_info.php

 

//++++ QT Pro: Begin Changed code

$products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);

require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

$class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;

$pad = new $class($products_id);

echo $pad->draw();

//++++ QT Pro: End Changed Code

Link to comment
Share on other sites

Hello,

 

perhaps it is a silly question, but i want to know if someone has experienced the same problem:

On my testing server this contribution works fine, in my live environment it fails. It means, the stock remains always the same after a order. furthermore the total amount of a product isn't the sum of the attributes.

The only difference between the two is the well known "magic_quotes_gbc" tuned off at the live-server and turned on at the testing server...

 

As it is not the best idea to switch Magic-quotes_gbc "on" (what is possible) , i prefer to change the code to work with Magic_quotes off...

 

Has anybody experienced the same problem an has anybody perhaps solved the problem...

 

Thanks for your comments and advices

 

P.S. please excuse my poor english - i'm german and my school days are long long ago.....

 

Otternase

Link to comment
Share on other sites

I am having a bad issue with this and I hope that someone can help. This is all I need to finish the cart and I can move on. I will PayPal anyone who helps me solve this $20.

 

After installing it, I am getting the following error when I go into product_info.php

 

Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php) [function.main]: failed to open stream: No such file or directory in /home/shirleya/public_html/catalog/product_info.php on line 165

 

From what I read this could be a problem with the pad_file but I don't know where to start.

 

The line of code in question is the following:

require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

 

from product_info.php

 

//++++ QT Pro: Begin Changed code

$products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);

require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

$class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;

$pad = new $class($products_id);

echo $pad->draw();

//++++ QT Pro: End Changed Code

 

Bump for night and also to say that I am using the single drop down with nothing special.

Link to comment
Share on other sites

Bump for night and also to say that I am using the single drop down with nothing special.

 

I resolved my issue and, stupidly, it stemmed from my overlooking the config.sql file.

 

I feel like an ass, but hopefully this will help someone in the future.

Link to comment
Share on other sites

Have just finnished installing this.

 

two issues I am having at the moment (that I know of as I havent fully tested it)

 

Issue one

I now appear to have two available options menu on my prouct info page, It has the one QTPro installed and the default Osc one.

its the Osc one that is controlling the options too. IE, Doesnt matter what I set the QTPro one too it uses what ever the Osc one is set at.

 

 

Issue 2

It doesnt disply the options in and alph and or numerical order. IE

1

2

3

4

5

Or

A

B

C

D

E

 

How can I resolve these tw issues please?

 

Regards

Shaun

Edited by Get-Wireless 2
Link to comment
Share on other sites

Have just finnished installing this.

 

two issues I am having at the moment (that I know of as I havent fully tested it)

 

Issue one

I now appear to have two available options menu on my prouct info page, It has the one QTPro installed and the default Osc one.

its the Osc one that is controlling the options too. IE, Doesnt matter what I set the QTPro one too it uses what ever the Osc one is set at.

Issue 2

It doesnt disply the options in and alph and or numerical order. IE

1

2

3

4

5

Or

A

B

C

D

E

 

How can I resolve these tw issues please?

 

Regards

Shaun

 

 

there's a contribution that solves this issue, but sorting the itens by id. it works great. you could just add your attributes in alphabetical order.

go to qtpro page: http://addons.oscommerce.com/info/888. then choose this fix: Products Attribute Sorting Fix for QT Pro v.4 *CORRECTED*.

 

 

I want to know if someone has solved the single_dropdown issue. I just need this to finish the stock thing.

Link to comment
Share on other sites

Are there any Payment modules that actually work with QT Pro? I have read post after post on the internet about stock not automatically updating after checkout in the QT Pro stock section and none of these posts have answers.

 

Now I am having the same problem with Paypal IPN and QT Pro. The actual TOTAL stock of the item (that is set in the edit product part of the Admin section) does update after someone checks out but not the QT Pro stock section for the attribute.

 

If anyone has gotten this to work, please just tell me that it can actually work with Paypal IPN or if there is a place that explains how to make it work together. If I at least know it's possible, I'll spend more time trying.

 

Or if you have found another payment module that works with it, please let me know.

Edited by pixa
Link to comment
Share on other sites

Are there any Payment modules that actually work with QT Pro? I have read post after post on the internet about stock not automatically updating after checkout in the QT Pro stock section and none of these posts have answers.

 

Now I am having the same problem with Paypal IPN and QT Pro. The actual TOTAL stock of the item (that is set in the edit product part of the Admin section) does update after someone checks out but not the QT Pro stock section for the attribute.

 

If anyone has gotten this to work, please just tell me that it can actually work with Paypal IPN or if there is a place that explains how to make it work together. If I at least know it's possible, I'll spend more time trying.

 

Or if you have found another payment module that works with it, please let me know.

 

Hi Pixa,

 

I have been using Googlecheckout and QTPro and have got them to work together correctly. Stock is minused from the correct attribute. I used instructions from the Paypal Ipn contribution located at http://addons.oscommerce.com/info/2679

 

The instructions are in v1.3

 

However I have just installed Paypal Ipn v2.3.3 onto my test store and the code has changed signifcantly and unfortunatley there doesn't seem to be instructions on how to integrate QTPro with the versions past v2.

 

If anyone can help integrate QTPro on paypal ipn past v2 it would be very very useful.

 

Thanks

Link to comment
Share on other sites

Hi Pixa,

 

I have been using Googlecheckout and QTPro and have got them to work together correctly. Stock is minused from the correct attribute. I used instructions from the Paypal Ipn contribution located at http://addons.oscommerce.com/info/2679

 

The instructions are in v1.3

 

However I have just installed Paypal Ipn v2.3.3 onto my test store and the code has changed signifcantly and unfortunatley there doesn't seem to be instructions on how to integrate QTPro with the versions past v2.

 

If anyone can help integrate QTPro on paypal ipn past v2 it would be very very useful.

 

Thanks

 

Are you a UK or US based store?

Link to comment
Share on other sites

There are only 2 files added in <admin/includes/filenames.php> and the relevant lines are:

 

define ('FILENAME_STATS_LOW_STOCK_ATTRIB', 'stats_low_stock_attrib.php');
define ('FILENAME_STOCK', 'stock.php');

 

and in <admin/includes/languages/english.php> the is the line:

 

define('BOX_REPORTS_STATS_LOW_STOCK_ATTRIB', 'Stock Report');

 

I can find "BOX_REPORTS_STOCK_LEVEL" anywhere, so I suspect that line must be from another contribution.........

 

This is perplexing me too! And where does the stock button come in haha

 

this is how im looking at it minus the messed up Stock Report i fixed

reporterror.jpg

Edited by tecno
Link to comment
Share on other sites

  • 2 weeks later...

Hello, I have just installed a fresh copy of OSC 2.2 rc1 and the only add on I have so far is QTpro 4.3

 

When I click the 'stock' button for a product it brings me to the stock page and when I click the 'edit' button on that page it give me this error:

 

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/stylec5/public_html/catalog/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/stylec5/public_html/catalog/admin/includes/classes/object_info.php on line 18

 

Also, it seems that many of the qtpro menu options that are supposed to appear on the left hand side of the admin panel in osc, do not exist. Any Ideas? Thanks

Link to comment
Share on other sites

I am having some issues with the installation, I looked for a resolution to no avail.

 

First is this:

 

The edit button in the stock report/ products stock is linking to this : https://www.#####.com/ecommerce/admin/categ...ion=new_product rather than the current product. So it doesnt actually take me to the current product to edit.

 

Of course when I do click the edit button I am taken to the admin/categories.php page for a new product and I have these errors at the top of the page:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/###/public_html/ecommerce/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/###/public_html/ecommerce/admin/includes/classes/object_info.php on line 18

 

I also do not see that it is calculating stock correctly during checkout. If I have 3 size sm shirts in stock and put 4 size small shirts in my cart it will still allow me to checkout without any warnings whatsoever. I need to be able to limit the purchases to only the stock available. I do have check stock level: true, subtract stock: true, and allow checkout: false.

 

Can anyone tell me if I missed the resolution to these problems here in the forum or if you may know the resolution? I just cant see what I missed.

 

 

Also in response to "thebigyeti":

 

 

You probably have register globals turned off. Go to catalog/admin/stock.php and put this at the top, right below "require('includes/application_top.php');" :

 

link_get_variable('product_id');

 

That fixed it for me.

Edited by giz286sim
Link to comment
Share on other sites

Hi, I just got done installing the contribution and am psyched to get it working! I'm not getting any errors but I'm having one problem when trying to fallow this part of the directions:

 

Click that new button and you will get the stock page where you can enter or update the stock quantities for the product attributes combinations. To enter stock for a combination select the attribute values from the dropdowns, enter the quantity and click add. There aren't edit buttons next to existing combinations. To update the values for existing combinations just "add" them again as if they weren't there. The quantity you enter will replace the existing quantity.

 

On the stock.php page there is an option to adjust the quantity for the original product, but there is not option to adjust the quantity of individual attributes. I read where it says There aren't edit buttons next to existing combinations", so i've tried to delete existing attributes and re-add them to no avail.

 

I am nowhere near good enough to troubleshoot this on my own, I'm not sure which page to start debugging on since the error seems to be happening in stock.php and I copied that folder strait over.

 

Please any direction at all would be greatly appreciated!

Link to comment
Share on other sites

Ok... I think I figured it out kind of...

 

I need to set up attribute display plugins, the instructions say to do this I need to go to admin/configuration/product information. The problem I'm having is there is no product information in admin/configuration in my admin... I'm so confused....

 

 

Please, any help, I've been stressed over this for 4 days now...

Link to comment
Share on other sites

Sorry... I'm such a pain. I didn't notice the config.sql file. I'm slowly getting the hang of this.. I think...

 

 

However, after rechecking all the code to my code in the contribution I am still not able to alter individual attribute quantities. ARgh

 

Also after getting the config.sql file put in when I try to configure the plugin in product information to single_radioset or single_dropdown I get this error:

Warning: Invalid argument supplied for foreach() in catalog/includes/classes/pad_base.php on line 388

 

This is code that I just transfered over with no changes, so Im not sure what to do, if it helps here is line 385 - 409 (approx where the problem is...):

 

function _build_attributes_combinations($attributes, $showoos, $markoos, &$combinations, &$selected_combination, $oidindex=0, $comb=array(), $id="", $text='', $isselected=true) {
  global $cart;

  foreach ($attributes[$oidindex]['ovals'] as $attrib) {
	$newcomb = $comb;
	$newcomb[$attributes[$oidindex]['oid']] = $attrib['id'];
	$newid=$id.','.$attributes[$oidindex]['oid'].'-'.$attrib['id'];
	$newtext = $text.", ".$attrib['text'];
	if (isset($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']]))
	  $newisselected = ($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']] == $attrib['id']) ? $isselected : false;
	else 
	  $newisselected = false;
	if (isset($attributes[$oidindex+1])) {
	  $this->_build_attributes_combinations($attributes, $showoos, $markoos, $combinations, $selected_combination, $oidindex+1, $newcomb, $newid, $newtext, $newisselected);
	}
	else {
	  $is_out_of_stock=tep_check_stock(tep_get_prid($this->products_id),1,$newcomb);
	  if (!$is_out_of_stock | ($showoos == true)) {
		switch ($markoos) {
		  case 'Left':   $newtext=($is_out_of_stock ? TEXT_OUT_OF_STOCK.' - ' : '').substr($newtext,2);
						 break;
		  case 'Right':  $newtext=substr($newtext,2).($is_out_of_stock ? ' - '.TEXT_OUT_OF_STOCK : '');
						 break;
		  default:	   $newtext=substr($newtext,2);
						 break;
		}

 

 

 

 

Any ideas?

Edited by pulp2
Link to comment
Share on other sites

Crap, that edit button goes away quickly...

 

 

I also wanted to mention there are two identical "available options" drop down lists displaying... I'm guessing this has something to do with the problem? Not sure if this helps...

Edited by pulp2
Link to comment
Share on other sites

Ahh, thanks for the exact circumstances. I have reproduced the problem and its a simple fix. Both pad_single_dropdown.php and pad_single_radioset.php have a line:

	  $out.=$this->_draw_out_of_stock_message_js($attributes);

in them. Move that line up above the closing brace (}) right before it in both files.

 

 

I just found ralphday's fix for the error message, worked great thanks ralphday!

 

Only two problems left to go, no option to add quantity to individual attributes, and two "available options" drop down fields showing up.

Link to comment
Share on other sites

I got one of the two available options to go away by taking away these lines of code in product_info.php:

<table border="0" cellspacing="0" cellpadding="2">
		<tr>
		  <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
		</tr>

 

 

and:

 

<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
		</tr>

 

I then selected an attribute "blue" from the remaining drop down which seems to pull from QTpro; and went to checkout, unfortunately in the final order it didn't show the attribute "blue" just the product.

 

It seems as though QT pro is pulling from the database but not inserting the values for the order in... I'm not good enough in PHP to figure this one out, if you can't tell I'm a total Newb.

 

Any direction appreciated!

 

P.S.

Should I post the code for productinfo.php?

Edited by pulp2
Link to comment
Share on other sites

I installed QT Pro v4.3 for OSC v2.2 RC1.

 

When I click on stock reports in admin i get the following error

Stock Report Friday 04 January, 2008

1146 - Table 'wilde5_jan0408.products_stock' doesn't exist

 

SELECT products_stock_attributes, products_stock_quantity FROM products_stock WHERE products_id=149 ORDER BY products_stock_attributes

 

[TEP STOP]

 

Also, under my stock reports in admin I have BOX_REPORTS_STOCK_LEVEL

 

when clicked on I get

 

"Not Found

 

The requested URL /catalog/admin/FILENAME_STATS_LOW_STOCK was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

 

 

is this because I already added all the products before adding this mod? If this is the case how can i add this to my setup without a clean install? I spent so much time adding all the products, is there any way i can do this?

Link to comment
Share on other sites

Hi People,

 

Thanks for this great contrib, all who contributed! I'm thinking of writing two extensions to this contrib, but could use some help (if available?). Here's the story:

 

Had no problem installing this contrib on a stock OSC2.2rc1 install (for testing purposes), and played around with it a little bit. Next I dug into the code to figure out two things:

 

-. The option to also display a message when an item+options+values is in stock (instead of only displaying a message saying that it is out of stock). My best guess is that I'd have to add a function in the pad_* classes similar to the "function _draw_out_of_stock_message_js" (but most likely a lot less code than that function). I do my best to figure out some PHP stuff (not realy a programmers background...) but this class writing is way above my head :huh: Can some-one give me some pointers?

 

-. The other is to display an expected delivery time, based on a products' manufacturer (not-yet-existing)attribute, to be displayed in the TEXT_OUT_OF_STOCK_MESSAGE. I think this one might be easier, altough it would require a db update for the manufacturers table (as I figured it out now in theory that is). What I'm thinking of here, is to add a column that will hold the expected delivery time for that specific products' manufacturer, and call it from the TEXT_OUT_OF_STOCK_MESSAGE= in the /catalog/includes/languages/<language>/product_info.php file. I think I'll be able to manage this myself, but if anyone has already tried this and possibly came across some problems with this, I'd be interested to know ofcourse :rolleyes:

 

Thanks again for this contribution, and hopefully some-one can help me with these two extensions!

Edited by Gaarheid
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...