#1 (permalink)  
Alt 06.09.2005, 12:11
 
Registriert seit: 21.08.2005
Beiträge: 32
Standard

Hallo zusammen

Ich habe folgendes Problem: Ich habe h?ufig denselben Artikel, aber in unterschiedlicher Menge. Als Beispiel: Italienisches Oliven?l 50ml, 100ml oder 500ml. Da es mir zu umst?ndlich war das alles jeweils als einzelnen Artikel einzugeben, und die Beschreibung ja auch jeweils dieselbe ist, habe ich mit den Artikel-Optionen gearbeitet. Leider ist das jetzt f?r die Kunden sehr un?bersichtlich, da sie immer den Kaufpreis und den Zusatzbetrag f?r die gr??ere Menge addieren m?ssen, und der Zusatzbetrag ist manchmal sehr hoch bzw. der Gesamtbetrag f?r weniger Begabte ist schwer zu errechnen, ich w?rde sogar sagen f?r DAKs (DAK=D?mmster anzunehmender Kunde) gar nicht ersichtlich.

Als Beispiel: http://truestyle.tr.ohost.de/product_info....1&cPath=245_289

Zwar kann man als schlechter Kopfrechner (so wie ich) sp?testens im Warenkorb sehen wieviel der Artikel nun letztendlich kostet, aber ich bef?rchte diese un?bersichtliche Preisauszeichnung k?nnte rechtliche Probleme mit sich bringen, worauf ich auch schon hingewiesen wurde.

Am liebsten w?re mir wenn dort statt nur "+1,50" "+1,50 = 6,50 ?", oder als Tabellenkalkulationsformel ausgedr?ckt "+Options-Aufpreis = (Options-Aufpreis + Grundpreis)" st?nde. Das zu Programmieren d?rfte vermutlich nicht schwierig sein, wenn man den Ahnung von php h?tte... :blush:

Kann mir vielleicht jemand behilflich sein und mir verraten welchen Code ich daf?r eingeben muss? Das w?re sehr lieb!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #2 (permalink)  
Alt 07.09.2005, 00:44
 
Registriert seit: 21.08.2005
Beiträge: 32
Standard

M?sste der ben?tigte Code sich nicht theoretisch irgendwo in der shopping_cart.php befinden? Dort werden schlie?lich die Gesamtpreise angezeigt...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #3 (permalink)  
Alt 07.09.2005, 06:46
Erfahrener Benutzer
 
Registriert seit: 08.03.2005
Ort: Mußtopp
Beiträge: 638
Standard

Hier ist ne kleine Modifikation. Habe sie auf XTC-Version 2 ausprobiert. Aber ich denke funktioniert auch in Version 3.

Datei:
includes/modules/product_attributes.php

Sichere vorher auf jeden Fall deine Originaldatei.

Gru?
Hen


Code:
 <?php
/* -----------------------------------------------------------------------------------------
  $Id: product_attributes.php,v 1.16 2004/02/21 22:38:22 fanta2k Exp $

  XT-Commerce - community made shopping
  http://www.xt-commerce.com

  Copyright (c) 2003 XT-Commerce
  -----------------------------------------------------------------------------------------
  patched by Hubbabubba 09/2005
  -----------------------------------------------------------------------------------------
  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.'/');

  $products_attributes_query = xtc_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$_SESSION['languages_id'] . "'");
  $products_attributes = xtc_db_fetch_array($products_attributes_query);
  if ($products_attributes['total'] > 0) {
   $products_options_name_query = xtc_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)$_GET['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)) {
    $selected = 0;

// kleiner Extrazufriff auf Produkte um Preis zu ermitteln
    $products_query = xtc_db_query("select products_price
                    from " . TABLE_PRODUCTS . "
                    where products_id = '" . (int)$_GET['products_id'] . "'");
    $products_price = xtc_db_fetch_array($products_query);
    $products_price = $products_price['products_price'];
// Artikelpreis liegt in nun $products_price vor

    $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 = xtc_db_query("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 = '" . (int)$_GET['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)) {
     $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'].' '.xtc_get_products_attribute_price($products_options['options_values_price'], $tax_class=$product_info['products_tax_class_id'],$price_special=0,$quantity=1,$prefix=$products_options['price_prefix']).' '.$_SESSION['currency'];
     }
     $price='';
     if ($products_options['options_values_price']!='0.00') {
//     $price = xtc_format_price(xtc_get_products_attribute_price($products_options['options_values_price'], $tax_class=$product_info['products_tax_class_id'],$price_special=0,$quantity=1,$prefix=$products_options['price_prefix']),1,false,1);
// Addition $products_price
     $price = xtc_format_price($products_price+xtc_get_products_attribute_price($products_options['options_values_price'], $tax_class=$product_info['products_tax_class_id'],$price_special=0,$quantity=1,$prefix=$products_options['price_prefix']),1,false,1);
     }
     $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_prefix auskommentiert, soll nicht mehr angezeigt werden
//                            'PRICE' =>$price,
//                            'PREFIX' =>$products_options['price_prefix']);
                            'PRICE' =>$price);

    $col++;
    }
   $row++;
   }

  }
 // template query
 $template_query=xtc_db_query("SELECT
                options_template
                FROM ".TABLE_PRODUCTS."
                WHERE products_id='".$_GET['products_id']."'");
 $template_data=xtc_db_fetch_array($template_query);
 if ($template_data['options_template']=='' or $template_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")){
    $files[]=array(
            'id' => $file,
            'text' => $file);
    }//if
    } // while
    closedir($dir);
 }
 $template_data['options_template']=$files[0]['id'];
 }

 $module_smarty->assign('language', $_SESSION['language']);
 $module_smarty->assign('options',$products_options_data);
 // set cache ID
 if (USE_CACHE=='false') {
 $module_smarty->caching = 0;
 $module= $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_options/'.$template_data['options_template']);
 } else {
 $module_smarty->caching = 1;	
 $module_smarty->cache_lifetime=CACHE_LIFETIME;
 $module_smarty->cache_modified_check=CACHE_CHECK;
 $cache_id = $_GET['products_id'].$_SESSION['language'].$_SESSION['customers_status']['customers_status_name'];
 $module= $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_options/'.$template_data['options_template'],$cache_id);
 }
 $info_smarty->assign('MODULE_product_options',$module);

 ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #4 (permalink)  
Alt 07.09.2005, 13:40
 
Registriert seit: 21.08.2005
Beiträge: 32
Standard

?hm... hab ich das richtig verstanden, dass ich den vorhandenen Code durch diesen ersetzen soll? Dann passiert n?mlich das hier:

http://truestyle.tr.ohost.de/product_info....id=260&cPath=45

Oder hab ich mal wieder alles verrafft?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #5 (permalink)  
Alt 07.09.2005, 14:57
Erfahrener Benutzer
 
Registriert seit: 08.03.2005
Ort: Mußtopp
Beiträge: 638
Standard

Zitat:
Originally posted by Hatschepuh@Sep 7 2005, 01:40 PM
?hm... hab ich das richtig verstanden, dass ich den vorhandenen Code durch diesen ersetzen soll? Dann passiert n?mlich das hier:

http://truestyle.tr.ohost.de/product_info....id=260&cPath=45

Oder hab ich mal wieder alles verrafft?
Bitte benutze einen Ascii-Editor. Notepad ist optimal. Das ist der Editor aus dem Windows Zubeh?r, Start->Zubeh?r->Editor.

Gru?
Hen
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #6 (permalink)  
Alt 07.09.2005, 15:12
 
Registriert seit: 21.08.2005
Beiträge: 32
Standard

Hab ich gemacht, aber nun passiert entweder das hier:

http://truestyle.tr.ohost.de/product_info....1&cPath=107_251

oder die Artikeloptionen werden bei unterschiedlichen Preisen gar nicht mehr angezeigt, bei gleichen Preisen sieht alles normal aus wie immer.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #7 (permalink)  
Alt 07.09.2005, 19:28
Erfahrener Benutzer
 
Registriert seit: 08.03.2005
Ort: Mußtopp
Beiträge: 638
Standard

Ding Dong!

Du benutzt XTC Version 3.
Die Routine war nur auf Version 2 getestet. H?ttest du doch mal was gesagt.

:sad:
Gru?

Geändert von hubbabubba (16.08.2008 um 09:42 Uhr)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #8 (permalink)  
Alt 07.09.2005, 20:30
Erfahrener Benutzer
 
Registriert seit: 08.03.2005
Ort: Mußtopp
Beiträge: 638
Standard

Versuchs mal damit

Code:
 <?php
/* -----------------------------------------------------------------------------------------
  $Id: product_attributes.php,v 1.18 2004/06/11 18:21:38 fanta2k Exp $

  XT-Commerce - community made shopping
  http://www.xt-commerce.com

  Copyright (c) 2003 XT-Commerce
  -----------------------------------------------------------------------------------------
  gepatched
  -----------------------------------------------------------------------------------------
  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.'/');

  $products_attributes_query = xtc_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$_SESSION['languages_id'] . "'");
  $products_attributes = xtc_db_fetch_array($products_attributes_query);
  if ($products_attributes['total'] > 0) {
   $products_options_name_query = xtc_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)$_GET['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)) {
    $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 = xtc_db_query("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 = '" . (int)$_GET['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)) {
     $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 {

     $products_price=$xtPrice->xtcGetPrice($product_info['products_id'],
                    $format=false,
                    1,
                    $product_info['products_tax_class_id'],
                    $product_info['products_price']);

     if ($products_options['options_values_price']!='0.00') {
     $price = $xtPrice->xtcFormat($products_price+$products_options['options_values_price'],false,$product_info['products_tax_class_id']);
     }

     $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($price,true),
                  'FULL_PRICE'=>$xtPrice->xtcFormat($products_price+$price,true),
//                              'PREFIX' =>$products_options['price_prefix']);
                              '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++;
   }

  }
 // template query
 $template_query=xtc_db_query("SELECT
                options_template
                FROM ".TABLE_PRODUCTS."
                WHERE products_id='".(int)$_GET['products_id']."'");
 $template_data=xtc_db_fetch_array($template_query);
 if ($template_data['options_template']=='' or $template_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")){
    $files[]=array(
            'id' => $file,
            'text' => $file);
    }//if
    } // while
    closedir($dir);
 }
 $template_data['options_template']=$files[0]['id'];
 }

 $module_smarty->assign('language', $_SESSION['language']);
 $module_smarty->assign('options',$products_options_data);
 // set cache ID
 if (USE_CACHE=='false') {
 $module_smarty->caching = 0;
 $module= $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_options/'.$template_data['options_template']);
 } else {
 $module_smarty->caching = 1;	
 $module_smarty->cache_lifetime=CACHE_LIFETIME;
 $module_smarty->cache_modified_check=CACHE_CHECK;
 $cache_id = $_GET['products_id'].$_SESSION['language'].$_SESSION['customers_status']['customers_status_name'];
 $module= $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_options/'.$template_data['options_template'],$cache_id);
 }
 $info_smarty->assign('MODULE_product_options',$module);

 ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #9 (permalink)  
Alt 07.09.2005, 20:35
 
Registriert seit: 27.02.2005
Beiträge: 32
Standard

Hallo, das kannste doch ?ber die Artikelmerkmale machen.
Leg ein Artikelmerkmal an: zB. Flaschen
als Optionsmerkmal: K?che / Parf?m / Geschenk
Dann ein Merkmal ml oder so.
als Optionsmerkmal: 50 125 250 500 1000 oder ?hnlich

Die Preise kannste da auch angeben.



Danach gibst Du unter Artikelverwaltung f?r den Artikel die Optionen ein.
Nimm f?r die Darstellung " dropdown " und " info....1 " an.
Die Reihung der " Flaschen " und " ml " kannste dann in den Optionen zuordnen
1 f?r K?che
2 f?r Parf?m
3 f?rGeschenk
4 f?r 50
5 f?r 100 usw. sollte dann etwa so aussehen:
http://www.my-dessous-shop.de/new_shop/pro...products_id=316

vergi? nicht f?r Mengen ( ML / Liter / gr. Kilo / Meter ) die Preise pro 1 Liter pro 1 Kilo pro 10 mtr. in der Artikelbeschreibung anzugeben. Gibt evtl. Abmahnungen von Anw?lten.( siehe Forum suche nach " Abmahnungen " )
Hoffe es hilft Dir weiter.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #10 (permalink)  
Alt 07.09.2005, 22:28
 
Registriert seit: 21.08.2005
Beiträge: 32
Standard

Danke Hen, jetzt hats funktioniert! Sieht gleich viel besser aus!

@senior006de: Jeweils den Preis pro Liter angeben w?re aber extrem umst?ndlich, da er je nach Abgabemenge unterschiedlich ist. Bist Du Dir da sicher? Wei?t Du den Paragraphen wo das steht?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
artikelmerkmalen, preise, problem

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



Alle Zeitangaben in WEZ +1. Es ist jetzt 07:56 Uhr.

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

xt:Commerce is a SafeCharge brand