Jump to content



Photo
- - - - -

QTPro BS

qtpro attributes stock bs add-on update

  • Please log in to reply
54 replies to this topic

#41 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 24 January 2017 - 15:57

@altoid,

yes

#42   altoid

altoid
  • Members
  • 1,405 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 24 January 2017 - 19:50

@raiwa

Using the files from the github, I completely wrote over existing files from new and modified files in qtpro-5.0-BS-master

and then reinstalling,  I see this happed during a trial purchase:

 

Adding a Value Model with 8 mb to the cart

 

Model Memory Price Qty. Value 4 mb $299.99 1 Value 8 mb $349.99

1

 

Noting there's just one of those in stock.  On the shopping cart page when I update the quantity to 2 and refresh this message appears.

 

Matrox G200 MMS***
- Memory 8 mb
- Model Value

Products marked with *** dont exist in desired quantity in our stock.

You can buy them anyway and check the quantity we have in stock for immediate deliver in the checkout process.

 

Continuing through the checkout process...

 

checkout_shipping > checkout_payment > checkout_confirmation

 

Showing:

 

2 x 

Matrox G200 MMS
  - Memory: 8 mb
  - Model: Value

 

I get to checkout_success and done.

 

In admin I see this message:

 

Warning: There are 1 sick products in the database. Please visit the QTPro doctor.

 

QT Pro Doctor says:

 

You currently have 28 products in your store.
3 of them have options with tracked stock.
In the database we currently have 0 trash rows.
1 of the producks with tracked stock is sick.

Sick products in the database:

Product with ID 1: The summary stock calculation is wrong. Please take a look at this products stock.

 

Clicking products stock I see duplicate warnings at the top:

 

 Warning: There are 1 sick products in the database. Please visit the QTPro doctor

Warning: There are 1 sick products in the database. Please visit the QTPro doctor.

 

Noting stock for that Value 8 MB

 Value    8 mb     -1

 

Below  I click on:

Automatic Solutions Avaliable:

Set the summary stock to: 14

 

QT Pro Dr is happy now but in stock for that item stock shows:

 

 

 Model   Memory Quantity      Value    16 mb     5      Premium    16 mb     6      Value    4 mb     1      Premium    4 mb     2      Value    8 mb     -1  

 

That's it for now


Edited by altoid, 24 January 2017 - 19:54.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.

#43 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 25 January 2017 - 17:58

Hello Steve @altoid,

 

I fixed the stock error message in the sense that now qtpro doctor doesn't count negative stock neither for attribute stock nor for total product quantity when comparing.

This produced before the error.

Negative stock is allowed and correct if allow checkout is set to true. In an unmodified store stock result is also -1 if doing your example.

 

Please update with the actual GitHub files and check again:

- admin/includes/functions/qtpro_functions.php

- admin/includes/languages/english/stock.php

 

For the duplicated message, I couldn't recreate, is it possible that you have still the qtpro stock message modification in your admin/includes/template_top.php?

I also saw that in your GitHub repositorie's shopping_cart.php the change of Beta 5 isn't done:

      if (STOCK_CHECK == 'true') {
//++++ QT Pro: Begin Changed code
        if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
          $stock_check = check_stock_qtpro($products[$i]['id'], $products[$i]['quantity'], $products[$i]['attributes']); 
        } else {
          $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
        }
//++++ QT Pro: End Changed Code

in line 90 it must say: "check_stock_qtpro" not "tep_check_stock".

 

Make also sure to do all checkouts with cod or similar, not with paypal_standard. I'm still working on that support.

 

Thanks

Rainer



#44   altoid

altoid
  • Members
  • 1,405 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 25 January 2017 - 23:18

@raiwa

I'll update with what you advised and check things out on the test shop.

 

Regarding my repo, I apologize, I got backed up and haven't kept that up to date. I'll do that with files from your repo which should get it up where it needs to be.

 

Thanks for working on the QT Pro modification > BS.  It'll surely help folks out.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.

#45   altoid

altoid
  • Members
  • 1,405 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 26 January 2017 - 15:07

@altoid

I am updated from Github. 

Regarding that duplicate message, I don't see anything in admin/includes/template_top.php

 

Going through that again..when ordering a Value 8 MB card, where there is only one in inventory when completed over on the admin side when on the index.php page, I see just one notice:

 

Warning: There are 1 sick products in the database. Please visit the QTPro doctor.

 

It appears only with the catagories.php page, I see two notices now:

 

 Warning: There are 1 sick products in the database. Please visit the QTPro doctor

Warning: There are 1 sick products in the database. Please visit the QTPro doctor.

 

Seems something specific to categories.php?


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.

#46 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 26 January 2017 - 16:37

Hello Steve @altoid,

 

I just checked again:

- if you get the error message in admin/index.php, there must be the old code still in admin/template_top.php:

<?php //++++ QT Pro: Begin added code

$qtpro_sick_count = qtpro_sick_product_count();
if($qtpro_sick_count != 0){
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td class="messageStackWarning"><?php echo 'Warning: There are '. $qtpro_sick_count . ' sick products in the database. Please visit <a href="' . tep_href_link(FILENAME_QTPRODOCTOR) . '" class="headerLink">the QTPro doctor</a>.'; ?></td></tr></table>
<?php
}
//++++ QT Pro: End added code ?>

In the new version it should only be added to these files:

- admin/categories.php

- admin/products_attributes.php

- admin/stats_low_stock_attrib.php

between:

  require('includes/application_top.php');

and:

  require('includes/template_top.php');

In beta 05 it was also in admin/stock.php, but I removed it now, doesn't make sense there.

 

 

I did again a checkout with value 8MB stock set to 1 and purchasing 1 or 2 and I do not get an error message any more on my installation.

Stock result should be now 0 or -1, but no error message given.

Can you please double check.

 

thanks and rgds

Rainer



#47 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 26 January 2017 - 18:06

Steve, @altoid,

 

If you still get these errors, can you please make sure that your Git Hub repository is up to date with your test installation.

I'll then download tomorrow your complete files and try to reproduce on a local test inslallation with your files.

 

Thanks

Rainer



#48   altoid

altoid
  • Members
  • 1,405 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 26 January 2017 - 20:16

@raiwa

 

Found it

 

admin/includes/header.php

 

Got there from the original instructions it looks like.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.

#49 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 29 January 2017 - 16:04

Hello Steve @altoid, Scott @greasemonkey, Lionel @Lioelx, Joe @joe122joe and others,

 

Thanks for all your help. The Beta 06 final pre release is finished.

If you would like to give it a try.

Attached File  QTpro BS 5.0 beta_06.zip   189.1KB   7 downloads

 

Installation and Update instructions for 4.6.1 included.

 

rgds

Rainer



#50 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 31 January 2017 - 17:08

Final release uploaded:

http://addons.oscommerce.com/category

 

Changes versus Beta 06:

- added auto remove old configuration entries to product info options module when installed

- small fix in installation and update instructions for admin/products_attributes.php step 2.3.b

- spanish translations updated



#51   vampirehunter

vampirehunter
  • Members
  • 700 posts
  • Real Name:vampire

Posted 03 February 2017 - 16:33

is there any screenshots of this?



#52 ONLINE   beerbee

beerbee
  • Members
  • 13 posts
  • Real Name:Christoph
  • Gender:Male
  • Location:Berlin Germany

Posted 12 February 2017 - 21:54

Hello raiwa,

my playground shop is configured to redirect to shopping cart after adding a product, which didn't work from product_info.php after installing QTPro. There is little bit missing in application_top.php - it works now after adding:

$cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+1, $attributes);

}

$messageStack->add_session('product_action', sprintf(PRODUCT_ADDED, tep_get_products_name((int)$_POST['products_id'])), 'success');
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                          
//++++ QT Pro: End Changed Code
break;

Best regards

beerbee



#53 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 13 February 2017 - 12:07

Hello Christoph @beerbee,

 

Yes, this is missing in the code. I'll fix it asap and upload.

 

Thanks You!

 

rgds

Rainer



#54   Denzel

Denzel
  • Members
  • 59 posts
  • Real Name:Dennis
  • Gender:Male
  • Location:Berlin / Germany

Posted 16 February 2017 - 16:30

Hi @raiwa

 

recently I recognized that the qtpro_sick_product_count() function in header.php from my 2.3.4 BS Edge Shop with QTpro for osc 2.3 V4.6.1 takes 

about 30 seconds while loading my backend  :blink: I'm not sure when this problem occurs, maybe it was a creeping process. I have only 337 products 

with 19 tracked options in my shop.

Do you think that the problem disappears if I update to your 5.2 version ? Do you use the same functions ? I'm unsure to install the update...  B)

 

Thank you for helping me !

 

SEE YA

Denzel.



#55 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 1,769 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 16 February 2017 - 18:56

Hello Dennis @Denzel,

 

The only function which introduces a small update to avoid undefined errors is the qtpro_get_products_summary_stock function:

function qtpro_get_products_summary_stock($products_id) {
	$products_summary_stock_query = tep_db_query("SELECT products_quantity
											                          FROM products 
											                          WHERE products_id = '" . $products_id . "'");
	$product_facts = tep_db_fetch_array($products_summary_stock_query);
	if ($product_facts['products_quantity'] > 0) { //If they are negative they are oversold and this do not affect what we have on stock. added by @raiwa to avoid error if negative stock
	  return $product_facts['products_quantity'];
	} else {
	  return 0;
	}
}

All mods in other functions included in the admin qtpro functions file are hardcoded database table names, filenames and introducing language constants instead of hardcoded text for the messages. There are no essential script/programming changes elsewhere. So I can't promise that it will solve your problem.

 

rgds

Rainer