Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

I just posted QT Pro version 4.2.

 

Version 4.2 is a bug fix release of QT Pro.

 

Changes from version 4.1 to version 4.2:

 

Fix problem with delete and restock orders with downloaded products

 

 

For anyone who has already integrated 4.1 the changes are in checkout_process.php in the stock decrement area and the remove order section of catalog/admin/includes/functions/general.php. Unless you have other changes in the stock decrement area of checkout_process.php you should be able to cut and paste from:

 

// Stock Update - Joao Correia

 

down through:

 

// Update products_ordered (for bestsellers list)

 

In general.php, you can just cut & paste the tep_remove_order function.

Link to comment
Share on other sites

I got qtpro working great now, thanks to Ralph :)

 

As I moved on with my project now I am facing some problem with "Edit orders thing"

 

I have downloaded the contribution below. it is order editor.

1) http://www.oscommerce.com/community/contributions,1435

 

This tool works nicely but does not update stock when an item is removed from an order. If this Order Editor works with Qtpro life will be lot easier, does anyone of you using Qtpro got this contribution to work with QTpro, if so please enlighten me in what direction I should go to achieve the same.

 

For your information there is a contribution which puts the order back to customers shopping cart and this can be done via admin, then customer adds/removes items from his cart and resubmit the order and order gets updated in admin. It's real cool but I couldn't get this to work too. Link to the the contribution below, Contributions name is Restore Order For Customer Change V1.

 

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

 

If Ralph gets this order edit thing going with Qtpro it would be nice. I am aware he is busy but still my request.

Link to comment
Share on other sites

I got qtpro working great now, thanks to Ralph :)

 

As I moved on with my project now I am facing some problem with "Edit orders thing"

 

I have downloaded the contribution below. it is order editor.

1) http://www.oscommerce.com/community/contributions,1435

 

This tool works nicely but does not update stock when an item is removed from an order. If this Order Editor works with Qtpro life will be lot easier, does anyone of you using Qtpro got this contribution to work with QTpro, if so please enlighten me in what direction I should go to achieve the same.

 

For your information there is a contribution which puts the order back to customers shopping cart and this can be done via admin, then customer adds/removes items from his cart and resubmit the order and order gets updated in admin. It's real cool but I couldn't get this to work too. Link to the the contribution below, Contributions name is Restore Order For Customer Change V1.

 

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

 

If Ralph gets this order edit thing going with Qtpro it would be nice. I am aware he is busy but still my request.

 

Where in the menu system does stats_low_stock_attrib.php found??

 

should it not fall under "Reports"?

 

Also, has anyone successfully combined the RMA mod with this?

Link to comment
Share on other sites

Give this a try.  Warning its untested code!

 

In catalog/includes/classes/pad_base.php find this:

          $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;
           }
           $combinations[] = array('comb'=>$newcomb, 'id'=>substr($newid,1), 'text'=>$newtext);
           if ($newisselected) $selected_combination = sizeof($combinations)-1;
         }

 

and replace it with this:

          $is_out_of_stock=tep_check_stock(tep_get_prid($this->products_id),1,$newcomb);
         if (!$is_out_of_stock | ($showoos == true)) {
           if (!$is_out_of_stock) {
             $newtext.=' - '.tep_get_products_stock(tep_get_prid($this->products_id),$newcomb).' in stock';
           }
           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;
           }
           $combinations[] = array('comb'=>$newcomb, 'id'=>substr($newid,1), 'text'=>$newtext);
           if ($newisselected) $selected_combination = sizeof($combinations)-1;
         }

 

This should work for the single radioset or single dropdown plugins and will display the quantity like this "small - 5 in stock".

 

 

Hello Ralph,

 

I have applied the above code to display available stock for attributes like "1 in stock" etc, but Stock is getting displayed with attributes only when pad_single_dropdown and pad_single_radio_set options are set in product information section in configuration, when I use pad_base , in stock thing is not showing, is it the way it is supposed to be or it is a problem? your reply regarding this would save me :) thanks.

Link to comment
Share on other sites

Hello Ralph,

 

I have applied the above code to display available stock for attributes like "1 in stock" etc, but Stock is getting displayed with attributes only when pad_single_dropdown and pad_single_radio_set options are set in product information section in configuration, when I use pad_base , in stock thing is not showing, is it the way it is supposed to be or it is a problem?  your reply regarding this would save me :) thanks.

That's correct. pad_base acts like base osCommerce if you use it as a plugin. Its the base class that the plugins inherit from so some of the methods do things that are only used by the other plugins.

Link to comment
Share on other sites

Where in the menu system does stats_low_stock_attrib.php found??

 

should it not fall under "Reports"?

 

Also, has anyone successfully combined the RMA mod with this?

Yes one would think stats_low_stock_attrib.php should fall under reports but when I started cleaning up QT Pro it wasn't there. Putting it there was low on the priority list as QT Pro wasn't even keeping track of stock correctly at that time. Maybe someday when time permits it will move there. For now just type in the URL once and bookmark it.

 

Don't know about the RMA contrib.

Link to comment
Share on other sites

Yes one would think stats_low_stock_attrib.php should fall under reports but when I started cleaning up QT Pro it wasn't there.  Putting it there was low on the priority list as QT Pro wasn't even keeping track of stock correctly at that time.  Maybe someday when time permits it will move there.  For now just type in the URL once and bookmark it.

 

Don't know about the RMA contrib.

 

I have added it for you. The contrib is now 4.2a.

Link to comment
Share on other sites

Thanks for the reply Ralph.

 

I am just trying to add pagination and search to Stats_low_stock_attrib page. I will post the progress here, I have added almost 300 products with attributes tracking stock and Stats_low_stock_attrib page is so long like Great wall of China and taking time to load. On broadband page loads late, on dial up it is getting time out.

Link to comment
Share on other sites

Hello Everyone,

 

 

I have a clothing store setup on my local computer, and I have installed QTpro v4.1 and everything works great, but what I would like to do is display the attributes and the quantity of the attributes on the product_info.php page. How would I go about doing this? I am very new to all of this but,

 

I have included a image of what I am trying to do, you can view the image here.

 

I would like to get that kind of setup in the image above is possible.

 

I hope I am explaining it right, any help would be gratefully appreciated.

 

Thank You!

Link to comment
Share on other sites

Qtpro as it is now doesn't have the feature you want, I am saying this after I saw the image you linked to.

 

I am talking about free version supported by Ralph Day here.

 

There is Qtpro deluxe which has exact feature you are after, please search for it using google or whatever, I am not supposed to post links here.

Link to comment
Share on other sites

I installed QT pro 4.2. It worked great for exactly what I'm using oscommerce for.

 

I have a clothing/merchandise site where we have shirts that have multiple sizes and colors. I wanted to use Oscommerce because sometimes we run out of stock and I hate getting orders for products that we don't have because our lead time on our shirts is 4 weeks. Sometimes the customer gets a little irritated when they have to wait that long.

 

It also make the site look a lot cleaner to be able to have a product for a Men's shirt, and then have product attributes for Small/Medium/Large and color: white/black.

 

With QTPro, I'm able to set an inventory for each product attribute, which is fantastic!!!

 

I'm having a problem when a specific attribute has a stock of Zero.

 

I get a SQL error pointing to catalog/includes/classes/pad_base.php which shows up to the end-user/customer.

 

I need some of my products to be set to 0 that we don't currently have in stock, but I want to show to the customer. In other words, if I have a t-shirt - with 5 small, 5 medium, 7large, and 0 XXL (all in black) I want to be able to setup the attribute for XXL, but have 0 stock until we get the XXL manufactured and back in stock.

 

Does anybody else have this problem?

 

Is there a known work around?

 

Thanks!

Link to comment
Share on other sites

I'm having a problem when a specific attribute has a stock of Zero.

 

I get a SQL error pointing to catalog/includes/classes/pad_base.php which shows up to the end-user/customer.

 

I need some of my products to be set to 0 that we don't currently have in stock, but I want to show to the customer.  In other words, if I have a t-shirt - with 5 small, 5 medium, 7large, and 0 XXL (all in black) I want to be able to setup the attribute for XXL, but have 0 stock until we get the XXL manufactured and back in stock.

 

Does anybody else have this problem?

 

Is there a known work around?

 

Thanks!

 

I haven't heard of this and it doesn't happen in my test setup. Post the full text of the error messages you are receiving and maybe I can help. Also, post your PHP and mysql versions.

Link to comment
Share on other sites

HELP!!

 

After I installed QTPro 4.2 I thought that everything worked perfevtly but now when I am adding new products the product-name is not saved but instead it takes the model_name. Who can help me checking my code, Im desperate I obviously do not know enough from PHP.

 

Who can help me?

 

Thanks

 

 

Nathalie

Link to comment
Share on other sites

Hi Guys,

Thanks for a great contribution. I have v4.2 running on a heavily modded site and so far it seems to be working great... except:

 

Mac Users running Internet Explorer 5.2 (the last version for mac) who have the "Show Scripting Alert Errors" preference on are getting Javascript errors that appear to be related to the stock checking function. I've sifted through pad_base.php and pad_multiple_dropdown.php, but don't really see anything there that should be causing the errors.

 

The error on product_info.php is:

Microsoft JScript compilation error

Line 262

Char 13

Expected Identifier or string

 

The the third line of the source below is highlighted by the error message:

 

<script LANGUAGE="JavaScript"><!--
 function chkstk(frm) {
   var stk={41:1,42:1,43:1,44:1,45:1,46:1,48:1,54:1,61:1,57:1,50:1,51:1,53:1,58:1,59:1,61:1};
   var instk=false;
   if (stk[frm['id[9]'].value]) instk=true;
 return instk;
 }
 function stkmsg(frm) {
   var instk=chkstk(frm);
   var span=document.getElementById("oosmsg");
   while (span.childNodes[0])
     span.removeChild(span.childNodes[0]);
   if (!instk)
     span.appendChild(document.createTextNode("The combination of options you have selected is currently out of stock.  Please select another combination."));
   else
     span.appendChild(document.createTextNode(" "));
 }
 stkmsg(document.cart_quantity);
 function chksel() {
   var instk=chkstk(document.cart_quantity);
   if (!instk) alert('The combination of options you have selected is currently out of stock.  Please select another combination.');
   return instk;
 }
 document.cart_quantity.onsubmit=chksel;
//--></SCRIPT>

 

My guess is that the above is being output by pad_multiple_dropdowns.php... am I right?

Has anyone else seen this issue an, if so, does anyone have a fix (aside from "don't use IE on a mac")?

 

Here's a link to a product page on the site in question: Ugly Bass Player

Edited by JBenedetti
Link to comment
Share on other sites

Mac Users running Internet Explorer 5.2 (the last version for mac) who have the "Show Scripting Alert Errors" preference on are getting Javascript errors that appear to be related to the stock checking function.  I've sifted through pad_base.php and pad_multiple_dropdown.php, but don't really see anything there that should be causing the errors.

 

The error on product_info.php is:

Microsoft JScript compilation error

Line 262

Char 13

Expected Identifier or string

 

The the third line of the source below is highlighted by the error message:

 

<script LANGUAGE="JavaScript"><!--
?function chkstk(frm) {
? ?var stk={41:1,42:1,43:1,44:1,45:1,46:1,48:1,54:1,61:1,57:1,50:1,51:1,53:1,58:1,59:1,61:1};
? ?var instk=false;
? ?if (stk[frm['id[9]'].value]) instk=true;
?return instk;
?}

......

 

My guess is that the above is being output by pad_multiple_dropdowns.php... am I right?

Has anyone else seen this issue an, if so, does anyone have a fix (aside from "don't use IE on a mac")?

 

Here's a link to a product page on the site in question: Ugly Bass Player

Yuck, Mac IE 5.2. That's a nasty buggy browser. I do see a lot of "switch to Safari" suggestions when researching Mac IE 5.2 problems but that really doesn't help.

 

I can't find anything specific to this problem when research Mac IE 5 quirks so I'll try a guess. The line its puking on is initalizing the stk array using what's called an object literal. What's before the colon in each of the number:number pairs is the object property name and after the colon is the property value. This is perfectly valid Javascript for initializing an associative array object. Oh, but Microsoft uses JScript. And the interesting thing is the error you are receiving "Expected Identifier or string" doesn't seem to exist in the current version of JScript. Its now "Expected Identifier, string or number". So I suspect the Mac IE 5.2 JScript version doesn't consider a numeric property name as valid in an object literal. I don't have a Mac to test on so I'm not sure. To test it view the source of a product page that's causing the error and save it. Now add single quotes around all of the numbers before the colons in the line its puking on and save it. Then load your doctored version of the page into Mac IE 5.2 and see if the error goes away.

 

If that turns out to be the problem, the javascript you posted is generated by pad_multiple_dropdowns method _draw_out_of_stock_message_js. But that calls the pad_base method _draw_js_stock_array to output the object literal that appears to be the problem. So in pad_base replace the _draw_js_stock_array method with this barely tested code:

 

    function _draw_js_stock_array($combinations) {
     if (!((isset($combinations)) && (is_array($combinations)) && (sizeof($combinations) > 0))){
       return '{}';
     }
     $out='';
     foreach ($combinations[0]['comb'] as $oid=>$ovid) {
       $out.="{'".$ovid."':";
       $opts[]=$oid;
     }
     $out.='1';
     
     for ($combindex=1; $combindex<sizeof($combinations); $combindex++) {
       $comb=$combinations[$combindex]['comb'];
       for ($i=0; $i<sizeof($opts)-1; $i++) {
         if ($comb[$opts[$i]]!=$combinations[$combindex-1]['comb'][$opts[$i]]) break;
       }
       $out.=str_repeat('}',sizeof($opts)-1-$i).',';
       if ($i<sizeof($opts)-1) {
         for ($j=$i; $j<sizeof($opts)-1; $j++)
           $out.="'".$comb[$opts[$j]]."':{";
       }
       $out.="'".$comb[$opts[sizeof($opts)-1]]."':1";
     }
     $out.=str_repeat('}',sizeof($opts));
     
     return $out;
   }

 }

 

Good luck.

Link to comment
Share on other sites

HELP!!

 

After I installed QTPro 4.2 I thought that everything worked perfevtly but now when I am adding new products the product-name is not saved but instead it takes the model_name. Who can help me checking my code, Im desperate I obviously do not know enough from PHP.

 

Who can help me?

 

Thanks

Nathalie

Hmm.. QT Pro doesn't even touch the code that adds products. Do you have another contribution installed that modifies admin/categories.php? If so, ask on the support thread for that contribution for help.

Link to comment
Share on other sites

Qtpro as it is now doesn't have the feature you want, I am saying this after I saw the image you linked to.

 

I am talking about free version supported by Ralph Day here.

 

There is Qtpro deluxe which has exact feature you are after, please search for it using google or whatever, I am not supposed to post links here.

 

Looks like freezehell has made some nice improvements. Its perfectly legitimate for him to sell his improved version, but according to the GNU site any derivitive of GPL licensed software must allow redistribution under the same terms as the GPL license. I'm not a lawyer but if I understand it right, if someone buys it they could post it here and everyone else can download and use it for free. Just a thought.

Link to comment
Share on other sites

Now add single quotes around all of the numbers before the colons in the line its puking on and save it.  Then load your doctored version of the page into Mac IE 5.2 and see if the error goes away.

I agree, IE 5.2 Mac = Yuck.

Thanks for the excellent explanation and suggestions Ralph. That did indeed fix the original error. Only now it chokes a few lines down on:

function stkmsg(frm) {
   var instk=chkstk(frm);
   var span=document.getElementById("oosmsg");
   while (span.childNodes[0])
     span.removeChild(span.childNodes[0]);
   if (!instk)
     span.appendChild(document.createTextNode("The combination of options you have selected is currently out of stock.  Please select another combination."));
   else
     span.appendChild(document.createTextNode(" "));

Specifically on

while (span.childNodes[0])

Error is "Object doensn't support this property or method"

Link to comment
Share on other sites

I agree, IE 5.2 Mac = Yuck.

Thanks for the excellent explanation and suggestions Ralph.  That did indeed fix the original error.  Only now it chokes a few lines down on:

function stkmsg(frm) {
? ?var instk=chkstk(frm);
? ?var span=document.getElementById("oosmsg");
? ?while (span.childNodes[0])
? ? ?span.removeChild(span.childNodes[0]);
? ?if (!instk)
? ? ?span.appendChild(document.createTextNode("The combination of options you have selected is currently out of stock. ?Please select another combination."));
? ?else
? ? ?span.appendChild(document.createTextNode(" "));

Specifically on

while (span.childNodes[0])

Error is "Object doensn't support this property or method"

I was afraid something like that was going to happen. Again, its perfectly good javascript and nothing I can find about Mac IE 5.2 quirks gives me any hints to the problem. childNodes, removeChild and appendChild are all supposedly supported in Mac IE 5.2. So I'm going to guess that IE 5.2 Mac is doing something funky in the DOM with the empty span tag. Give this a shot to see if it gets past this new problem and presents yet another. :P

 

In your saved version of the page replace:

<span id="oosmsg" class=errorBox></span>

With:

<span id="oosmsg" class=errorBox> </span>

That might force it to create a proper DOM and make the childNodes property work.

Link to comment
Share on other sites

I just installed QTPro. However, when I pull it up, all I get for headings are things like Quick_head1, Quick_head2, QUICK_MODEL QUICK_ID QUICK_NAME QUICK_WEIGHT QUICK_PRICE QUICK_STOCK, etc.

 

What did I do stupid?? ;)

Link to comment
Share on other sites

I just installed QTPro.  However, when I pull it up, all I get for headings are things like Quick_head1, Quick_head2, QUICK_MODEL QUICK_ID QUICK_NAME QUICK_WEIGHT QUICK_PRICE QUICK_STOCK, etc. 

 

What did I do stupid?? ;)

Those headings don't sound related to QT Pro. Where do you see them?

Link to comment
Share on other sites

Those headings don't sound related to QT Pro.  Where do you see them?

 

When I pull up quick_stockupdate.php from the Catalog menu, I see the headings QUICK_HEAD1

 

QUICK_HEAD2

 

and then the list of categories.

 

When I select one, then I get the headings stated previously on the listing page/form. It appears that data is correct and changes take. However, this is my wife's store, and she'll freak... enough said. ;)

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