#11 (permalink)  
Alt 23.07.2009, 16:05
Neuer Benutzer
 
Registriert seit: 16.06.2008
Beiträge: 13
Standard

In irgendeinem Forum (kann hier gewesen sein) hab ich gelesen, wie man Artikel ohne Attribute automatisch ein und ausblendet:

includes/application_top.php

ganz am ende vor ?> folgendes einfügen:

xtc_db_query('UPDATE ' . TABLE_PRODUCTS . ' SET products_status=0 WHERE products_quantity <=0');
xtc_db_query('UPDATE ' . TABLE_PRODUCTS . ' SET products_status=1 WHERE products_quantity >=1');

Artikel wird ausgeblendet, wenn er ausverkauft ist und wieder eingeblendet, sobald ein neuer Lagerbestand im Admin eingetragen wird.

Trotzdem brauche ich noch Hilfe, wenn eben Attribute vorhanden sind.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #12 (permalink)  
Alt 23.07.2009, 16:18
Neuer Benutzer
 
Registriert seit: 16.06.2008
Beiträge: 13
Standard

Lösung nach Ewigkeiten zufällig endlich gefunden!!! Für alle, die das auch noch brauchen:

Datei: includes/modules/product_attributes.php (Zeilen durch vorhandene Zeilen ersetzen)
PHP-Code:
$products_options_name_query xtDBquery("select distinct popt.products_options_id, popt.products_options_name 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']."‘ AND patrib.attributes_stock > 0 order by popt.products_options_name"); 
PHP-Code:
        $products_options_query xtDBquery("select pov.products_options_values_id,
                                                        pov.products_options_values_name,
                                                        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.attributes_stock > 0 AND 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"
); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #13 (permalink)  
Alt 06.01.2010, 21:57
Neuer Benutzer
 
Registriert seit: 31.08.2009
Beiträge: 13
Standard

Irgendwie funktioniert das bei mir nicht.
Was mache ich falsch? kann mir das jemand verraten habe die php datei genommen und das geändert wie es da stand.
Aber wenn ich das mache und mein artikel anklicke kommen nur fehler bei mir.

Kann mir einer helfen?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #14 (permalink)  
Alt 06.01.2010, 22:09
Neuer Benutzer
 
Registriert seit: 31.08.2009
Beiträge: 13
Standard

PHP-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 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 popt.products_options_name");

    
$row 0;
    
$col 0;
    
$products_options_data = array ();
    while (
$products_options_name xtc_db_fetch_array($products_options_name_query,true)) {
        
$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'], 'DATA' => '');
        
$products_options_query xtDBquery("select pov.products_options_values_id,
                                                         pov.products_options_values_name,
                                                         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 '';
            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'], '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 false1$product->data['products_tax_class_id'], $product->data['products_price']);
                if (
$_SESSION['customers_status']['customers_status_discount_attributes'] == && $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'], 'MODEL' => $products_options['attributes_model'], 'PRICE' => $xtPrice->xtcFormat($pricetrue), 'FULL_PRICE' => $xtPrice->xtcFormat($fulltrue), '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']);
                }

            }
            
$col ++;
        }
        
$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($file01) !=".")) {
                
$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);
?>
das ist meine product_attributes.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #15 (permalink)  
Alt 07.01.2010, 13:35
Neuer Benutzer
 
Registriert seit: 31.08.2009
Beiträge: 13
Standard

Hat keiner eine lösung für mich?
Wäre echt hilfreich.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #16 (permalink)  
Alt 08.01.2010, 21:24
Neuer Benutzer
 
Registriert seit: 31.08.2009
Beiträge: 13
Standard

Ist das normal das hier keiner antwortet?
Oder niemand was weis?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #17 (permalink)  
Alt 09.01.2010, 13:43
Neuer Benutzer
 
Registriert seit: 31.08.2009
Beiträge: 13
Standard

Wenn ich das oben in meine product_attributes.php einfüge kommt die fehler meldung.

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '’3‘ and patrib.options_id = popt.products_options_id and popt.language_id = ‘2‘ ' at line 1

select distinct popt.products_options_id, popt.products_options_name from products_options popt, products_attributes patrib where patrib.products_id=’3‘ and patrib.options_id = popt.products_options_id and popt.language_id = ‘2‘ AND patrib.attributes_stock > 0 order by popt.products_options_name

[XT SQL Error]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #18 (permalink)  
Alt 13.01.2010, 15:40
Neuer Benutzer
 
Registriert seit: 31.08.2009
Beiträge: 13
Standard

habe meine product_attributes.php angucken lassen und jemand meinte zu mir das kommas ausgetauscht werden müssten weil da nen fehler sein in der datenbank abfrage. Aber wo genau muss ich was verändern damit dieser code funktioniert?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #19 (permalink)  
Alt 21.10.2010, 10:16
Neuer Benutzer
 
Registriert seit: 05.02.2008
Beiträge: 5
Standard Attribute ausblenden bei Bestand NULL

sorry das ich das thema wieder vorhole, aber ich brauchte diese funktion und wollte nur mal kurz erklären wie der code eingebunden wird

suchen nach
PHP-Code:
$products_options_query xtDBquery("select pov.products_options_values_id,
                                                         pov.products_options_values_name,
                                                         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"
); 
ersetzen durch

PHP-Code:
$products_options_query xtDBquery("select pov.products_options_values_id,
                                                        pov.products_options_values_name,
                                                        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.attributes_stock > 0 AND 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"
); 
wenn der lagerbestand z.b. bei der grösse S NULL ist, wird in der Produktanzeige nur M, L und XL angezeigt. funktioniert bei mir super.

gruß patrick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
attribute, ausblenden

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Wenn Artikel aus dem XT mit Attribute ist wird es mit 0,-€ an Ab übergeben! blauertacho4u Installation und Konfiguration 0 05.11.2007 09:19


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:36 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand