Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

Hi QTPro does support multiple attributes as far as I know.

 

However I tried to use QTPro3.0 but I know that the SQL provided is not correct the table to be created is wrong and will give errors within product_info.php etc.

 

So I played with it and got it working finally.

 

Have to say that QTPro2.3update worked straight off! So personally I would recommend that.

 

Must also say that any time spent on this contribution is 110% usefull. Very good code and functionality.

 

Thanks

 

JAS

Link to comment
Share on other sites

I m changing a few things in the code of your contrib and I wonder why you put the stock in products_stock instead of in products_attributes?

Is it only to save space and separate things or is there any other reason?

 

Would be great to know

 

J.

Link to comment
Share on other sites

It is basic relational database design. Here is a example, some columns have been omitted for simplicity.

 

table_products_options
options_id 
     size = 1
     color = 2

 

table_products_options_values
options_values
      small = 1
      medium = 2
      large = 3
      red = 1
      green = 2
      blue = 3

 

table_products_attributes
products_id        option_id        options_values
12                    1                       3
12                    2                       1

 

 

This is how we assign Large, Red to product 12. If we put stock in the product attributes table we will have to update two rows on every transaction. As more options and values are added it becomes much more transaction intensive.

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

Sure that s what I though

but should you have a stock count for every option after all? (not if you have red available only in large and blue available in medium and large) right?

 

Anyway I m using only one option ( is really all I need)

I figured how to go on about it.

 

What I m doing is a very small mod to update stock count and price using a file of course this is done already with easy populate. but what about all the options?

the file has this structure

Model | Qtty | Price

12-Red | 2 | $12

12-Blue | 1 | $12

in the shopping cart i only have 12 as a model number so I need to add an extra column product model for each of the options

I wont look at the price for the products that have options because the options have all the same values

SO i think that i will automatically create a model number 12-name of the option and then i ll have to modify it by hand (once) and then it s all easy

 

Does this makes sense?

 

J.

Link to comment
Share on other sites

  • 3 weeks later...

I have noticed a small bug in this attribute... When checking out while products are out of stock, on the last part were it shows you your order, and has the *** if things are out of stock, it doesnt show out of stock attributes. Only if the product is Completely sold out, or if any of the attributes have stock left...

Link to comment
Share on other sites

I am not sure if i did something wrong during install, or i am clashing with another attribute or it is a bug. But I thought i'd ask around before I start sifting through the code. On my site the costomer can succesfully buy products that are marked 'out of stock' on the products_info page. (Sure most people would not choose a product marked out of stock - but it is possible!) Can anyone help with this?

Link to comment
Share on other sites

Ok, I have worked out the problem but again request anyone who may have put a fix in here already to let me know before I try and do it.

 

There are two bugs related to each other:

 

1. If you have only one attribute left and try to change it to 0 to remove it (so no attributes have stock you get the following:

 

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 'where products_id=46' at line 1

 

update products set products_quantity= where products_id=46

 

[TEP STOP]

 

 

2. I think the above error is tied into the other bug which relates to changing to stock quantities. If you manually change a stock attributes quantity to 0, it actually disappears the first time. If you choose that attribute again and type ?0 and click ?add? the attribute returns marked with a ?0?. You can keep doing this and every second time you change the stock attribute quantity to 0, it marks the product stock as 0, the other time it does not list the product attribute at all.

 

The problem is this: when it is actually marked with a '0' it will show out of stock on the catalog and shopping cart but when the attribute is not shown at all it will only show ?out of stock? on products info page drop down menu but does not show the red ?out of stock? warning on the shopping cart.

 

Anybody encountered this before and fixed the problem?

Link to comment
Share on other sites

In Admin, Contents, Select the product, click on the stock button, select the appropriate option from the drop down, small in your example. Enter the correct quantity and click the Total button.

 

This is the same procedure you use to update the inventory when you get new product.

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

Ive had a minor emergancy :'( ...

I set stock levels for this product (they were actual numbers now set as 0 as shown below)...

I tried to add them to my cart and they showed as out of stock (when there was indeed quanity shown in Admin...

Here is what the stock page looks like... I am not sure why it looks like this...

PLEASE HELP!!!

ipodxtrasissue.JPG

Link to comment
Share on other sites

1. Does line 142 - 163 in stock.php look like this?

 

    $q=tep_db_query("select * from products_stock where products_id=$product_id order by products_stock_attributes");
   while($rec=tep_db_fetch_array($q))
   {
     $val_array=explode(",",$rec[products_stock_attributes]);
     echo "<tr>";
     foreach($val_array as $val)
     {
       if (preg_match("/^(\d+)-(\d+)$/",$val,$m1))
       {
         echo "<td class=smalltext>   ".tep_values_name($m1[2])."</td>";
       }
       else
       {
         echo "<td> </td>";
       }
     }
     for($i=0;$i<sizeof($options)-sizeof($val_array);$i++)
     {
    	 echo "<td> </td>";
     }
     echo "<td class=smalltext>    $rec[products_stock_quantity]</td><td> </td></tr>";
   }

 

2. Have you deleted anything under Catalog, Product Attributes and re-added it?

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

After installing V3.0. I'm having this problem

when clicking in Back to Low Stock Report for Attributes

 

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 =

 

What am I doing wrong?

 

I tried installing from version 1.0 going trough all version and none of them seems to work.

 

Does this thing really works?

 

:(

Link to comment
Share on other sites

Buf fixed in product_info.php

 

//START get attribute stock values

$attribute_stock_query = tep_db_query("select products_stock_quantity from products_stock where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and products_stock_attributes = '" . (int)$products_options['options_values_id'] . "'");

$attributes_stock = tep_db_fetch_array($attribute_stock_query);

$option_stock = $attributes_stock['products_stock_quantity'];

//END get attribute stock values

Link to comment
Share on other sites

Hi guys,

 

I have searched this forum and not come across this problem as yet. I have installed QTPro 3 and then backwards to 2.3 and checked and cross checked the code with Beyond Compare and all seems to work fine EXCEPT when I purchase something it goes to the checkout then as it gets to the checkout payment screen it loops back to the shopping cart...yes I have downloads disabled, and yes to having allow checkout as false, check stock levels true and adjust stock levels true also.

 

I am lost with this now, I have studied the forum and completed every task people have posted as a fix and it still loops back to the chopping cart...???

 

This is such a great mod and want to have it, but can't use it if it is playing up, so any ideas.

 

Thanks guys...

Jamie

Link to comment
Share on other sites

Jamie,

 

There are two places in checkout_payment.php that cause it redirect back to the shopping_cart page.

 

First is around line 25

// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
 }

 

Second is around line 40, make sure these are correct.

// Stock Check
 if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
   $products = $cart->get_products();
   $any_out_of_stock = 0;
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
    if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
 $stock_check = tep_check_stock_new($products[$i]['id'], $products[$i]['attributes'], $products[$i]['quantity']);
}else{
$stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
}
if ($stock_check) $any_out_of_stock = 1;
        	 }
   if ($any_out_of_stock == 1) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
       break;
   }
 }

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

Hi TomThumb,

 

Yep that is the exact code I have also in my file...whats your thoughts now...???

 

Thanks heaps again TomThumb

Jamie

 

 

 

 

Jamie,

 

There are two places in checkout_payment.php that cause it redirect back to the shopping_cart page.

 

First is around line 25

// if there is nothing in the customers cart, redirect them to the shopping cart page
?if ($cart->count_contents() < 1) {
? ?tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
?}

 

Second is around line 40, make sure these are correct.

// Stock Check
?if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
? ?$products = $cart->get_products();
? ?$any_out_of_stock = 0;
? ?for ($i=0, $n=sizeof($products); $i<$n; $i++) {
? ? if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
?$stock_check = tep_check_stock_new($products[$i]['id'], $products[$i]['attributes'], $products[$i]['quantity']);
}else{
$stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
}
if ($stock_check) $any_out_of_stock = 1;
? ? ? ? ?	}
? ?if ($any_out_of_stock == 1) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
? ? ? ?break;
? ?}
?}

Link to comment
Share on other sites

Can I have links to sites where I can see QTPro in action? Also, can it be used in conjunction with something which would give a 'due in x weeks' message instead of the default out-of-stock warning? I've seen mention of things which aren't in stock showing up, I actually want this to show those items so that people can order and I can buy in for them.

 

TIA

Tracy

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