Jump to content
zonetown

[Contribution] QTpro - Quantity Tracking Professional

Recommended Posts

Hi guys!

I need some urgent help with this mod. I am not a php expert so bear with me please.

 

The urgent problem I am having right now is that I installed in on an existing store and now all of the products show "Out of Stock"

 

I need to be able to make it so all items show in-stock (like before) UNLESS I add stocking via the MOD. I also noticed that once I add stock of a particular attribute combination it is then not editable. What is the deal with that?

 

Please if any one can help asap that would be really great.

 

Thanks,

Jesse

Share this post


Link to post
Share on other sites

OK for a temporary fix I found that I can change all the attributes to be "special" in the Product attributes page. So now everything is available again. Whew :(

 

Now can someone help me with this when they get a chance. Here are my 2 main issues I see so far:

 

1. I need to be able to enable inventory (or basic inventory) on a per item basis.. is this possible?

 

2. How do you "edit" the inventory once it's put in there? This is for a retail/ online store where they sometimes sell the products in the store and need to remove them from inventory.

 

 

I though of one more thing.. is there a way that items that attribute selections that are out of stock just disapear? Opposed to saying "out of stock"?

 

Thanks for all your help in advance. :D

 

-Jesse :thumbsup:

Share this post


Link to post
Share on other sites
1. I need to be able to enable inventory (or basic inventory) on a per item basis.. is this possible?

 

hey do you mean you wana set the quantity for the attributes ? like per size or per color ?? if you only need to set the inventory for each product but you dont have any attribute options set for it , then simply go to admin>catalog>category/product

select a product and click the edit tab and you will see the option of Products Quantity.

if you are using the attribues and you wana set the quantity for like different sizes or colors click the "stock" tab it should be close to the "Edit" tab and set the quantity for each option.

 

 

2. How do you "edit" the inventory once it's put in there? This is for a retail/ online store where they sometimes sell the products in the store and need to remove them from inventory.

do the same as above and change set the number to what ever inventory you are left with

 

I though of one more thing.. is there a way that items that attribute selections that are out of stock just disapear? Opposed to saying "out of stock"?

 

i guess you can just delete that attribute for that product and the out of stock wont show

like if you are selling shirts

and you have 3 options set

small

medium

large

 

and small is out of stock , so just del the small attribute for that option.

Share this post


Link to post
Share on other sites
hello , Thankx for helping me out.

i have tried what you guys said and its still not working. It subtracts the quantity from total but not from the size.

 

....

 

can you please click on the links below to review my code and let me know whats wrong

sinryder, you mangled the code a little bit when you added it to checkout_update. Move the line:

$products_attributes = $order->products[$i]['attributes'];

back up to right beneath:

if (STOCK_LIMITED == 'true') {

 

You also need to add back in:

$stock_query = tep_db_query($stock_query_raw);

right after:

$stock_query_raw .= " AND pa.options_id = '" .......

}

 

Another plug for compare programs here. I just brought up your checkout_update and the QT Pro 3.1 checkout_process into kdiff and this jumped right out.

Share this post


Link to post
Share on other sites

sinryder answers are right on. just a couple of other notes.

 

1. I need to be able to enable inventory (or basic inventory) on a per item basis.. is this possible?

If you have two different shirts and you want to track quantities by size for the first one and not the second - no its not possible. The "special" flag you found is by the option only. If an option is not "special" it will force tracking stock for that options values for all products that option is added to.

 

 

I though of one more thing.. is there a way that items that attribute selections that are out of stock just disapear? Opposed to saying "out of stock"?

 

Not yet. I have that and a whole lot more in the works. Its just about ready for some serious testing before turning it loose on you guys for beta testing.

Share this post


Link to post
Share on other sites

I am getting an error in catalog/admin/stock.php, which I think i svery weird since it is supposed to be a fresh installed page right out of the Contribution. Below is the error message I get when I punch in mysite.com/catalog/admin/stock.php

 

Any help would be appreciated. Thanks!

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'and products_attributes.options_id=products_options.products_op
select products_name,products_options_name as _option,products_attributes.options_id as _option_id,products_options_values_name as _value,products_attributes.options_values_id as _value_id from products_description, products_attributes,products_options,products_options_values where products_attributes.products_id=products_description.products_id and products_attributes.products_id= and products_attributes.options_id=products_options.products_options_id and products_attributes.options_values_id=products_options_values.products_options_v
alues_id and products_description.language_id=1 and products_options_values.language_id=1 and products_options.special=0 and products_options.language_id=1 order by products_attributes.options_id, products_attributes.options_values_id
[TEP STOP]

Share this post


Link to post
Share on other sites
I am getting an error in catalog/admin/stock.php, which I think i svery weird since it is supposed to be a fresh installed page right out of the Contribution. Below is the error message I get when I punch in mysite.com/catalog/admin/stock.php

stock.php isn't designed to be run directly. To set your stock for product attributes go into admin, catalog and navigate to the product you want to adjsut stock for and you will see a stock button on the right. Click the stock button to run and it will run stock.php with the parameters it needs to adjust stock for that product.

Share this post


Link to post
Share on other sites
I am using qtpro here:

 

http://www.ehlfinance.com/alansbikes/produ...p?products_id=2

 

stock for handles and wheels is 5 + 6 respectively - but they are showing out of stock ?

 

Any ideas ?

 

Thanx,

You appear to have everyting configured correctly in the admin except you'll want to change allow checkout to false. But that shouldn't cause the problem you are seeing (it will cause stock not to be decremented). It looks like you have another contribution installed for attribute sorting and assignment. That definitely will hit some of the same code as QT Pro so there may be some issues with your merging of the two contributions. Items are not showing out of stock in the cart so your problem is probably localized to product_info.php which an attribute sorting contribution would have changes in as well.

Share this post


Link to post
Share on other sites

OK so it appears the only workaround if I have products that I don't want to keep track of inventory of that have attributes I need to make seprate attributes that are "special".

 

OK I got that.

 

Now I still don't see this problem..... say I have a product that I am using this mod on it's available in M and L and in Black and in Red. So in this scenerio there are 4 combinations of sizes / colors and 4 stock numbers. My problem is that it seems you can not edit these numbers after they have been entered in the "Stock" button. So say I have 3 "M red" and I sell one in the brick and mortar store. How do I remove it from the stock on the website?

 

Thanks,

Jesse

 

PS thanks for the help guys :D

Edited by Jesse J

Share this post


Link to post
Share on other sites
My problem is that it seems you can not edit these numbers after they have been entered in the "Stock" button. So say I have 3 "M red" and I sell one in the brick and mortar store. How do I remove it from the stock on the website?

The same way you put the stock in the first place. The button on the stock page may say "Add" but it really updates as well. So if you have already put 3 in "M red" and need to change it to 2, go back into admin, catalog find the item, click the stock button, select M and red, type in 2 in the quantity box and click "Add".

Share this post


Link to post
Share on other sites

Yes, another newb with problems enters the topic. :blush: I got this msg after installing QTpro 3.1_1 on a MS2.2 osC when i try to get to the admin section:

 

GEO_ZONES', 'geo_zones'); define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones'); define('TABLE_WHOS_ONLINE', 'whos_online'); define('TABLE_ZONES', 'zones'); define('TABLE_PRODUCTS_STOCK', 'products_stock'); ?> 1146 - Table 'fair21_data.TABLE_CONFIGURATION' doesn't exist

select configuration_key as cfgKey, configuration_value as cfgValue from TABLE_CONFIGURATION

[TEP STOP]

Anybody have a clue where to look for my error? I did run the stock.sql from phpMyAdmin (which completed succesfully.)

 

Any clues? :blink:


Can't think of a signature tight now. But just you wait till I read the next Discworld!

Share this post


Link to post
Share on other sites

I'm now also getting a message when trying to add Product Options in the product attributes section in the cataloge admin:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

insert into products_options (products_options_id, products_options_name, language_id, products_options_sort_order,special) values ('15', 'color', '1', '',)

[TEP STOP]

 

Any suggestions here? :'(

Share this post


Link to post
Share on other sites
I'm now also getting a message when trying to add Product Options in the product attributes section in the cataloge admin:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

insert into products_options (products_options_id, products_options_name, language_id, products_options_sort_order,special) values ('15', 'color', '1', '',)

[TEP STOP]

 

Any suggestions here? :'(

This looks like a code merge problem with an attribute sorting contribution. Look for the line that begins:

 

tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, .....

 

Make sure you've got both the sort order variable and $special in the values portion of the string. Also, make sure you have:

 

$special=$HTTP_POST_VARS['special']?1:0;

 

right before it.

Share this post


Link to post
Share on other sites
Yes, another newb with problems enters the topic.  :blush:  I got this msg after installing QTpro 3.1_1 on a MS2.2 osC when i try to get to the admin section:

 

GEO_ZONES', 'geo_zones'); define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones'); define('TABLE_WHOS_ONLINE', 'whos_online'); define('TABLE_ZONES', 'zones'); define('TABLE_PRODUCTS_STOCK', 'products_stock'); ?> 1146 - Table 'fair21_data.TABLE_CONFIGURATION' doesn't exist

select configuration_key as cfgKey, configuration_value as cfgValue from TABLE_CONFIGURATION

[TEP STOP]

Anybody have a clue where to look for my error?  I did run the stock.sql from phpMyAdmin (which completed succesfully.)

 

Any clues?  :blink:

 

I suspect you inadvertently overtyped something in the define for TABLE_CONFIGURATION in admin/includes/database_tables.php

Share this post


Link to post
Share on other sites
I suspect you inadvertently overtyped something in the define for TABLE_CONFIGURATION in admin/includes/database_tables.php

You we're right about the problem being in that file. Although is wasn't something as minor as a typo. :'( Half the file was missing! :blink:

 

Very strange, but i uploaded it again and it seems to be working fine now :thumbsup:

Thanks a lot :D


Can't think of a signature tight now. But just you wait till I read the next Discworld!

Share this post


Link to post
Share on other sites
I use BBedtit and I am on Mac. I figured BBEdit doesthe same thing.

There are lots of programs that do straight diffs between two files. I'm pretty sure that's what BBEdit does from looking at the web site. I consider this a minimum requirement when applying contributions.

 

What KDiff3 does above and beyond that is a three-way diff. So lets say you are starting out with one of the loaded versions of OSCommerce or one you've already applied a few contributions to and now you want to add on QT Pro. With Kdiff3, you point it to the base osCommerce version of the file, the loaded version of the file and the QT Pro version of the file. It will then show you side by side all three with the differences marked making it easy to see where the loaded version and QT Pro modify the same code and what the modifications are in relation to the base. It can auto-merge anything that doesn't conflict leaving you to choose one or the other of the modified versions or manually merge the conflicts.

 

Sorry I don't know of a program like this for the Mac.

Share this post


Link to post
Share on other sites

Hello,

 

I have just installed QTPro 31_1.1 onto a heavily modified site, after testing it on an unmodified version of OSC.

 

But I have encountered 2 errors:

 

1. On the stock.php page in admin, I can only change the quantity for the product... the options to choose the quantity for a particular attribute does not appear at all, even though I have added attributes for that product!

 

2. On the Low stock report I am getting the following error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

select parent_id from categories where categories_id = 

[TEP STOP]

 

I cannot figure out why, though I think the cause of these problems may be down to another contribution - the options type feature contribution.

 

Any suggestions? Thanks guys,

 

Jiten

Share this post


Link to post
Share on other sites
1. On the stock.php page in admin, I can only change the quantity for the product... the options to choose the quantity for a particular attribute does not appear at all, even though I have added attributes for that product!

 

 

I'm assuming that you have not modified stock.php since its a new file, not a modification to a base osCommerce file. If that is the case, then the possibilities I can think of are:

 

Downloads are enabled

Your options are marked as "special"

The products_options table is missing the new column "special"

When you merged the modifications to products_attributes.php from QT Pro and your other contributions you are setting the "special" column incorrectly.

You are using a register_globals off contribution. Look back at the posts for a fix to this.

 

2. On the Low stock report I am getting the following error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

select parent_id from categories where categories_id = 

[TEP STOP]

 

 

I think I'd suspect register_globals off again. You can comment out the whole section of code dealing with the categoriies in the low stock report and not cause a problem. It looks like an incomplete thought that isn't used anywhere. No guarantees that will fix everything in it though as that program really needs a once over. See some previous posts for problems you might encounter with it.

Share this post


Link to post
Share on other sites
Hello,

 

I have just installed QTPro 31_1.1 onto a heavily modified site, after testing it on an unmodified version of OSC.

 

But I have encountered 2 errors:

 

1. On the stock.php page in admin, I can only change the quantity for the product... the options to choose the quantity for a particular attribute does not appear at all, even though I have added attributes for that product!

 

2. On the Low stock report I am getting the following error:

 

I took a closer look at this and the stock.php problem is most likely a code merge problem with the option type contribution setting the special column incorrectly. The low stock report is probably because you have a product that isn't in a category. You can delete the code in that page from the first occurrence of the line:

$last_category_query = ....

Through:

$cPath_array = ....

to resolve this problem.

Share this post


Link to post
Share on other sites

Hi Ralphday,

 

Thank you for all your advice.

 

I can now add the stock quantity to the attribute, which is brilliant!

 

However, the stock does not deduct everytime an item with that attribute is purchased. I did look at the previous posts on the register globals issue, but still cannot find a way around this. I'll keep trying and will let you know if I have any success!

 

Again, thank you ralphday for all your hardwork and advice!

 

All the best,

 

Jiten

Share this post


Link to post
Share on other sites

Sorry Guys for double post, but I sorted out my last issue of the stock not being updated when an attribute has been purchased.

 

Again, I found the answer was in an earlier thread...

 

In catalog/checkout_process.php:

 

Move:

 

$products_attributes = $order->products[$i]['attributes'];

 

right beneath:

 

if (STOCK_LIMITED == 'true') {

 

Just for the information of others who may be having a similar problem, previously this piece of code:

 

$products_attributes = $order->products[$i]['attributes'];

 

was situated elsewhere in checkout_process.php. Simply move it as stated above and, hey presto, it works!

 

Again credit for the above solution goes to ralphday - who posted it previously.

 

Regards,

 

Jiten

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×