#1 (permalink)  
Alt 16.01.2009, 16:06
Benutzer
 
Registriert seit: 18.05.2005
Beiträge: 39
Standard wiedermal eigene Felder

Hi

Ich habe meiner products-Tabelle ein weiteres Feld verpasst products_oldprice

Nun habe ich in den includes/new_products.php, includes/default,php, inc/products.inc.php, includes/classes/product.php in den sql-Abfragen dieses Feld hinzugefügt und in den entsprechenden Templatedateien die entsprechende Abfrage eingefügt:
Code:
{if $PRODUCTS_OLDPRICE > $PRODUCTS_PRICE}{#old_price#}<span style="text-decoration:line-through;color:#CCCCCC;font-style:italic;">{$PRODUCTS_OLDPRICE}</span><br>{/if}
                {$PRODUCTS_PRICE}</div>
bzw.
Code:
{if $module_data.PRODUCTS_OLDPRICE > $module_data.PRODUCTS_PRICE}{#old_price#}<span style="text-decoration:line-through;color:#CCCCCC;font-style:italic;">{$module_data.PRODUCTS_OLDPRICE}</span><br>{/if}
Leider wird in an gewünschter Stelle immer noch nix angezeigt!
Wo muß ich denn noch das PRODUCTS_OLDPRICE registrieren???

Danke!
EnzephaloN

Geändert von EnzephaloN (16.01.2009 um 16:35 Uhr)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #2 (permalink)  
Alt 16.01.2009, 19:49
Neuer Benutzer
 
Registriert seit: 19.01.2006
Ort: Baden-Baden
Beiträge: 20
Standard

Du musst die neuen Felder auch noch dort ergänzen, wo PHP-Variablen den Template-Variablen zugewiesen werden.

Diese Zuweisungen sehen typischerweise so aus:
$smarty->assign('PRODUCTS_OLDPRICE ',$products_oldprice);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #3 (permalink)  
Alt 19.01.2009, 10:50
Benutzer
 
Registriert seit: 18.05.2005
Beiträge: 39
Standard

Hallo

Mmh, ich dächte, ich hätte an allen notwendigen Stellen die Änderungen vorgenommen...

/includes/classes/product.php:
Code:
function buildDataArray(&$array,$image='thumbnail') {
		global $xtPrice,$main;

			$tax_rate = $xtPrice->TAX[$array['products_tax_class_id']];

			$products_price = $xtPrice->xtcGetPrice($array['products_id'], $format = true, 1, $array['products_tax_class_id'], $array['products_price'], 1);
			$products_oldprice = $xtPrice->xtcGetPrice($array['products_id'], $format = true, 1, $array['products_tax_class_id'], $array['products_oldprice'], 1);

			if ($_SESSION['customers_status']['customers_status_show_price'] != '0') {
			if ($_SESSION['customers_status']['customers_fsk18'] == '1') {
				if ($array['products_fsk18'] == '0')
					$buy_now = $this->getBuyNowButton($array['products_id'], $array['products_name']);
			
			} else {
				$buy_now = $this->getBuyNowButton($array['products_id'], $array['products_name']);
			}
			}
			

		
			$shipping_status_name = $main->getShippingStatusName($array['products_shippingtime']);
			$shipping_status_image = $main->getShippingStatusImage($array['products_shippingtime']);
		
		
		return array ('PRODUCTS_NAME' => $array['products_name'], 
				'COUNT'=>$array['ID'],
				'PRODUCTS_ID'=>$array['products_id'],
				'PRODUCTS_VPE' => $this->getVPEtext($array, $products_price['plain']), 
				'PRODUCTS_IMAGE' => $this->productImage($array['products_image'], $image), 
				'PRODUCTS_LINK' => xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($array['products_id'], $array['products_name'])), 
				'PRODUCTS_PRICE' => $products_price['formated'], 
				'PRODUCTS_OLDPRICE' => $products_oldprice['formated'], 
				'PRODUCTS_TAX_INFO' => $main->getTaxInfo($tax_rate), 
				'PRODUCTS_SHIPPING_LINK' => $main->getShippingLink(), 
				'PRODUCTS_BUTTON_BUY_NOW' => $buy_now,
				'PRODUCTS_SHIPPING_NAME'=>$shipping_status_name,
				'PRODUCTS_SHIPPING_IMAGE'=>$shipping_status_image, 
				'PRODUCTS_DESCRIPTION' => $array['products_description'],
				'PRODUCTS_EXPIRES' => $array['expires_date'],
				'PRODUCTS_CATEGORY_URL'=>$array['cat_url'],
				'PRODUCTS_SHORT_DESCRIPTION' => $array['products_short_description'], 
				'PRODUCTS_FSK18' => $array['products_fsk18'],
				'PRODUCTS_QUANTITY' => $array['products_quantity'],);		
}
In includes/modules/default.php gibt es keine smarty-Assigns, da habe ich nur bei den sql-Abfragen das zusätzliche Feld hinzugefügt.

includes/modules/product_info.php:
Code:
nähe Zeile 80:
$info_smarty->assign('PRODUCTS_OLDPRICE',$products_oldprice['formated']);
inc/xtx_get_products_inc.php:
Code:
oben: SQL-Abfrage um Feld erweitert
...
nähe Zeile 55:
// dirty workaround
          $xtPrice = new xtcPrice($session['currency'],$session['customers_status']['customers_status_id']);
          $products_price=$xtPrice->xtcGetPrice($products['products_id'],
                                        $format=false,
                                        $session['cart']->contents[$products_id]['qty'],
                                        $products['products_tax_class_id'],
                                        $products['products_price']);


          $products_array[] = array('id' => $products_id,
                                    'name' => $products['products_name'],
                                    'model' => $products['products_model'],
                                    'image' => $products['products_image'],
                                    'price' => $products_price+attributes_price($products_id,$session),
                                    'quantity' => $session['cart']->contents[$products_id]['qty'],
                                    'standard' => $products['products_std'],
                                    'old_price' => $products['products_oldprice'];
                                    'shipping_time' => $products['products_shippingtime'],//eingefügt EnzephaloN IT-Solutions
                                    'weight' => $products['products_weight'],
                                    'final_price' => ($products_price+attributes_price($products_id,$session)),
                                    'tax_class_id' => $products['products_tax_class_id'],
                                    'attributes' => $session['contents'][$products_id]['attributes']);
Was habe ich wo noch vergessen?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #4 (permalink)  
Alt 30.01.2009, 14:46
Benutzer
 
Registriert seit: 18.05.2005
Beiträge: 39
Standard

jetzt bin ich dem "Fehler" auf die Schliche gekommen!!!

in PRODUCTS_PRICE und PRODUCTS_OLDPRICE werden ja keine Zahlen, sondern ein String (zB 11,99 EUR) übergeben, weswegen ein Vergleich mit größer und kleiner nicht funktioniert.

Nun will ich aber das PRODUCTS_OLDPRICE nur anzeigen, wenn der Wert größer ist als der Wert von PRODUCTS_PRICE.

Gibt es ne Mögichkeit in der Templatedatei da mittels einer Funktion den String in ein Real umzuwandeln?

EnzephaloN
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #5 (permalink)  
Alt 30.01.2009, 18:43
Benutzer
 
Registriert seit: 18.05.2005
Beiträge: 39
Standard

Vorheriges Problem ist gelöst!

Aber:
in product_listing.html Template
wir halt immer von $module_data.PRODUCTS_PRICE gesprochen
wenn ich aber dort $module_data.PRODUCTS_OLDPRICE einfüge hat der KEINEN Inhalt!

Wo wird diese Variable mit Daten gefüllt???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
eigene, felder, wiedermal

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
Kontaktformular felder werden gelöscht Primus2007 Shopbereich 1 21.03.2008 14:18
Neue Select Felder philipp1988 Admininterface 1 09.01.2008 10:38


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:51 Uhr.

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

xt:Commerce is a SafeCharge brand