Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

No it is not possible if you mean sort the products by products_options_values_name .

It would need a mayor rewrite.

Link to comment
Share on other sites

  • 1 month later...

@raiwa Great job on this one. I'm getting a duplicate error for the function tep_values_name when installing one of the modules. It is declared in the admin's general.php and in the table module. I renamed the function to tep_values_name_shop in the table module since, I think, that is the only place it is used. Just letting you know.

The shop I'm installing this into has about 2,000 sick products. I seem to recall a script in one of the older versions that fixed all of those in one go. Did you code such an option into this one?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello,

After adding new files...I was getting this error on the admin side.

This page isn’t working

www.mysite.com is currently unable to handle this request.

HTTP ERROR 500

by removing

includes/modules/content/product_info/cm_pi_qtpro_table.php

I am again able to access the admin side.

Also, instructions show

includes/languages/english/modules/content/product_info_options/

The provided new files are in: 

includes\languages\english\modules\content\product_info

This is for the CE version.

Thank you

 

Edited by altoid

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.

Link to comment
Share on other sites

Hello Jack @Jack_mcs,

Thanks for the reports.

11 hours ago, Jack_mcs said:

I'm getting a duplicate error for the function tep_values_name when installing one of the modules. It is declared in the admin's general.php and in the table module. I renamed the function to tep_values_name_shop in the table module since, I think, that is the only place it is used. Just letting you know.

I would recommend to wrap "function_exists" around the "tep_values_name" function in the table module:

  /*Copied from admin functions*/
  if(!function_exists('tep_values_name')) {
    function tep_values_name($values_id) {
      global $languages_id;
  
      $values = tep_db_query("select products_options_values_name from products_options_values where products_options_values_id = '" . (int)$values_id . "' and language_id = '" . (int)$languages_id . "'");
      $values_values = tep_db_fetch_array($values);
  
      return $values_values['products_options_values_name'];
    }
  }

I'll fix this in the next update.

12 hours ago, Jack_mcs said:

The shop I'm installing this into has about 2,000 sick products. I seem to recall a script in one of the older versions that fixed all of those in one go. Did you code such an option into this one?

I guess it is the following: when you install the qtpro add-on and activate "track stock" for some options in Products Attributes, it throws this error for all products which are using these options.

You need to enter stock quantities for all products for at least one option/attribute combination.

I do not remember any script in the old version which I used as a starting point for my package. I also can't imagine how to do this, other than to automatic enter a ficticious stock quantitity which doesn't make sense for me. If we want to control options/attributes stock, the quantity should match the real stock, or do I miss something?

Thanks again and best regards

Rainer

Link to comment
Share on other sites

5 hours ago, altoid said:

After adding new files...I was getting this error on the admin side.

This page isn’t working

www.mysite.com is currently unable to handle this request.

HTTP ERROR 500

by removing

includes/modules/content/product_info/cm_pi_qtpro_table.php

I am again able to access the admin side.

I believe it's the same reason Jack posted above, the "tep_values_name" function is duplicated. please apply the fix I posted in the above message to the table module: includes/modules/content/product_info/cm_pi_qtpro_table.php

5 hours ago, altoid said:

The provided new files are in: 

includes/languages/english/modules/content/product_info_options/

Thanks for the report, I'll fix it also in the next update.

Link to comment
Share on other sites

Link to comment
Share on other sites

6 hours ago, raiwa said:

I believe it's the same reason Jack posted above, the "tep_values_name" function is duplicated. please apply the fix I posted in the above message to the table module: includes/modules/content/product_info/cm_pi_qtpro_table.php

Thanks for the report, I'll fix it also in the next update.

Also noticed in the instructions for CE Frozen:

admin/includes/qtprodoctor.php

admin/includes/stats_low_stock_attrib.php

admin/includes/stock.php

However in the new files provided they are located in admin/

And in instructions:

includes/hooks/shop/qtpro/qtpro_hooks.php

However in the new files provided the path is

catalog\includes\hooks\shop\checkout_process

Thx...Steve K

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.

Link to comment
Share on other sites

Link to comment
Share on other sites

Hello,  I'm using modular shopping cart.

Do we need a language file for

includes/modules/content/shopping_cart/cm_sc_product_listing_qtpro.php

Thx...Steve K

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.

Link to comment
Share on other sites

26 minutes ago, altoid said:

Hello,  I'm using modular shopping cart.

Do we need a language file for

includes/modules/content/shopping_cart/cm_sc_product_listing_qtpro.php

Thx...Steve K

Meaning in the instructions area.

 

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.

Link to comment
Share on other sites

Suggestion...in the instructions:

2.7a. shopping_cart.php

NOTE: If you are using modular shopping cart, just uninstall the original "cm_sc_product_listing.php" module and install "cm_sc_product_listing_qtpro.php" module instead. In that case you do not need to apply the following modifications

I suggest adding something like

If have enabled the modular shopping cart "options and attribute" module, you should uninstall that after adding QT Pro.

 

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.

Link to comment
Share on other sites

5 hours ago, altoid said:

If have enabled the modular shopping cart "options and attribute" module, you should uninstall that after adding QT Pro.

@altoid, where is this module from, it is not part of the modular shopping cart add-on..

Link to comment
Share on other sites

2 hours ago, raiwa said:

@altoid, where is this module from, it is not part of the modular shopping cart add-on..

Looking closer, it's actually a core module.

Content>product_info

After the QT pro install, I had two product and attribute drop downs showing. So I figured out I need to disable the core one.

Sorry that was off, but it probably should be mentioned in the instructions to disable the core module as it's not needed with QT pro.

Does that make sense?

 

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.

Link to comment
Share on other sites

Might have found another issue.

In modules>content>QTPro Options

With this setting:

Use Actual Price Pull Downs
True

The drop down is not adding the increased cost of an attribute, but rather all attributes are showing the same base price.

For example if small size is $10 and medium is supposed to be $12 and large $14, they all show 10

If I set the above to false, the attributes indicate correctly what the additional cost is for attributes.

I am using the single drop down 

Product Info Attribute Display Plugin
single_dropdown

 

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.

Link to comment
Share on other sites

Hello Steve @altoid,

Yes this error has been already introduced in version 5.4.

Please find in includes/classes/pad_base.php line 406-408:

            $newprice = ((int)$price - (int)$attrib['data-price']);
          } else {
            $newprice = ((int)$price + (int)$attrib['data-price']);

and change to:

            $newprice = ((int)$price - (int)$attrib['price']);
          } else {
            $newprice = ((int)$price + (int)$attrib['price']);

Please confirm and I'll upload a new version with all fixes

Link to comment
Share on other sites

2 hours ago, raiwa said:

Hello Steve @altoid,

Yes this error has been already introduced in version 5.4.

Please find in includes/classes/pad_base.php line 406-408:


            $newprice = ((int)$price - (int)$attrib['data-price']);
          } else {
            $newprice = ((int)$price + (int)$attrib['data-price']);

and change to:


            $newprice = ((int)$price - (int)$attrib['price']);
          } else {
            $newprice = ((int)$price + (int)$attrib['price']);

Please confirm and I'll upload a new version with all fixes

This fix worked.

I'm using PP express and with a couple test sessions all seems good with QTPro.

  Thanks much.  

Steve K

 

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.

Link to comment
Share on other sites

@Jack_mcs and other coders.

I found that the _build_attributes_combinations function works correct up to PHP 7.1, buit in PHP 7.2 produces duplicated entries in the attributes array (single drop down and radio).

Example:

PHP 7.2:

image.png.f86da35b578f948da0e1a627e6064e47.png

PHP 7.1:

image.png.6c608b78543935289f0eaa265a379866.png

I couldn't find the problem/fix.

Could you have a look if you see something which should be updated for PHP7.2:

    function _build_attributes_combinations($attributes, $showoos, $markoos, &$combinations, &$selected_combination, $oidindex=0, $comb=array(), $id="", $text='', $isselected=true, $price='', $image=array()) {
      global $cart, $currencies;
      foreach ($attributes[$oidindex]['ovals'] as $attrib) {
        $newcomb = $comb;
        $newcomb[$attributes[$oidindex]['oid']] = $attrib['id'];
        $newid = $id.','.$attributes[$oidindex]['oid'].'-'.$attrib['id'];
        $newtext = $text.", ".$attrib['text'];
        $newprice = $price;
        // product optionsimages support
        $newimage = $image;        
        if ($this->options_images) {
          $newimage[] .= $attrib['image'];
        }
        
        if(MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_ATTRIBUTE_ACTUAL_PRICE_PULL_DOWN == 'True') {
          if ($attrib['prefix'] == '-') {// in case price lowers, don't add values, subtract.
            $newprice = ((int)$price - (int)$attrib['price']);
          } else {
            $newprice = ((int)$price + (int)$attrib['price']);
          }
        }
        if (isset($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']])) {
          $newisselected = ($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']] == $attrib['id']) ? $isselected : false;
        } else {
          $newisselected = false;
        }
        if (isset($attributes[$oidindex+1])) {
          $this->_build_attributes_combinations($attributes, $showoos, $markoos, $combinations, $selected_combination, $oidindex+1, $newcomb, $newid, $newtext, $newisselected, $newprice, $newimage);
        } else {
          $is_out_of_stock = $this->check_stock_qtpro(tep_get_prid($this->products_id),1,$newcomb);
          if ( !$is_out_of_stock || ($showoos == true) ) {
            if(MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_ATTRIBUTE_ACTUAL_PRICE_PULL_DOWN == 'True') {
              $combprice = ' ' . $currencies->display_price( $newprice + $this->products_original_price, tep_get_tax_rate($this->products_tax_class_id));
            } else {
              $combprice = null;
            }
            switch ($markoos) {
              case 'Left':   $newtext=($is_out_of_stock ? MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_OUT_OF_STOCK . ' - ' : '') . substr($newtext,2) . $combprice;
                             break;
              case 'Right':  $newtext=substr($newtext,2) . $combprice . ($is_out_of_stock ? ' - ' . MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_OUT_OF_STOCK : '');
                             break;
              default:       $newtext=substr($newtext,2) . $combprice;
                             break;
            }
            // product optionsimages support
            if ($this->options_images) {
              $combinations[] = array('comb'=>$newcomb, 'id'=>substr($newid,1), 'text'=>$newtext, 'image'=>$newimage);
            } else {
              $combinations[] = array('comb'=>$newcomb, 'id'=>substr($newid,1), 'text'=>$newtext);
            }
            if ($newisselected) $selected_combination = sizeof($combinations)-1;
          }
        }
      }
    }

Thanks in advance

Rainer

image.png

Edited by raiwa
Link to comment
Share on other sites

@raiwa

Live shop. PHP 7.2.7

image.png.f65b59ac649a389ed274847099cb3646.png

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.

Link to comment
Share on other sites

@JcMagpie, @Tsimi, @altoid,

Thanks for the time to test. You are right, all good on a fresh new installation.

My PHP 7.2 develop-test store's configuration entries were corrupted.

New version 5.6.2. with the last fixes uploaded

Best regards

Rainer

Link to comment
Share on other sites

With error reporting set to all I see this error

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/barkav5/public_html/includes/modules/content/shopping_cart/cm_sc_product_listing_qtpro.php on line 62

Running php 7.2.7

 

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.

Link to comment
Share on other sites

@altoid, thanks for the report.

Please modify in cm_sc_product_listing_qtpro.php:

find line 62:

	  			while (list($option, $value) = each($products[$i]['attributes'])) {

replace by:

	  		  foreach($products[$i]['attributes'] as $option => $value) {

find line 108-109:

        	reset($products[$i]['attributes']);
        	while (list($option, $value) = each($products[$i]['attributes'])) {

replace by:

          foreach($products[$i]['attributes'] as $option => $value) {

Please confirm. I'll do some more checks and upload then the new version with the fixes.

Meanwhile I found the reason for the duplicated entries in the single drop down: I had the option images support added, but no images uploaded, the duplicated entries were the alt text for the images. I modified the code so image calls are only included if images exist to avoid this error. It will also be included in the next update.

Edited by raiwa
Link to comment
Share on other sites

5 hours ago, raiwa said:

@altoid, thanks for the report.

Please modify in cm_sc_product_listing_qtpro.php:

find line 62:


	  			while (list($option, $value) = each($products[$i]['attributes'])) {

replace by:


	  		  foreach($products[$i]['attributes'] as $option => $value) {

find line 108-109:


        	reset($products[$i]['attributes']);
        	while (list($option, $value) = each($products[$i]['attributes'])) {

replace by:


          foreach($products[$i]['attributes'] as $option => $value) {

Please confirm. I'll do some more checks and upload then the new version with the fixes.

Meanwhile I found the reason for the duplicated entries in the single drop down: I had the option images support added, but no images uploaded, the duplicated entries were the alt text for the images. I modified the code so image calls are only included if images exist to avoid this error. It will also be included in the next update.

After making the change for line 62 I get this error:

Parse error: syntax error, unexpected '$products_name' (T_VARIABLE) in /home/Username/public_html/includes/modules/content/shopping_cart/cm_sc_product_listing_qtpro.php on line 63

 

 

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.

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