Jump to content

Recommended Posts

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?

Share this post


Link to post
Share on other sites

That is the problem 😂, I'm updagring without order and is possible that this is the problem.

I checked using system/versioned/1.0.4.5 and 1.0.5.7 but I don't know when began my issue.

Share this post


Link to post
Share on other sites

I found the problem, missing code while updating hooks system :blush:

Share this post


Link to post
Share on other sites
Posted (edited)

I'm having a problem with QTPro (on osC 2.34 BS Gold) where the attributes show in the drop down even though there is no stock. In fact, none of the options in Configuration > Prod Info (QTPro) seem to have an effect. Is this a known symptom for something? Anyone even seen that? Where should I dig to find the problem?

Once in the cart it does show out of stock, and prevents checkout, but it's annoying for our customers to get this far only to find out there's no stock. Everything else seems to be working fine as far as I can tell.

Any clues are greatly appreciated. Cheers!

Edited by cinolas

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, cinolas said:

I'm having a problem with QTPro (on osC 2.34 BS Gold) where the attributes show in the drop down even though there is no stock. In fact, none of the options in Configuration > Prod Info (QTPro) seem to have an effect. Is this a known symptom for something? Anyone even seen that? Where should I dig to find the problem?

Once in the cart it does show out of stock, and prevents checkout, but it's annoying for our customers to get this far only to find out there's no stock. Everything else seems to be working fine as far as I can tell.

Any clues are greatly appreciated. Cheers!

I have no BS GOLD store any more for testing, but you should get this solved in the QTPRO Options product_info module with the following settings correct set for your needs:

Show Out of Stock Attributes:

Prevent Adding Out of Stock to Cart:

Display Out of Stock Message Line:

Edited by raiwa

Share this post


Link to post
Share on other sites

Thanks @raiwa, though all I'm seeing in your post is this:

 

Show Out of Stock Attributes:

Prevent Adding Out of Stock to Cart:

Display Out of Stock Message Line:

Share this post


Link to post
Share on other sites
6 hours ago, raiwa said:

I have no BS GOLD store any more for testing, but you should get this solved in the QTPRO Options product_info module with the following settings correct set for your needs:

Show Out of Stock Attributes:

Prevent Adding Out of Stock to Cart:

Display Out of Stock Message Line:

 

Share this post


Link to post
Share on other sites

I mean I have all these settings set to correctly, but it's not happening the way it should. The settings are ignored.

Share this post


Link to post
Share on other sites

Even if I just set "Display table with stock information" it doesn't display the table.

Share this post


Link to post
Share on other sites

If you are using QtPro BS:

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

The settings are in: Admin : Modules : Content : QTPRO Options

The settings you show in Admin : Configuration are from an older version you have still in your database, but they are deprecated.

If you are using an older QtPro version, you should update.

Share this post


Link to post
Share on other sites

Please see also Instructions:

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

4. [optional] In Admin =>Modules => Content[product_info] install and configure the module "QT Pro Stock Table".

Share this post


Link to post
Share on other sites
Posted (edited)

Update uploaded:

QTpro Phoenix 7.0.0

Only one core file change left (modified file provided):

  • includes/actions/add_product.php

 

Changes versus QTpro 6.0.1 BS

  • updated for CE Phoenix 1.0.7.x
  • hooked all modifications on admin side
  • bootstrapped all admin pages and hooks
  • hooked all changes on store checkout
  • fixed error in order delete restock function
  • added pi modules
  • updated all store side modules to abstract modules
  • general update to match actual core coding style

 

NOTE: Options Images support is not included in this version. It will be added again once it has been updated.

 

Edited by raiwa

Share this post


Link to post
Share on other sites
Posted (edited)

Update uploaded:

QTpro Phoenix 7.1.0

Requires Phoenix 1.0.7.4+

Core changes:
NONE

Changes versus QTpro 7.0.0:

- updated for CE Phoenix 1.0.7.4+
- moved add_product action to system/override

NOTE: Options Images support is not included in this version. It will be added again once it has been updated.

 

Edited by raiwa

Share this post


Link to post
Share on other sites

Update uploaded:

QTpro Phoenix 7.2.0

Requires Phoenix 1.0.7.4+

Core changes:
NONE

Changes versus QTpro 7.1.0

  • updated all javascripts
  • cleaned up code
  • fixed out od stock message in multiple drop downs to display
  • fixed some minor errors

 

NOTE: Options Images support is not included in this version. It will be added again once it has been updated.

Share this post


Link to post
Share on other sites

Are you sure it has not been moved to templates/default/includes/hooks/shop/sitewide which is where many of the hooks are now placed.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites
5 minutes ago, 14steve14 said:

Are you sure it has not been moved to templates/default/includes/hooks/shop/sitewide which is where many of the hooks are now placed.

Yes it's there. The error message threw me off. I got distracted. Thank you.

Share this post


Link to post
Share on other sites

Thanks @raiwa !

It took some time but I just attempted to install QTPro 6.0.0 for 2.3.4 EDGE, GOLD, etc

The installation was mostly successful, but when I was done the shopping_cart.php page wasn't working, everything else seemed fine. I reverted to backup and tried again, but it gave me the same results. The shopping cart page would end abruptly after the <tbody> tag:

...
<form name="cart_quantity" action="https://www.rollergirl.ca/skateshop/shopping_cart.php?action=update_product" method="post">
<div class="contentContainer">
  <div class="contentText">


    <table class="table table-striped table-condensed">
      <tbody>

Does that look like something obvious I may have missed? Or where should I look first to try to oust this bug?

This is my actual shopping_cart.php after installing QTPro 6.0.0 if that helps:

<?php
/*
  $Id$

  Modified for:
  QTpro
  Version 5.0 BS 
  by @raiwa 
  info@oscaddons.com
  www.oscaddons.com

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com


  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  require("includes/application_top.php");

  if ($cart->count_contents() > 0) {
    include(DIR_WS_CLASSES . 'payment.php');
    $payment_modules = new payment;
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));

  require(DIR_WS_INCLUDES . 'template_top.php');
?>

<div class="page-header">
  <h1><?php echo HEADING_TITLE; ?></h1>
  <p>Please verify that you have selected the correct <strong>sizes, colours</strong> and <strong>other options</strong>
before checking out.<br />Orders for which we have all the info ship faster :)</p>
</div>

<?php
  if ($messageStack->size('product_action') > 0) {
    echo $messageStack->output('product_action');
  }
?>

<?php
  if ($cart->count_contents() > 0) {
?>

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>

<div class="contentContainer">
  <div class="contentText">

<?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);
		  //++++ QT Pro: Changed Code $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
          $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'];
		//++++ QT Pro: Changed Code
          $products[$i][$option]['track_stock'] = $attributes_values['products_options_track_stock'];
			//End QT Pro
		  
        }
      }
    }
?>

    <table class="table table-striped table-condensed">
      <tbody>
<?php
    $products_name = NULL;
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
		
      $products_name .= '<tr>';

      $products_name .= '  <td valign="top" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
                        '  <td valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a>';

      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
        if (tep_not_null($stock_check)) {
          $any_out_of_stock = 1;

          $products_name .= $stock_check;
        }
      }

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

      $products_name .= '<br>' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'style="width: 45px;"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . ' ' . tep_draw_button(NULL, 'glyphicon glyphicon-refresh', NULL, NULL, NULL, 'btn-info btn-xs') . ' ' . tep_draw_button(NULL, 'glyphicon glyphicon-remove', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&action=remove_product'), NULL, NULL, 'btn-danger btn-xs');

      $products_name .= '</td>';

      $products_name .= '  <td align="right" valign="top"><strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong></td>' .
                        '</tr>';
    }
    echo $products_name;
?>

      </tbody>
    </table>

    <p class="text-right"><strong><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></strong></p>

<?php
    if ($any_out_of_stock == 1) {
      if (STOCK_ALLOW_CHECKOUT == 'true') {
?>

    <div class="alert alert-warning"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>

<?php
      } else {
?>

    <div class="alert alert-danger"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>

<?php
      }
    }
?>

  </div>

  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'glyphicon glyphicon-chevron-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success'); ?></div>
  </div>

<?php /* NIC removed to hide PayPal Express button from cart
    $initialize_checkout_methods = $payment_modules->checkout_initialization_method();

    if (!empty($initialize_checkout_methods)) {
?>
  <div class="clearfix"></div>
  <p class="text-right"><?php echo TEXT_ALTERNATIVE_CHECKOUT_METHODS; ?></p>

<?php
      reset($initialize_checkout_methods);
      while (list(, $value) = each($initialize_checkout_methods)) {
?>

  <p class="text-right"><?php echo $value; ?></p>

<?php
      }
    }
*/ ?>

</div>

</form>
<!-- NIC added shipping in cart -->
<div class="row">
  <?php echo $oscTemplate->getContent('shopping_cart'); ?>
</div>
<!-- NIC added shipping in cart -->
<?php
  } else {
?>

<div class="alert alert-danger">
  <?php echo TEXT_CART_EMPTY; ?>
</div>

<p class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', tep_href_link(FILENAME_DEFAULT), 'primary', NULL, 'btn-danger'); ?></p>

<?php
  }

  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Any help is gold! Cheers!

Share this post


Link to post
Share on other sites

I forgot to mention. I had QT Pro 4.6.1 installed on my 2.3.4 BS GOLD so I followed the instructions for 4.6.1 to 5.0, then (if any) 5.0 to 5.1, 5.1 to 5.2, etc... up to 5.5.3.

The only discrepancy I've found was the mention to upload and replace some AJAX Attribute Manager files (which I am using):

Quote

If you are using Ajax ttribute Manager add-on:

admin/attributeManager/classes/attributeManagerInstant.class.php

admin/attributeManager/attributeManager.php

But those files were not provided in the package I got. The Ajax manager seemed to work fine just the same.

But my shopping cart is broken. Any insights are greatly appreciated!

Edited by cinolas

Share this post


Link to post
Share on other sites

Hello @cinolas,

I can't see anything wrong in the code. I'm sorry I have no BS GOLD test shop any more installed and GOLD support is not available any more.

Please check for error messages (switch error reporting on) and/or try removing code until you find the snippet which produces the problem.

You could also try with the provided modified shopping cart file instead to modify yours.

Share this post


Link to post
Share on other sites

Thanks for looking @raiwa! I understand that Gold isn't supported anymore and I appreciate you taking the time to help. I tried again this morning and got the same result, but I dug a little deeper to try and understand what is happening wrong. I tried using the provided modified shopping_cart.php and it gave me the same result.

How do I turn on error reporting?

I'm sure that would help (I didn't even know that was a thing!)

My shopping_cart page stops after:


    <table class="table table-striped table-condensed">
      <tbody>

So it looks like the problem occurs while building the $products_name variable...

Cheers!

Share this post


Link to post
Share on other sites

I found this error in my logs:

[09-Sep-2020 06:10:38 America/Vancouver] PHP Fatal error:  Call to undefined function check_stock_qtpro() in /chroot/home/roller/rollergirl.ca/html/skateshop/shopping_cart.php on line 101

That looks like a good reason for my shopping_cart to fail lol.

In which file should this function be defined?

Share this post


Link to post
Share on other sites

Sorry, should've looked harder... I found the definition in qtpro_hooks.php so I'm guessing the hook isn't happening. I will investigate, but any tips you may have is greatly appreciated.

Share this post


Link to post
Share on other sites

Make sure you have the hooks class copied:

from:

[legacy-hooks-class]/includes/classes/hooks.php

to:

includes/classes/hooks.php

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×