Jump to content



Photo
- - - - -

QTPro BS

qtpro attributes stock bs add-on update

  • Please log in to reply
54 replies to this topic

#1 ONLINE   raiwa

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

Posted 13 January 2017 - 17:00

QTPro BS 5.0

I'm working on a new version based on QTpro for osc 2.3 version 4.6.1 plus newer updates and fixes.

Planned Changes:

  • coding updates for latest 2.3.4 BS EDGE Community version with hardcoded filenames, database table names, paths and superglobals
  • content modules for product info, shopping cart
  • hooked modifications or separate functions where possible to avoid core file changes (stock checks etc in checkout pages)
  • final product prices shown in option/attribute combinations on product info page also for more than one option/combinations
  • general code clean up
  • language constants/definitions for all texts for full multilanguage support

To do list:

  1. update qtprodoctor.php
    hardcoded stuff, superglobals
    language constants/definitions
  2. update stats_low_stock_attrib.php
    hardcoded stuff, superglobals
    language constants/definitions
  3. update stock.php
    hardcoded stuff, superglobals
    language constants/definitions
  4. replace mods in admin/boxes/tools.php by separate file
  5. replace mods in admin/boxes/reports.php by separate file
  6. avoid mods in admin/includes/functions/general.php
    load function file in modules
    replace core function mods by own functions?
  7. modularize product info options
  8. modularize product info stock table
  9. versions for Modular Product Page by kymation
  10. alternative product listing module for modularized shopping cart
  11. order class extension to avoid mods in core order class
  12. replace all mods in checkout files by hooks?
  13. check compatibility with ajax attribute manager
  14. add support for attribute sort order
  15. update instructions

 

It would be great if there appear testers for the mods.

Who has the old version already installed:

- replace the admin files

- upload and install the product info content modules and (IMPORTANT!) uncomment the complete options/attributes section in product_info.php

 

For new installations:

- instructions are not updated yet

follow the old instructions except

A.: don't modify  admin/includes/boxes/tools.php and reports.php, upload the nwe files instead

B.: upload and install the product info content modules and (IMPORTANT!) uncomment the complete options/attributes section in product_info.php instead to apply the mods

 

Attached File  QTpro BS 5.0 beta_01.zip   61.39KB   9 downloads

 

Most important for now are the changes in the product info option modules to show final prices according to the option selection even if there are muliple option combinations (single drop down and single radios)

 

GitHub repository

 

Thanks and best regards

Rainer


Edited by raiwa, 13 January 2017 - 17:09.


#2 ONLINE   raiwa

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

Posted 13 January 2017 - 19:53

Oohps, forgot for the test update the most important:

- replace all pad class files

:)



#3   Lioelx

Lioelx
  • Members
  • 141 posts
  • Real Name:Lionel
  • Gender:Male
  • Location:Spain

Posted 13 January 2017 - 22:39

@raiwa i put a new compress folder on github whit spanish traslation, i dont know make a folder in github.

Regards


No external links here, thank you


#4   altoid

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

Posted 14 January 2017 - 14:37

@raiwa

will be testing on a new test install in uniserver, using the latest version of edge...


Edited by altoid, 14 January 2017 - 14:39.

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.

#5   altoid

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

Posted 15 January 2017 - 16:03

Decided to do this concurrently on a Github repo branch.

 

https://github.com/s...erce/tree/QTPro

 

Next up..working through instructions. We'll see how that goes.  :)


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.

#6   joe122joe

joe122joe
  • Members
  • 22 posts
  • Real Name:joe

Posted 15 January 2017 - 21:18

@raiwa Thank you
I have already qtpro 4.6 installed on oscommerce 2.3 edge ..
Is this addon requires the product info content module? or will work without it? I installed it Modular Product Page and it was hard to me to got it sorted, I mean about the content modules (image,price,product name...etc ) layout..

Joe



#7   altoid

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

Posted 16 January 2017 - 12:22

@raiwa Treating this as a new install on an up to day Edge test shop, the instructions code needs looked at closely and updated where hard coding, etc may be needed. Do you want me to send what I find that needs updated?


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.

#8 ONLINE   raiwa

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

Posted 16 January 2017 - 13:18

Hello Steve @altoid,

 

I didn't touch for now anything in the instructions and thought to leave this for the end when all new modules and modifications are done.

The instructions will need to be complete rewritten.

For now it would be just important to check the new modules and pad classes in product info.

Thanks

Rainer


Edited by raiwa, 16 January 2017 - 13:22.


#9 ONLINE   raiwa

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

Posted 16 January 2017 - 13:21

Helo @joe122joe,

 

This is a new development and in beta phase. It is supposed to be used in the 2.3.4 EDGE unmodified product info.

If you wish to test you'll need to adapt to your modularized product info.

If it's kymations modular produc tinfo you may wait until the apropiate modified module is done.

 

Please see the To Do list, only what is touched is already done.

 

rgds

Rainer



#10   altoid

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

Posted 17 January 2017 - 23:51

@raiwa

Still working on this on the Edge test shop.  As noted the instructions are out of date, so what I'm doing is changing them going along to better match Edge coding. Then I'm modifying files based on my instruction updates. This is the only way I see to do this for now.

I have the instruction changes in a branch.  I haven't yet pushed the changes, I'll do that if/when I get this done without screwing it up.


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.

#11   altoid

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

Posted 18 January 2017 - 23:06

@raiwa

Some questions re this step:

B.: upload and install the product info content modules and (IMPORTANT!) uncomment the complete options/attributes section in product_info.php instead to apply the mods

 

Modules installed and appear to be OK.

 

Not sure where to uncomment the complete options/attribute section?

 

I had to remove a curly bracket after updating product_info otherwise there was an error.

See here: https://github.com/s...d95ec7c65af0ad9

 

Also, around line 156, does that file path need modified?

  if(PRODINFO_ATTRIBUTE_DISPLAY_STOCK_LIST == 'True'): require("includes/modules/qtpro_stock_table.php"); endif;
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.

#12 ONLINE   raiwa

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

Posted 19 January 2017 - 08:54

Hello Steve @altoid,

 

You do not need to apply the QT Pro modifications from the old instructions to product_info.php.

Just comment out all the options/attributes section like this:

<div itemprop="description">
  <?php echo stripslashes($product_info['products_description']); ?>
</div>

<?php
/*
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['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) {
?>

    <h4><?php echo TEXT_PRODUCT_OPTIONS; ?></h4>

    <p>
<?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)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
      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)$_GET['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 . "'");
        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 (is_string($_GET['products_id']) && isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
          $selected_attribute = $cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']];
        } else {
          $selected_attribute = false;
        }
?>
      <strong><?php echo $products_options_name['products_options_name'] . ':'; ?></strong><br /><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'style="width: 200px;"'); ?><br />
<?php
      }
?>
    </p>

<?php
    }
*/
?>

    <div class="clearfix"></div>

All the coding in this part is done now in the module. That's why I said the instructions should be updated once all is done, a lot of the old instructions will be obsolete and removed.

 

I have all the updates for the shopping cart and checkout pages almost finished. Just need some more testing.

I'll try to upload that part in the next couple of days. Maybe It would be a good idea to fork your complete repository and apply all changes there.

 

Thanks

rgds

Rainer



#13   altoid

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

Posted 19 January 2017 - 15:29

@raiwa

OK, I think I have the product_info.php correct now. You'll have to bear with me, I'm 95% shop owner and 5% coder so sometimes I don't quite grasp right off exactly what's going on with the whys and wherefores of code application.

 

I have a couple forks going on this. One fork applying qtpro to edge.

https://github.com/s...e/commits/QTPro

 

Then another fork of your repo.

 

I've been updating the manual for my purposes while going along with the updates.  I just pushed changes to date here:

https://github.com/s...ebe0cef19e97f83


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.

#14   altoid

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

Posted 19 January 2017 - 16:41

OK

It's working on uniserver

Available Options and Currently on Stock table showing in listing.

 

Able to modify option tracking and quantity in admin.

 

Adding tracked product to cart works.

 

Trying to add more option quantity in the cart than actually are on stock generated warning message.


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.

#15   greasemonkey

greasemonkey
  • Members
  • 1,006 posts
  • Real Name:Scott
  • Gender:Male

Posted 19 January 2017 - 18:13

@raiwa Hi Rainer, I'm going to start testing this shortly.

Scott

#16 ONLINE   raiwa

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

Posted 19 January 2017 - 18:41

@greasemonkey, @altoid,

 

I have all updates for the store side on the point. Just trying to fix a small bug for attribute stock adjust on checkout.

 

 

rgds

Rainer



#17 ONLINE   raiwa

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

Posted 20 January 2017 - 18:29

Beta 02

 

To do list:

  1. update qtprodoctor.php
    hardcoded stuff, superglobals
    language constants/definitions
  2. update stats_low_stock_attrib.php
    hardcoded stuff, superglobals
    language constants/definitions
  3. update stock.php
    hardcoded stuff, superglobals
    language constants/definitions
  4. replace mods in admin/boxes/tools.php by separate file
  5. replace mods in admin/boxes/reports.php by separate file
  6. avoid mods in admin/includes/functions/general.php
    load function file in modules
    replace core function mods by own functions?
  7. modularize product info options
  8. modularize product info stock table
  9. versions for Modular Product Page by kymation
  10. alternative product listing module for modularized shopping cart
  11. order class extension to avoid mods in core order class
  12. replace all mods in checkout files by hooks?
  13. check compatibility with ajax attribute manager
  14. add support for attribute sort order
  15. update instructions

 

Beta 02 installation

Who has the old version already installed:

  • replace the admin files

  • upload and install the product info content modules and (IMPORTANT!) uncomment the complete options/attributes section in product_info.php

  • upload all other files included in the "new files" directory
  • replace all pad class files
  • undo all modifications of the old version in:

    • includes/classes/orders.php
    • includes/functions/general.php
    • checkout_payment.php
    • checkout_confirmation.php
    • checkout_process.php

    use the files included in: "Modified files for 2.3.4 BS" or compare and apply the changes. (hook registry and hook calls)

    • keep the modifications in includes/application_top.php
    • keep the modifications in shopping_cart.php or use the included content module "product listing qtpro" instead of "product listing" for the modularized shopping cart. If you do not have the latest EDGE version with hooks support: Use the included application_top.php and copy: legacy/includes/classes/hooks.php

For new installations:

  • instructions are not updated yet

follow the old instructions except

A.: don't modify admin/includes/boxes/tools.php and reports.php, upload the new files instead

B.: upload and install the product info content modules and (IMPORTANT!) uncomment the complete options/attributes section in product_info.php instead to apply the mods

C.: apply only the modification to: - includes/application_top.php - shopping_cart.php if not modularized or use the included content module "product listing qtpro" instead of "product listing" for the modularized shopping cart.

use the files included in: "Modified files for 2.3.4 BS" or compare and apply the changes. (hook registry and hook calls)

  • checkout_payment.php
  • checkout_confirmation.php
  • checkout_process.php

    If you do not have the latest EDGE version with hooks support: Use the included application_top.php and copy: legacy/includes/classes/hooks.php

 

Steve @altoid I'll try to fork and update via pull request your repository, so it should be easier for all to test. Give me a couple of days.

 

Scott @greasemonkey, if you wish to give it a try now, please go ahead.

 

Attached File  QTpro BS 5.0 beta_02.zip   91.59KB   2 downloads

 

 

What should be tested:

Complete checkout with different product combinations and stock settings.

Redirects from checkout pages if cno stock and checkout not allowed

Downloadable products

Check stock quantities updates when an order is done.

...................whatever you can imagine.

 

There are heavy changes for all the checkout, so hardcore tests required o:) :- :thumbsup:

 

Thanks and best regards

Rainer



#18   greasemonkey

greasemonkey
  • Members
  • 1,006 posts
  • Real Name:Scott
  • Gender:Male

Posted 20 January 2017 - 20:34

@raiwa I'll try and get to this this weekend.... I hadn't installed the first beta yet (other than dropping the new files in... so good timing).



#19   altoid

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

Posted 21 January 2017 - 00:20

@raiwa

I installed beta 2 and notwithstanding any mistakes, here's what I see:

 

- WARNING_SICK_PRODUCTS in /admin/qtprodoctor.php  Did I miss a language define somewhere?

 

- Just an FYI, but in php 7 for various files I am seeing this type error:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

php 5.6 is OK

 

- in configuration, admin/configuration.php?gID=888001 for QT pro, it seems at least some of the settings are not used now and this is done now in the module setting instead?

 

- for and item I have one of the option values set to zero.  Example, Memory 4 mb =2, 8 mb=0 and 16 mb 06.  In the content module I have this setting:

Show Out of Stock Attributes
False

 

Yet in the product display, the 8 MB still shows.  How is that supposed to show?

 

Then over in the stock report, 8 MB is not showing at all for that product, where as 4 and 16 are.  I was thinking perhaps it would be better to show at zero than not showing at all..

 

That's it for now.


Edited by altoid, 21 January 2017 - 00:23.

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.

#20 ONLINE   raiwa

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

Posted 21 January 2017 - 10:19

Hello Steve @altoid,
 

- WARNING_SICK_PRODUCTS in /admin/qtprodoctor.php  Did I miss a language define somewhere?

 
Yes this is not documented, please add for now these definitions to admin/includes/languages/english.php:

// QTPro Begin
define('WARNING_SICK_PRODUCTS', 'Sick products in the database:');
define('WARNING_PRODUCT_ID', 'Product with ID ');
define('WARNING_PRODUCT_DATABASE_ENTRY_SUMMARY', 'The database entries for this products stock is messy and the summary stock calculation is wrong. Please take a look at this ');
define('WARNING_PRODUCTS_STOCK', 'products stock');
define('WARNING_PRODUCT_SUMMARY_STOCK', 'The summary stock calculation is wrong. Please take a look at this ');
define('WARNING_PRODUCT_DATABASE_ENTRY', 'The database entries for this products stock is messy. Please take a look at this ');
define('WARNING_PRODUCT_OK', 'This product is all ok.');

It will be solved in another way later.
 

- Just an FYI, but in php 7 for various files I am seeing this type error:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
php 5.6 is OK

2.3.4 BS is not prepared for php7, the errors should be produced by core files/modules. As far as I know I prepared the add-on files/modules for php7.
Anyway it does the trick for now to run under php5.6.
 

- in configuration, admin/configuration.php?gID=888001 for QT pro, it seems at least some of the settings are not used now and this is done now in the module setting instead?

All configuration entries are now in the product info module, the old ones in admin/configuration have no effect. They are installed running the old sql query for now, but the next step is to integrate all database installation/update queries into the product info module.
 

- for and item I have one of the option values set to zero. Example, Memory 4 mb =2, 8 mb=0 and 16 mb 06. In the content module I have this setting:
Show Out of Stock Attributes
False

Yet in the product display, the 8 MB still shows. How is that supposed to show?

I'll have a look at this, it's supposed it should not show there.
 

Then over in the stock report, 8 MB is not showing at all for that product, where as 4 and 16 are. I was thinking perhaps it would be better to show at zero than not showing at all..

Yes, the display seems to be a bit buggy, sometimes 0 stocked attributes show, sometimes they do not show. I'll have a look at this.
Anyway if you add a quantity>0 it shows.

Thanks and kind regards
Rainer