Jump to content
zonetown

[Contribution] QTpro - Quantity Tracking Professional

Recommended Posts

Thanks for the offer, but for me money isn't the issue its time.  From me, you are more likely to see Attribute Sorter/Copier integrated sooner than Option Type as I have mostly done it for a loaded version of osCommerce I'll be using.  Though I'll probably get around to integrating Option Type.  Right now, getting the business aspects of my wife's store sorted out is my biggest priority.

Ofcourse - that's understandable. Perhaps someone else who has the time, could use the money :)

I'm sure I could figure it out myself too - but even though you've written a good proposal, as to how it should be implemented, I'm not so well-versed in QTPro code, that I feel confident that I could write those plugins (incl. the javascript - which I'm not good at) within a few days..

Share this post


Link to post
Share on other sites

I'll get started "ripping" option type feature and static options out of my code (crap job - took me some time to integrate static options and option type feature :) - so I can integrate qtpro4 and then hopefully someone have the time, so I (and perhaps others needs this too?) can pay them to do it :)

Share this post


Link to post
Share on other sites

It just dawned on me that you (or someone else) might think I was just bitching - so I just wanted to assert, that the reason I'm having to do the "crap job", is ofcourse because qtpro4 is sooo great (it really is), that I think it's worth it :)

 

IMHO QTPro4 should be added to 2.2MS3-CVS, as it is definetely a much needed feature, AND IMHO the plugins structure and the javascript-that makes sure customers can't order, what isn't in stock is REALLY REALLY BRILLIANT. If anyone knows somewhere to suggest to the devs to look at qtpro4, I'd gladly do it.

 

I'll start with ripping out my own integration work (back to scratch on product_info.php :) and then I'll learn to write plugins, by writing a static options plugin, that works like the static options contrib does now (so it will work with "compare options" contribution as the orig does) - and that'll hopefully make some users happy :)

 

Have a great new year.

Share this post


Link to post
Share on other sites

Just to get my last post in 2004 in ;) - has the admin side of qtpro changed from 3.1 to 4? (just before I rip out qtpro-3.1 to integrate qtpro-4 :)

Share this post


Link to post
Share on other sites
IMHO QTPro4 should be added to 2.2MS3-CVS, as it is definetely a much needed feature, AND IMHO the plugins structure and the javascript-that makes sure customers can't order, what isn't in stock is REALLY REALLY BRILLIANT. If anyone knows somewhere to suggest to the devs to look at qtpro4, I'd gladly do it.

 

Its been suggested that attribute stock capability (not necessarily QT Pro) be added to MS3. Harald has said something is coming in MS3 - whenever that is.

 

MS3 Progress Report

Share this post


Link to post
Share on other sites

Hello,

I am selling editions of items. And I need a way to keep track of the total stock as well as the stock of the attributes. For example:

People can order either by specifying a specific number of the edition or they can just buy one of the edition. If they specify an edition number I need to mark that specific edition number out of stock as well as subtract one from the total stock of the entire edition.

 

In other words, if I do a print run of 200. A customer could order 1 item - the stock is now at 199. The next customer orders 1, edition number 69. In which case the stock of edition number 69 is 0 and the the total stock is now 198.

 

Is there an *easy* way to do this? Or would I have to modify something?

 

any help much appreciated.

 

thanks,

sharon

Share this post


Link to post
Share on other sites
Hello,

I am selling editions of items. And I need a way to keep track of the total stock as well as the stock of the attributes. For example:

People can order either by specifying a specific number of the edition or they can just buy one of the edition. If they specify an edition number I need to mark that specific edition number out of stock as well as subtract one from the total stock of the entire edition.

 

In other words, if I do a print run of 200. A customer could order 1 item - the stock is now at 199. The next customer orders 1, edition number 69. In which case the stock of edition number 69 is 0 and the the total stock is now 198.

 

Is there an *easy* way to do this? Or would I have to modify something?

 

any help much appreciated.

 

thanks,

sharon

 

I'm asssuming that the customer who orders without specifiying an edition number will get whatever edition number you choose to send. QT Pro won't do this as you describe without modification. Unmodified QT Pro would require an edition number be chosen.

 

If the customer doesn't pick an edition number and its OK to just choose an edition number for the customer and have the number show up in the cart and order confirmation then it wouldn't be too hard. What I'm thinking of is a product information page with a dropdown that has "Any edition" as the default along with the edition numbers. You could tweak the form submit javascript that's generated in the product attribute display module to change "any edition" to an edition number before submitting the form.

 

If you require that "any edition" (or nothing) be shown instead of a specific edition number in the cart and order confirmation then the modfications to make it happen would be pretty extensive.

Share this post


Link to post
Share on other sites

I have some trouble integrating qtpro v4 on my ms2/creaload6fr new install...

 

By modifying my product.php, here is what i get :

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 d:\www.passion-piercing.com\www\includes\classes\pad_sequenced_dropdowns.php on line 123

and the list of attributes then displays...

 

The line 123 is the following :

      $this->_build_attributes_combinations($attributes, false, 'None', &$combinations, &$selected_combination);

 

Here is the portion of code that qtpro adds :

<?php

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

    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

    $products_attributes = tep_db_fetch_array($products_attributes_query);

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

//++++ 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

    }

?>

 

and what I remove is this :

          <table border="0" cellspacing="0" cellpadding="2">

            <tr>

              <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>

            </tr>

<?php

      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_sort_order");

      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

        $products_options_array = array();

        $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.products_options_sort_order");

        while ($products_options = tep_db_fetch_array($products_options_query)) {

          $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

          if ($products_options['options_values_price'] != '0') {

            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

          }

        }

 

        if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

          $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

        } else {

          $selected_attribute = false;

        }

?>

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

<?php

      }

?>

          </table>

 

Anyone could help me to understand why I'm getting that error message ?

Should I modify the plugin ?

 

Thanks

Share this post


Link to post
Share on other sites
I have some trouble integrating qtpro v4 on my ms2/creaload6fr new install...

 

By modifying my product.php, here is what i get :

 

QUOTE

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 d:\www.passion-piercing.com\www\includes\classes\pad_sequenced_dropdowns.php on line 123

 

and the list of attributes then displays...

 

The line 123 is the following :

 

      $this->_build_attributes_combinations($attributes, false, 'None', &$combinations, &$selected_combination);

 

 

You are probably running a different version of PHP than I am so I didn't catch this. You can remove the & in front of $combinations and $selected_combination on this line. If you use any of the other plug-ins you will need to make the same fix in them.

Share this post


Link to post
Share on other sites

Hi

 

I installed the contrib. but it does not run without error.

 

I have this error if I open a product (in the area where the select options normaly are)

1146 - Table 'testshop.TABLE_PRODUCTS_STOCK' doesn't exist    select products_stock_quantity from TABLE_PRODUCTS_STOCK where products_id = '2' AND products_stock_attributes REGEXP '(^|,)3-6(,|$)' AND products_stock_quantity > 0

 

I looked for any wrong thinks I made but I did not find any.

 

What can I do?

Share this post


Link to post
Share on other sites
Hi

 

I installed the contrib. but it does not run without error.

 

I have this error if I open a product (in the area where the select options normaly are)

I looked for any wrong thinks I made but I did not find any.

 

What can I do?

You either didn't run the sql scripts (new_install.sql and config.sql) that make the necessary database changes or they failed for some reason.

Share this post


Link to post
Share on other sites

i get the following error when all attribute stock for aparticular item has been depleted to 0 or never was set

 

Warning: Invalid argument supplied for foreach() in /homepages/9/d9537741/htdocs/catalog/includes/classes/pad_base.php on line 443

 

could anyone help me out with this

Share this post


Link to post
Share on other sites

Hi Ralph

 

 

You either didn't run the sql scripts (new_install.sql and config.sql) that make the necessary database changes or they failed for some reason.

 

 

I istalled the two sql files without any error message.

Share this post


Link to post
Share on other sites
1146 - Table 'testshop.TABLE_PRODUCTS_STOCK' doesn't exist    select products_stock_quantity from TABLE_PRODUCTS_STOCK where products_id = '2' AND products_stock_attributes REGEXP '(^|,)3-6(,|$)' AND products_stock_quantity > 0

read the message - Table 'testshop.TABLE_PRODUCTS_STOCK' doesn't exist.. hmm. I'm pretty sure it doesn't. Shouldn't TABLE_PRODUCTS_STOCK have been "converted" to the actual table name? Where is this done.. hmm. try looking at includes/database_tables.php (or whatever it's name is).. ;)

Share this post


Link to post
Share on other sites

Hi Fixion

 

 

1146 - Table 'testshop.TABLE_PRODUCTS_STOCK' doesn't exist? ? select products_stock_quantity from TABLE_PRODUCTS_STOCK where products_id = '2' AND products_stock_attributes REGEXP '(^|,)3-6(,|$)' AND products_stock_quantity > 0

read the message - Table 'testshop.TABLE_PRODUCTS_STOCK' doesn't exist.. hmm. I'm pretty sure it doesn't. Shouldn't TABLE_PRODUCTS_STOCK have been "converted" to the actual table name? Where is this done.. hmm. try looking at includes/database_tables.php (or whatever it's name is).. ;)

 

 

 

Thats it!!! Now it works!!! THX very very much!!!

Share this post


Link to post
Share on other sites
i get the following error when all attribute stock for aparticular item has been depleted to 0 or never was set

 

Warning: Invalid argument supplied for foreach() in /homepages/9/d9537741/htdocs/catalog/includes/classes/pad_base.php on line 443

 

could anyone help me out with this

This is a known bug. Add this code to the beginning of function _draw_js_stock_array in pad_base to fix it.

 

     if (!((isset($combinations)) && (is_array($combinations)) && (sizeof($combinations) > 0))){
      return '{}';
    }

Share this post


Link to post
Share on other sites
read the message - Table 'testshop.TABLE_PRODUCTS_STOCK' doesn't exist.. hmm. I'm pretty sure it doesn't. Shouldn't TABLE_PRODUCTS_STOCK have been "converted" to the actual table name? Where is this done.. hmm. try looking at includes/database_tables.php (or whatever it's name is).. ;)

 

Doh! Good catch fixion. I can't believe I didn't even look at the stuff ALL IN CAPS before replying. :'(

Share this post


Link to post
Share on other sites
This is a known bug.  Add this code to the beginning of function _draw_js_stock_array in pad_base to fix it.

 

Any other "known bugs" we should know about ? ;)

Share this post


Link to post
Share on other sites

Have someone released Qtpro contribution whitch work together with "AttributeSets" contribution

 

http://www.oscommerce.com/community/contributions,2201/

 

or contribution like that?

 

Wanna find way to copy attribute groups and sort attributes...

 

Yes there is Install notes in Qtpro how to add sorter but it?s too much for my skills.. too much me to modify...

 

Why it?s not already included in Qtpro?

 

Coud someone help me?

Share this post


Link to post
Share on other sites
Any other "known bugs" we should know about ? ;)

I missed a width="100%" on a table tag that causes the picture to slide up against the description when the description lines are short. This was psoted a while back with a fix.

 

There are a couple of errors in the javascript that is generated that don't seem to cause any real problems:

 

- a missing semicolon at the end of an array declaration/initialization statement. This doesn't generate a javascript error but is technically wrong.

- some totaly bad statements generated by the sequenced dropdown plugin when there are no attribute combinations in stock. This generates a javascript error.

 

That's all I know about. I'll be posting a fix release including fixes for these and making downloads work soon. I just need to find a little time for testing.

Share this post


Link to post
Share on other sites
Have someone released Qtpro contribution whitch work together with "AttributeSets" contribution

 

http://www.oscommerce.com/community/contributions,2201/

 

or contribution like that?

 

Wanna find way to copy attribute groups and sort attributes...

 

Yes there is Install notes in Qtpro how to add sorter but it?s too much for my skills.. too much me to modify...

 

Why it?s not already included in Qtpro?

 

Coud someone help me?

 

I haven't seen any thing like that. Its not already included in QT Pro due to not having the time to do it. I'll probably release a merged QT Pro and Attribute Sorter/Copier in a few months as I've pretty much done this to add QT Pro to one of the loaded contributions out there. It will take some time to extract the changes just for those two contributions from all the loaded stuff, package it for base osCommerce and test it.

Share this post


Link to post
Share on other sites

Hello all,

 

I am using qtpro with my test shop and I am very pleased. I am about to add it to my live shop but must have QTPRO stock functionality in the order editing tool.

 

Did anyone add the QTPRO stock management to the order editng contribution ?

Or maybe someone wrote a function like

update_stock_item(int $product_id, int $quantity, array $product_attributes)?

 

 

Thanks,

Limor

Share this post


Link to post
Share on other sites
Or maybe someone wrote a function like

update_stock_item(int $product_id, int $quantity, array $product_attributes)?

Thanks,

Limor

 

I've started this function but its a little stalled right now due to other demands on my time. Its the way to go for Paypal IPN as well which duplicates the stock reduction logic in a couple of places. :'( Some hints for you if I don't get back to this soon. Stock reduction logic is in catalog/checkoutprocess.php. Stock add logic is different and in catalog/admin/includes/functions/general.php function tep_remove_order. The biggest differences are how to set the products_quantity value for the overall product - maybe I should just let it go negative and eat the database call to find out if all attributes are out of stock (similar to how catalog/admin/stock.php determines what to set product_quantity to). And that the in stock flag doesn't get changed crossing zero when addding stock but does when subtracting stock.

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

×