|
|||
|
Hallo,
ich m?chte in der Datei 'product_option_selection.html' die Variable {$PRODUCTS_QUANTITY} verwenden. Allerdings ist sie dort leer. In der product_info_v1.html' funktioniert es aber. Kann mir jemand erkl?ren, woran das liegt? |
|
||||
|
die ist auch dem product_info zugeweisen und nicht den optionen.
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
Im Adminbereich kann man bei den Attributen bei "Stock" eine Lagermenge angeben.
Bestellt jemand nun - sagen wir eine Wollsocke mit Attributr "rot", dann geht aus dem Lager eine rote Socke raus, und keine weisse oder schwarze. Deshalb m?chte ich bei jedem Attribut den Lagerbestand einzeln anzeigen lassen. Oder wird immer nur beim eigentlichen Artikel die Lagermenge ver?ndert? Wof?r ist dan "Stock" bei den Attributen? Oder versteh ich da was komplett falsch? Danke schonmal. |
|
||||
|
und warum postest du dann nicht die l?sung ?
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
Jip, hast recht
In Datei /includes/modules/product_attributes.php in Zeile 71 einf?gen: Code:
'STOCK' => $products_options['attributes_stock'], /templates/tftshop/module/product_options/product_options_selection.html Kann nun mit der Variable {$item_data.STOCK} die St?ckzahl pro Option abgefragt werden. Meine sieht jetzt mit Lagerampel so aus: Code:
table width="" border="0" cellspacing="0" cellpadding="0">
{foreach name=outer item=options_data from=$options}
<tr>
<td valign="top" class="main"><b>{$options_data.NAME}:</b></td>
<td class="main">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
{foreach key=key_data item=item_data from=$options_data.DATA}
<td class="main" nowrap>
<input type="radio" name="id[{$options_data.ID}]" value="{$item_data.ID}" checked>{$item_data.TEXT}
{if $item_data.PRICE!=''}(
{$item_data.PREFIX}{$item_data.PRICE})
{/if}
<!#Lagerbestand der Option abfragen -->
</td>
<td class="main" nowrap>
{if ($item_data.STOCK<=2) }
<img src="{$tpl_path}img/button_red.gif" border="0" alt="Noch {$item_data.STOCK} lieferbar">
{elseif ($item_data.STOCK<=10) }
<img src="{$tpl_path}img/button_yellow.gif" border="0" alt="Noch {$item_data.STOCK} lieferbar">
{else ($item_data.STOCK>=11) }
<img src="{$tpl_path}img/button_green.gif" border="0" alt="Noch {$item_data.STOCK} lieferbar">
{/if}
<!#-->
</td>
</tr>
{/foreach}
</table>
</td>
</tr>
{/foreach}
</table>
In der Artikelmaske muss die Summe der vorhandenen Artikel stehen inkl. der Optionen (also: 10 schwarz + 8 wei? = 18 Stck). Legt man nun ein Attribut "schwarz" an, dann muss man in diesem Fall bei "Stock" 10 eintragen. Legt man das Attribunt "wei?" an, dann muss in diesem Fall man bei "Stock" 8 Eintragen. Im Artikelfenster ist die Summe dann 18. Ok? :grml: |
|
|||
|
Und wie w?rde es funktionieren wenn man ohne Attribute arbeiten m?chte???
Das ich quasi in der produkt_listing_v1.html nur z.B.: Lagerbestand:{$PRODUCTS_QUANTITY} eintrage?!?! Er zeigt mir dann das Wort Lagerbestand: aber nicht die Zahl! Was muss ich dort ?ndern??? Danke im vorraus! |
|
|||
|
Ich hab ne Lagerampel in die product_info_v1.html eingebaut:
Code:
<!#-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80" class="main">Lagerbestand:</td>
<td align="right" class="main">
<p align="left">
{if ($PRODUCTS_QUANTITY<=2) }
<img src="{$tpl_path}img/button_red.gif" border="0" alt="Noch {$PRODUCTS_QUANTITY} lieferbar">
{elseif ($PRODUCTS_QUANTITY<=10) }
<img src="{$tpl_path}img/button_yellow.gif" border="0" alt="Noch {$PRODUCTS_QUANTITY} lieferbar">
{else ($PRODUCTS_QUANTITY>=11) }
<img src="{$tpl_path}img/button_green.gif" border="0" alt="Noch {$PRODUCTS_QUANTITY} lieferbar">
{/if}
</p>
</td>
</tr>
</table>
<!#-->
So in etwa: Code:
<td>Lagerbestand:&npsp;{$PRODUCTS_QUANTITY}</td>
Tribun |
|
|||
|
Hi, habe diesen Thread, der leider knapp 4 Jahre alt ist, gerade über die Suche gefunden.
Ich benutze xtCommerce version 3.04SP2.1 und habe bereits über {$PRODUCTS_QUANTITY} den Lagerbestand eingebaut. Nun möchte ich die Artikelattribute auch noch mit Lagerbeständen anzeigen lassen. Meine "product_attributes.php" ist aber wesentlich aktueller als dieser Thread und auch das Einfügen in Zeile 71 erscheint mir nicht ganz logisch. Kann mir jemand bestätigen/erklären wie ich in Version 3.04SP2.1 vorgehen müsste (erschwerend hinzu kommt dass ich ein Drittanbieter Modul: API-AddOn-Text-Upload von Omega Soft wie folgt verwende: Code:
<?php
/* -----------------------------------------------------------------------------------------
$Id: product_attributes.php 1255 2005-09-28 15:10:36Z mz $
XT-Commerce - community made shopping
http://www.xt-commerce.com
Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(product_info.php,v 1.94 2003/05/04); www.oscommerce.com
(c) 2003 nextcommerce (product_info.php,v 1.46 2003/08/25); www.nextcommerce.org
Released under the GNU General Public License
-----------------------------------------------------------------------------------------
Third Party contribution:
Customers Status v3.x (c) 2002-2003 Copyright Elari elari@free.fr | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist
New Attribute Manager v4b Autor: Mike G | mp3man@internetwork.net | http://downloads.ephing.com
Cross-Sell (X-Sell) Admin 1 Autor: Joshua Dechant (dreamscape)
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
$module_smarty = new Smarty;
$module_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
if ($product->getAttributesCount() > 0) {
$products_options_name_query = xtDBquery("select distinct
popt.products_options_id,
popt.products_options_name,
popt.products_options_type,
popt.products_options_length,
popt.products_options_field_length,
popt.products_options_input,
popt.products_options_comment
from ".TABLE_PRODUCTS_OPTIONS." popt,
".TABLE_PRODUCTS_ATTRIBUTES." patrib
where patrib.products_id='".$product->data['products_id']."'
and patrib.options_id = popt.products_options_id
and popt.language_id = '".(int) $_SESSION['languages_id']."'
order by patrib.sortorder");
$number_of_uploads = 0;
$row = 0;
$col = 0;
$products_options_data=array();
while ($products_options_name = xtc_db_fetch_array($products_options_name_query,true)) {
switch ($products_options_name['products_options_type']) {
case PRODUCTS_OPTIONS_TYPE_TEXT:
$products_options_array = array();
$products_options_data[$row]=array(
'NAME'=>$products_options_name['products_options_name'],
'ID' => $products_options_name['products_options_id'],
'TYPE' => $products_options_name['products_options_type'],
'COMMENT' => $products_options_name['products_options_comment'],
'LENGTH' => $products_options_name['products_options_length'],
'FIELDLENGTH' => $products_options_name['products_options_field_length'],
'INPUT' => $products_options_name['products_options_input'],
'DATA' =>'');
$products_options_query = xtDBquery("select
pov.products_options_values_id,
pov.products_options_values_name,
pov.products_options_values_desc,
pov.products_options_values_image,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder");
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
$price='';
$image = '';
if ($products_options['products_options_values_image']!= '') {
$image = DIR_WS_IMAGES . 'product_options/'. $products_options['products_options_values_image'];
}
$tmp_text = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_field_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$_GET['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ';
if ($_SESSION['customers_status']['customers_status_show_price'] == '0') {
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' => $tmp_text,
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>'',
'FULL_PRICE'=>'',
'PREFIX' => $products_options['price_prefix']);
}else{
if ($products_options['options_values_price']!='0.00') {
$price = $xtPrice->xtcFormat($products_options['options_values_price'], false, $product->data['products_tax_class_id']);
}
$products_price = $xtPrice->xtcGetPrice($product->data['products_id'], $format = false, 1, $product->data['products_tax_class_id'], $product->data['products_price']);
if ($_SESSION['customers_status']['customers_status_discount_attributes'] == 1 && $products_options['price_prefix'] == '+')
$price -= $price / 100 * $discount;
$attr_price=$price;
if ($products_options['price_prefix']=="-") $attr_price=$price*(-1);
$full = $products_price + $attr_price;
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' => $tmp_text,
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>$xtPrice->xtcFormat($price,true),
'FULL_PRICE'=>$xtPrice->xtcFormat($products_price+$price,true),
'PREFIX' =>$products_options['price_prefix']);
//if PRICE for option is 0 we don't need to display it
if ($price == 0) {
unset($products_options_data[$row]['DATA'][$col]['PRICE']);
unset($products_options_data[$row]['DATA'][$col]['PREFIX']);
}
}
$products_options_data[$row]+=array('TEFE'=>'true');
$col++;
}
break;
case PRODUCTS_OPTIONS_TYPE_TEXTAREA:
$products_options_array = array();
$products_options_data[$row]=array(
'NAME'=>$products_options_name['products_options_name'],
'ID' => $products_options_name['products_options_id'],
'TYPE' => $products_options_name['products_options_type'],
'COMMENT' => $products_options_name['products_options_comment'],
'LENGTH' => $products_options_name['products_options_length'],
'FIELDLENGTH' => $products_options_name['products_options_field_length'],
'INPUT' => $products_options_name['products_options_input'],
'DATA' =>'');
$products_options_query = xtDBquery("select
pov.products_options_values_id,
pov.products_options_values_name,
pov.products_options_values_desc,
pov.products_options_values_image,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder");
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
$price='';
$image = '';
if ($products_options['products_options_values_image']!= '') {
$image = DIR_WS_IMAGES . 'product_options/'. $products_options['products_options_values_image'];
}
$tmp_area = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"
onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"
onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"
wrap="soft"
name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"
cols="'.$products_options_name['products_options_field_length'].'"
rows=4
id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"
value="' . $cart->contents[$_GET['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>
<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>
<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';/*?> <!-- DDB - 041031 - Form Field Progress Bar //-->*/
if ($_SESSION['customers_status']['customers_status_show_price'] == '0') {
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' => $tmp_area,
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>'',
'FULL_PRICE'=>'',
'PREFIX' => $products_options['price_prefix']);
}else{
if ($products_options['options_values_price']!='0.00') {
$price = $xtPrice->xtcFormat($products_options['options_values_price'], false, $product->data['products_tax_class_id']);
}
$products_price = $xtPrice->xtcGetPrice($product->data['products_id'], $format = false, 1, $product->data['products_tax_class_id'], $product->data['products_price']);
if ($_SESSION['customers_status']['customers_status_discount_attributes'] == 1 && $products_options['price_prefix'] == '+')
$price -= $price / 100 * $discount;
$attr_price=$price;
if ($products_options['price_prefix']=="-") $attr_price=$price*(-1);
$full = $products_price + $attr_price;
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' => $tmp_area,
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>$xtPrice->xtcFormat($price,true),
'FULL_PRICE'=>$xtPrice->xtcFormat($products_price+$price,true),
'PREFIX' =>$products_options['price_prefix']);
//if PRICE for option is 0 we don't need to display it
if ($price == 0) {
unset($products_options_data[$row]['DATA'][$col]['PRICE']);
unset($products_options_data[$row]['DATA'][$col]['PREFIX']);
}
}
$products_options_data[$row]+=array('TEFE'=>'true');
$col++;
}
break;
case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
$products_options_array = array();
$products_options_data[$row]=array(
'NAME'=>$products_options_name['products_options_name'],
'ID' => $products_options_name['products_options_id'],
'TYPE' => $products_options_name['products_options_type'],
'COMMENT' => $products_options_name['products_options_comment'],
'LENGTH' => $products_options_name['products_options_length'],
'FIELDLENGTH' => $products_options_name['products_options_field_length'],
'INPUT' => $products_options_name['products_options_input'],
'DATA' =>'');
$products_options_query = xtDBquery("select
pov.products_options_values_id,
pov.products_options_values_name,
pov.products_options_values_desc,
pov.products_options_values_image,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder");
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
$price='';
$image = '';
if ($products_options['products_options_values_image']!= '') {
$image = DIR_WS_IMAGES . 'product_options/'. $products_options['products_options_values_image'];
}
if ($_SESSION['customers_status']['customers_status_show_price'] == '0') {
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' =>$products_options['products_options_values_name'],
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>'',
'FULL_PRICE'=>'',
'PREFIX' => $products_options['price_prefix']);
}else{
if ($products_options['options_values_price']!='0') {
$price = $xtPrice->xtcFormat($products_options['options_values_price'], false, $product->data['products_tax_class_id']);
}
$products_price = $xtPrice->xtcGetPrice($product->data['products_id'], $format = false, 1, $product->data['products_tax_class_id'], $product->data['products_price']);
if ($_SESSION['customers_status']['customers_status_discount_attributes'] == 1 && $products_options['price_prefix'] == '+')
$price -= $price / 100 * $discount;
$attr_price=$price;
if ($products_options['price_prefix']=="-") $attr_price=$price*(-1);
$full = $products_price + $attr_price;
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' =>$products_options['products_options_values_name'],
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>$xtPrice->xtcFormat($price,true),
'FULL_PRICE'=>$xtPrice->xtcFormat($products_price+$price,true),
'PREFIX' =>$products_options['price_prefix']);
//if PRICE for option is 0 we don't need to display it
if ($price == 0) {
unset($products_options_data[$row]['DATA'][$col]['PRICE']);
unset($products_options_data[$row]['DATA'][$col]['PREFIX']);
}
}
$products_options_data[$row]+=array('TEFE'=>'false');
$col++;
}
break;
case PRODUCTS_OPTIONS_TYPE_FILE:
$products_options_array = array();
$products_options_data[$row]=array(
'NAME'=>$products_options_name['products_options_name'],
'ID' => $products_options_name['products_options_id'],
'TYPE' => $products_options_name['products_options_type'],
'COMMENT' => $products_options_name['products_options_comment'],
'LENGTH' => $products_options_name['products_options_length'],
'FIELDLENGTH' => $products_options_name['products_options_field_length'],
'INPUT' => $products_options_name['products_options_input'],
'DATA' =>'');
$products_options_query = xtDBquery("select
pov.products_options_values_id,
pov.products_options_values_name,
pov.products_options_values_desc,
pov.products_options_values_image,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder");
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
$number_of_uploads++;
$price='';
$image = '';
if ($products_options['products_options_values_image']!= '') {
$image = DIR_WS_IMAGES . 'product_options/'. $products_options['products_options_values_image'];
}
if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
$tmp_upload = '<input type="file" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_fiels_length'] .'" maxsize="' . $products_options_name['products_options_length'] .'"><br />' . $cart->contents[$_GET['products_id']]['attributes_values'][$products_options_name['products_options_id']] . xtc_draw_hidden_field(UPLOAD_PREFIX . $number_of_uploads, $products_options_name['products_options_id']) . xtc_draw_hidden_field(TEXT_PREFIX . UPLOAD_PREFIX . $number_of_uploads, $cart->contents[$_GET['products_id']]['attributes_values'][$products_options_name['products_options_id']]);
}else{
$tmp_upload = '';
}
if ($_SESSION['customers_status']['customers_status_show_price'] == '0') {
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' => $tmp_upload,
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>'',
'FULL_PRICE'=>'',
'PREFIX' =>$products_options['price_prefix']);
}else{
if ($products_options['options_values_price']!='0.00') {
$price = $xtPrice->xtcFormat($products_options['options_values_price'], false, $product->data['products_tax_class_id']);
}
$products_price = $xtPrice->xtcGetPrice($product->data['products_id'], $format = false, 1, $product->data['products_tax_class_id'], $product->data['products_price']);
if ($_SESSION['customers_status']['customers_status_discount_attributes'] == 1 && $products_options['price_prefix'] == '+')
$price -= $price / 100 * $discount;
$attr_price=$price;
if ($products_options['price_prefix']=="-") $attr_price=$price*(-1);
$full = $products_price + $attr_price;
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' => $tmp_upload,
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>$xtPrice->xtcFormat($price,true),
'FULL_PRICE'=>$xtPrice->xtcFormat($products_price+$price,true),
'PREFIX' =>$products_options['price_prefix']);
//if PRICE for option is 0 we don't need to display it
if ($price == 0) {
unset($products_options_data[$row]['DATA'][$col]['PRICE']);
unset($products_options_data[$row]['DATA'][$col]['PREFIX']);
}
}
$_SESSION['number_of_uploads'] = $number_of_uploads;
$col++;
}
break;
default:
$selected = 0;
$products_options_array = array();
$products_options_data[$row]=array(
'NAME'=>$products_options_name['products_options_name'],
'ID' => $products_options_name['products_options_id'],
'TYPE' => $products_options_name['products_options_type'],
'COMMENT' => $products_options_name['products_options_comment'],
'LENGTH' => $products_options_name['products_options_length'],
'FIELDLENGTH' => $products_options_name['products_options_field_length'],
'INPUT' => $products_options_name['products_options_input'],
'DATA' =>'');
$products_options_query = xtDBquery("select
pov.products_options_values_id,
pov.products_options_values_name,
pov.products_options_values_desc,
pov.products_options_values_image,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder");
$col = 0;
while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
$price='';
$image = '';
if ($products_options['products_options_values_image']!= '') {
$image = DIR_WS_IMAGES . 'product_options/'. $products_options['products_options_values_image'];
}
if ($_SESSION['customers_status']['customers_status_show_price'] == '0') {
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' =>$products_options['products_options_values_name'],
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>'',
'FULL_PRICE'=>'',
'PREFIX' => $products_options['price_prefix']);
}else{
if ($products_options['options_values_price']!='0') {
$price = $xtPrice->xtcFormat($products_options['options_values_price'], false, $product->data['products_tax_class_id']);
}
$products_price = $xtPrice->xtcGetPrice($product->data['products_id'], $format = false, 1, $product->data['products_tax_class_id'], $product->data['products_price']);
if ($_SESSION['customers_status']['customers_status_discount_attributes'] == 1 && $products_options['price_prefix'] == '+')
$price -= $price / 100 * $discount;
$attr_price=$price;
if ($products_options['price_prefix']=="-") $attr_price=$price*(-1);
$full = $products_price + $attr_price;
$products_options_data[$row]['DATA'][$col]=array(
'ID' => $products_options['products_options_values_id'],
'TEXT' =>$products_options['products_options_values_name'],
'DESCRIPTION' =>$products_options['products_options_values_desc'],
'IMAGE' =>$image,
'MODEL' =>$products_options['attributes_model'],
'PRICE' =>$xtPrice->xtcFormat($price,true),
'FULL_PRICE'=>$xtPrice->xtcFormat($products_price+$price,true),
'PREFIX' =>$products_options['price_prefix']);
//if PRICE for option is 0 we don't need to display it
if ($price == 0) {
unset($products_options_data[$row]['DATA'][$col]['PRICE']);
unset($products_options_data[$row]['DATA'][$col]['PREFIX']);
}
}
$products_options_data[$row]+=array('TEFE'=>'false');
$col++;
}
break;
}
$row++;
}
}
if ($product->data['options_template'] == '' or $product->data['options_template'] == 'default') {
$files = array ();
if ($dir = opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_options/')) {
while (($file = readdir($dir)) !== false) {
if (is_file(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_options/'.$file) and ($file != "index.html") and (substr($file, 0, 1) !=".")) {
$files[] = array ('id' => $file, 'text' => $file);
} //if
} // while
closedir($dir);
}
$product->data['options_template'] = $files[0]['id'];
}
$module_smarty->assign('language', $_SESSION['language']);
$module_smarty->assign('options', $products_options_data);
// set cache ID
$module_smarty->caching = 0;
$module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_options/'.$product->data['options_template']);
$info_smarty->assign('MODULE_product_options', $module);
?>
|
![]() |
| Lesezeichen |
| Stichworte |
| #036productsquantity, produktmerkmal |
| Themen-Optionen | |
| Ansicht | |
|
|