Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

14 hours ago, artfulweb said:

Hi Rainer,

I am sure there must be others like me who use QTPro not just for the stock handling but also for the fact that we can use options as images in multiple dropdowns, something that the Options as Images add-on can not do itself. It worked great on Frozen BS3 but for the life of me I can not get the attribute drop downs to show on Phoenix 1.0.2.2! The admin works great, it is just the drop downs on the store front that do not. As I do not think they are going to add this capability to the options it would be great to have a solution before scrapping the images (just text does not help the customer when there are sometimes 50+ colors in addition to regular text options like size. What do you think?

I'm very busy right now and have little time for the Addons Updates. I'll have a look on this how much is to do and see if I can find time to do it.

Link to comment
Share on other sites

  • 2 weeks later...

Uploaded version 6.0.0. for Phoenix 1.0.2.x:

https://apps.oscommerce.com/e317m&qtpro-bs

Change Log:
- updated for CE Phoenix 1.0.2.x
- replaced ht module by sitewide hook
- updated Options Images suport for v.1.6

Link to comment
Share on other sites

  • 3 months later...
On 1/21/2017 at 5:43 PM, raiwa said:

@@greasemonkey,

 

the mods in admin/includes/functions of the original instructions need to be applied. No way to avoid this.

 

for the database, please use the following update beta 03.

The database installation is included now in the product info module.

 

Beta 03

 

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

     

 

He @raiwa  thank you for updating this addon and your supporting it .. did you had any time to update stats_low_stock_attrib.php layout? I searched on the forum and I just find old topic  

Joe

Link to comment
Share on other sites

Hello @joe122joe,

I have anyway pending to do the update to the new bootstrapped admin page versions. I'll consider to include the suggestion for the attributes stock.

Thanks and best regards
Rainer

Link to comment
Share on other sites

  • 4 weeks later...

Hello @raiwa,

I am developing this site with Phoenix 1.0.4.0 with QTpro Phoenix 6.0.1

When I tried to Add to Cart (any items with options)  using single_dropdown or single_radioset display plugin,  the items does not appear in the cart.

Add to Cart worked correctly using multiple_dropdowns and sequenced_dropdowns. It also worked with item without options.

Is this compatibility issue? Any idea how to resolve this or where to look at? Thank you in advance.

Link to comment
Share on other sites

Hello @kanhsu,

Just checked on my develop store Phoenix 1.0.4.4 and all works like expected.

I tried with stock controlled attributes and uncontrolled attributes.

Maybe you have no stock defined/available for the attributes combination you tried. There is an option to awhich doesn't let add the product to cart if no stock is available.

Link to comment
Share on other sites

On 2/2/2020 at 9:54 PM, raiwa said:

Hello @kanhsu,

Just checked on my develop store Phoenix 1.0.4.4 and all works like expected.

I tried with stock controlled attributes and uncontrolled attributes.

Maybe you have no stock defined/available for the attributes combination you tried. There is an option to awhich doesn't let add the product to cart if no stock is available.

Hi @raiwa,

I redid the whole thing, looks like I made some mistakes combining the QTPro module and Wholesale module. Now everything works fine, Thank you very much for your time.

Link to comment
Share on other sites

3 hours ago, ce7 said:

@raiwa

Thank you very much for the addon. I installed on CE version. I also installed admin cost & margin, and get this warning:
Warning: constant(): Couldn't find constant MODULE_CONTENT_QTPRO_STOCK_BUTTON_ENGLISH in /home/mywebsite.com/admin/categories.php on line 1304


            //++++ QT Pro: Begin Changed code
            $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('categories.php', 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link('categories.php', 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product')) . tep_draw_button(IMAGE_MOVE, 'arrow-4', tep_href_link('categories.php', 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product')) . tep_draw_button(IMAGE_COPY_TO, 'copy', tep_href_link('categories.php', 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to')) . tep_draw_button(constant('MODULE_CONTENT_QTPRO_STOCK_BUTTON_' . strtoupper($language)), 'clipboard', tep_href_link('stock.php', 'product_id=' . $pInfo->products_id)));
            //++++ QT Pro: End Changed code 

how can I fix this warning?

Many thanks!  Lyn

You have to install the QtPro product options content module.

Instructions:

3a. [mandatory] In Admin =>Modules => Content[product_info] install and configure the module "QTPRO Options".
3b. [mandatory] In Admin =>Modules => Content[product_info] uninstall the core module "Options and Attributes".

Link to comment
Share on other sites

Hi @raiwa, thanks for this version of QTPro and all the support you provide!

I'm using osC 2.3.4 BS Gold with QTPro and everything is working well except for one thing: the product option / attribute values do not show up on the shopping cart page. It shows the correct number of dashes under the product name, where the option values should be, one dash per attribute, but the lines are empty (it only shows the dash "-"). The attribute values do show up properly on checkout_confirm.php so it must be a display problem of some sort.

I tried using the latest modified shopping_cart.php file from your github: https://github.com/raiwa/qtpro-5.0-BS/blob/master/Modified files for 2.3.4 BS/shopping_cart.php

And it gave me the same results: no values, just the dashes. The data is in the database, I'm using your original code... This is very bizarre and no doubt a problem with my specific setup.

How should I go about debugging that?? I'm not even sure where to start :)

You can take a look here, it's a live site: https://www.rollergirl.ca/skateshop

Add this product to your cart, select the two options: https://www.rollergirl.ca/skateshop/derby-laces-p-1956.html

See how the option values are not showing up?

Any clues would be greatly appreciated! Cheers!

Link to comment
Share on other sites

Hello Nicolas @cinolas,

Please use the correct version for GOLD. The latest Phoenix version is not compatible with GOLD

The highest available version for GOLD is the version included in QTpro CE Phoenix 6.0.0.

Please use the files in the folder "2.3.4.(1.) EDGE"

- check the modifications in the shopping cart section in includes/application_top.php
- check and remove temporary other third party modifications/addons

Sorry, I have no Gold test installation any more, so I can't give more specific advice. But I know that it works without problems with Gold.

rgds
Rainer

Link to comment
Share on other sites

Thanks @raiwa!

I'm a bit hesitant to mess with my QTPro installation since everything else is working fine. I looked at version 6.0 for EDGE and noticed in application_top.php that those modifications:

$attributes=array();
                                if (isset($_POST['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$_POST['attrcomb']))) {
                                  $attrlist=explode(',',$_POST['attrcomb']);
                                  foreach ($attrlist as $attr) {
                                    list($oid, $oval)=explode('-',$attr);
                                    if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
                                      $attributes[$oid]=$oval;
                                  }
                                }
                                if (isset($_POST['id']) && is_array($_POST['id'])) {
                                  foreach ($_POST['id'] as $key=>$val) {
                                    if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
                                      $attributes=$attributes + $_POST['id'];
                                  }
                                }
                                $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+1, $attributes);

use the $_POST variable, where in my application_top.php the variable used is $HTTP_POST_VARS. Is this a difference between Gold and Edge?

Just the same, I copied the code from your 6.0 application_top.php over and just changed $_POST for $HTTP_POST_VARS and it gave me the very same result: all the dashes are there, but no product attribute values.

If I wanted to re-install QTPro using your latest 6.0 files linked above, should I change $_POST for $HTTP_POST_VARS? Or should I use a different version that uses $HTTP_POST_VARS instead to match my application_top?

Cheers!

Link to comment
Share on other sites

There is no problem using $_POST.

I thought you were using the wrong Phoenix version.

If your version states it is for GOLD, there is no reason to update. Use all files and code from your original package.

I believe you have a problem with additional modifications or another add on you have in your store.

Revert temporary all other mods and try to find what produces the problem

 

Link to comment
Share on other sites

43 minutes ago, raiwa said:

Revert temporary all other mods and try to find what produces the problem

That would be a nightmare @raiwa, my installation is highly customized. I understand that the problem is in my customizations, and not in your code. As such, your help is beyond supporting your contribution. My problem is seemingly simple though: The attribute data is in the database, I just need to make it display on the page.

I placed a few var dumps on my page to see some traces, and when I add this line just after the stock check in shopping_cart.php:

echo '<pre>'; print_r($products[$i]['attributes']); echo '</pre>';

I get a nice array of all the attribute IDs for that product, but no text.

When I place that echo inside the attribute While loop:

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
        reset($products[$i]['attributes']);
        while (list($option, $value) = each($products[$i]['attributes'])) {
          echo '<pre>'; print_r($products[$i][$option]); echo '</pre>';
		  $products_name .= '<br /><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
        }
      }

I get empty arrays for each attribute. No text, nothing.

I took the SQL query that gets constructed just above for the attribute text and ran it directly on my database to see if it would pull the text:

<?php
    $any_out_of_stock = 0;
    $products = $cart->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// Push all attributes information in an array
      if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
        while (list($option, $value) = each($products[$i]['attributes'])) {
          echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);

		  $attributes = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                      from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                      where pa.products_id = '" . (int)$products[$i]['id'] . "'
                                       and pa.options_id = '" . (int)$option . "'
                                       and pa.options_id = popt.products_options_id
                                       and pa.options_values_id = '" . (int)$value . "'
                                       and pa.options_values_id = poval.products_options_values_id
                                       and popt.language_id = '" . (int)$languages_id . "'
                                       and poval.language_id = '" . (int)$languages_id . "'");
          $attributes_values = tep_db_fetch_array($attributes);

          $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
          $products[$i][$option]['options_values_id'] = $value;
          $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
          $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
          $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];

		  $products[$i][$option]['track_stock'] = $attributes_values['products_options_track_stock'];

        }
      }
    }
?>

Replaced the variables with specific IDs from my actual test item that's in my cart and not showing any attribute text:

select `popt`.`products_options_name` AS `products_options_name`,`popt`.`products_options_track_stock` AS `products_options_track_stock`,`poval`.`products_options_values_name` AS `products_options_values_name`,`pa`.`options_values_price` AS `options_values_price`,`pa`.`price_prefix` AS `price_prefix` from ((`products_options` `popt` join `products_options_values` `poval`) join `products_attributes` `pa`) where `pa`.`products_id` = '1941' and `pa`.`options_id` = '27' and `pa`.`options_id` = `popt`.`products_options_id` and `pa`.`options_values_id` = '1442' and `pa`.`options_values_id` = `poval`.`products_options_values_id` and `popt`.`language_id` = '1' and `poval`.`language_id` = '1'

And it pulled the text values just fine. I tried hardcoding the language ID in my shopping_cart.php and it gave me the same results. So it's not a language problem.

SO (and I do understand that this is no longer support for this contribution, but simply php help) IF the query is good, AND the data is in the DB, THEN the problem must be somewhere in these lines:

$attributes_values = tep_db_fetch_array($attributes);

          $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
          $products[$i][$option]['options_values_id'] = $value;
          $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
          $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
          $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];

		  $products[$i][$option]['track_stock'] = $attributes_values['products_options_track_stock'];

Those lines look fine... I would love to add an echo for $products[$i][$option]['products_option_name'] to see if it's blank, but my echo doesn't work there...

Again, I know that this is beyond the call of duty... still, any clues is still greatly appreciated, any debugging tips is gold  :D  thanks! 

Edited by cinolas
Link to comment
Share on other sites

35 minutes ago, cinolas said:

That would be a nightmare @raiwa, my installation is highly customized. I understand that the problem is in my customizations, and not in your code. As such, your help is beyond supporting your contribution. My problem is seemingly simple though: The attribute data is in the database, I just need to make it display on the page.

I don’t mean to revert on the whole site, only on the page where you have the issue. As you have it already quite localised, it shouldn’t bee so much. I can’t help you further not knowing your mods.

Link to comment
Share on other sites

Gotchya! So just modifications to shopping_cart.php, application_top.php and template_top.php?

Anything else I should clean up that could affect this?

Again, thank you so much for all the help. We would all be lost without people willing to help like you do.

Link to comment
Share on other sites

So I found what the problem was, or how to fix it anyway. I'll post it here in case it's of any use to anyone.

In shopping_cart.php around line 56 there's the line:

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

This is where my problem was. It wasn't doing the WHILE statement for some reason, even though that very same syntax is used around line 116 and that second instance of it works fine.

So the solution to my problem was to replace the first WHILE (around line 56) with a FOREACH statement. I don't know why this works when the WHILE doesn't, but it does for me:

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

And now my attributes display again. SOLVED!

Thanks for the help!

Link to comment
Share on other sites

6 hours ago, cinolas said:

So I found what the problem was, or how to fix it anyway. I'll post it here in case it's of any use to anyone.

In shopping_cart.php around line 56 there's the line:


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

This is where my problem was. It wasn't doing the WHILE statement for some reason, even though that very same syntax is used around line 116 and that second instance of it works fine.

So the solution to my problem was to replace the first WHILE (around line 56) with a FOREACH statement. I don't know why this works when the WHILE doesn't, but it does for me:


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

And now my attributes display again. SOLVED!

Thanks for the help!

This is unrelated to QtPro. It's related to other modifications in the file:

        while (list($option, $value) = each($products[$i]['attributes'])) {
		 if (2 == $customer_id) {	
			echo "inside SECOND while<br>";
		  }
		  $products_name .= '<br /><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
        }

The original core and qtpro code uses already "foreach..."

Link to comment
Share on other sites

  • 3 weeks later...
Link to comment
Share on other sites

  • 1 month later...
25 minutes ago, PiLLaO said:

Hi @raiwa

I'm getting an issue on checkout_process.php with the hook, seems to not be loaded.

To dismiss causes, is possible that after update hooks system cause this hook not load without a "fix"?

Regards

Which Phoenix version?

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