Goedenmorgen,
Ik ben bezig met een Oscommerce script iets aan te passen maar het blijkt dat dit me mijn petje te boven gaat. Ik zit met het volgende probleem en ik hoop dat iemand ziet wat ik verkeerd doe.
Op de pagina wil ik het volgende laten zien:
<? echo $products_name ?>
<? echo $product_sp;?>
<? echo $product_up;?>
<?php echo $product_st;?> ** ik heb hier <?php erbij geprobeerd, tevergeefs
<? echo $product_ut;?>
Ik heb een database Tabel die 'products_description' heet daar zitten deze bij onder:
products_id language_id products_name products_description products_url products_viewed product_sp product_up product_st product_ut
Zoals hieronder staat ziet mijn script er nu uit.. Ik weet sommige dingen staan er dubbel in maar dat heb ik zo gedaan tijdens het proberen.. Door geen 1 van de codes word de database inhoud weergegeven..
<?php
/*
$Id$
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');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
require(DIR_WS_FUNCTIONS . 'add_more_fields.php');
$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
require(DIR_WS_INCLUDES . 'template_top.php');
//begin dynamic meta tags query -->
// JRUST
$the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.product_sp, pd.product_up, pd.product_st, pd.product_ut, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id,
p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" . (int)$languages_id . "'");
$the_product_info = tep_db_fetch_array($the_product_info_query);
$the_product_name = strip_tags ($the_product_info['products_name'], "");
$the_product_description = strip_tags ($the_product_info['products_description'], "");
$the_product_model = strip_tags ($the_product_info['products_model'], "");
$the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
$the_manufacturers = tep_db_fetch_array($the_manufacturer_query);
// end dynamic meta tags query -->
if ($product_check['total'] < 1) {
?>
<div class="mindDefultHead"> </div>
<div class="mindDefultWrap">
<div class="contentContainer">
<div class="contentText">
<?php echo TEXT_PRODUCT_NOT_FOUND; ?>
</div>
<div style="float: right;">
<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
</div>
<br />
</div>
<?php
} else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.product_sp, pd.product_up, pd.product_st, pd.product_ut, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
$products_price = ' <img src="'.DIR_WS_LANGUAGES . $language .'/images/misc/sale.png" alt="" align="middle" /> <span><del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del></span> <span class="mindProdPriceRed">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
$products_price = PROD_INFO_PRICE.' <span class="mindProdPriceRed">'.$currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])).'</span>';
}
if (tep_not_null($product_info['products_model'])) {
$products_name = $product_info['products_name'] . ' <span class="smallText">[' . $product_info['products_model'] . ']</span>';
$products_name = $product_info['products_name'];
$p_product_sp = $product_info['product_sp'];
$p_product_up = $product_info['product_up'];
$p_product_st = $product_info['product_st'];
$p_product_ut = $product_info['product_ut'];
} else {
$products_name = $product_info['products_name'];
$p_product_sp = $product_info['product_sp'];
$p_product_up = $product_info['product_up'];
$p_product_st = $product_info['product_st'];
$p_product_ut = $product_info['product_ut'];
}
?>
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
<div class="mindDefultHead">
<h1 ><?php echo $products_name; ?></h1>
</div>
<div class="mindDefultWrap">
<div class="contentContainer">
<div class="contentText">
<div class="mindProdMain mindFloatRight">
<div class="mindProdStock">
<?php if (!$product_info['products_quantity'] == 0) {?>
<img src="layout/images/stock_instock.gif" width="32" height="30" alt="" align="middle" /> <?php echo STOCK_AVAIL;
}else{?> <img src="layout/images/stock_soldout.gif" width="32" height="30" alt="" align="middle" /> <?php echo STOCK_NO_AVAIL; } ?>
</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)$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) {
?>
<div class="mindProdOptions">
<div class="mindProdOptionsTxt"><?php echo TEXT_PRODUCT_OPTIONS; ?></div><br />
<?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)$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();
$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)$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)) {
$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($HTTP_GET_VARS['products_id']) && 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;
}
$products_name = $product_info['products_name'];
$products_model = $product_info['products_model'];
$p_product_sp = $product_info['product_sp'];
$p_product_up = $product_info['product_up'];
$p_product_st = $product_info['product_st'];
$p_product_ut = $product_info['product_ut'];
?>
<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).'<br />'; ?>
<?php
}
?>
</div>
<?php
}
?>
<div class="mindProdPrice"><?php echo ' '.$products_price; ?></div><br />
<div class="buttonSet mindProdButton" align="right">
<span class="buttonAction"> <?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></span>
<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?><br />
<br />
Ik hoop dat iemand ziet wat ik fout doe, het zou me ontzettend helpen!
Alvast bedankt!
[size=xsmall]Toevoeging op 16/02/2012 11:49:39:[/size]
Iemand vroeg me of ik <?php echo $p_product_st ?> eens wou proberen i.p.v <? echo $p_product_st;?> maar dat werkt ook niet..
1.055 views