Yo tengo una actualización llamada QTPro 3.2
En la versión 4.4 agregaron una tabla que me sirve mucho asi los clientes ven de una vez los productos disponibles. No puedo instalar la version 4.4 porque no anda con las otras contribuciones que instalé. Estuve viendo y hay un archivo que es el que genera la tabla qtpro_stock_table.php
Le saqué una linea ya que tiene una función que mi versión no la tiene
AND popt.products_options_track_stock = '1'
despues la incluyo en product_info.php
<?php require(DIR_WS_MODULES . "qtpro_stock_table.php");?>
pero solo aparece el título STOCK_LIST_IN_PI_TEXT_HEADING
Alguien solidario me podrá ayudar a modificar el archivo? Les copio el codigo del archivo en cuestion y la parte del product_info para ver que es lo que no compatibiliza. Espero que me puedan ayudar, gracias.
Product info:
Código PHP:
<?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)$HTTP_GET_VARS['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) {
?>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
</tr>
<?php
$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.special from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['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();
// BOF Linkmatics attributes sets plus
$products_options_query = tep_db_query("
SELECT pov.products_options_values_id, pov.products_options_values_name,
pa.options_values_price, pa.price_prefix , pase.sort_order
FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .
TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS . " pas2pa, " .
TABLE_PRODUCTS_ATTRIBUTES_SETS . " pas, " .
TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase, " .
TABLE_PRODUCTS_OPTIONS_VALUES . " pov
WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'
AND pa.options_id = '" . $products_options_name['products_options_id'] . "'
AND pas2pa.products_id = pa.products_id
AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id
AND pas.products_options_id = pa.options_id
AND pase.products_attributes_sets_id = pas.products_attributes_sets_id
AND pase.options_values_id = pa.options_values_id
AND pov.products_options_values_id = pa.options_values_id
AND pov.language_id = '" . $languages_id . "'
ORDER BY pase.sort_order, pa.options_values_id");
// >>>>> BOF Linkmatics attributes sets plus patch v1.01
if (tep_db_num_rows($products_options_query)== 0 ) {
$products_options_query = tep_db_query("
SELECT pov.products_options_values_id, pov.products_options_values_name,
pa.options_values_price, pa.price_prefix , pa.options_values_id
FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .
TABLE_PRODUCTS_OPTIONS_VALUES . " pov
WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'
AND pa.options_id = '" . $products_options_name['products_options_id'] . "'
AND pov.products_options_values_id = pa.options_values_id
AND pov.language_id = '" . $languages_id . "'
ORDER BY pa.options_values_id");
}
// <<<<< EOF Linkmatics attributes sets plus patch v1.01
// EOF Linkmatics attributes sets plus
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.options_id, pa.options_values_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['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)) {
//START get attribute stock values/show out of stock
if (!$products_options_name['special']) {
$attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes REGEXP '(^|,)" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "(,|$)' AND products_stock_quantity > 0");
if (tep_db_num_rows($attribute_stock_query)==0) {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => 'Sin stock - ' . $products_options['products_options_values_name']);
} else {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
}
}
else {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
}
// END get attribute stock values/show out of stock
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 (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
$selected_attribute = false;
}
?>