Hallo Leute!
Es geht um VirtueMart. Ich benutze: Joomla! 1.0.13 Stable
Seit einiger Zeit versuche ich eine passende Lösung für die Produktattribute zu finden, leider bin ich stecken geblieben.
Ich möchte gerne statt der Dropdown-Liste die Radiobuttons einsetzen.
Ich habe das gesamte Forum durchstöbert, aber komme nicht wirklich weiter…
So ist es:
Und so soll es sein:
Über eine Lösung würde ich mich sehr freuen.
Hier die entsprechende Stelle in der
administrator\components\com_virtuemart\classes\ps_product_attribute.php
ab ca. Zeile 285
================================================== =========
function list_advanced_attribute($product_id) {
global $CURRENCY_DISPLAY;
$db = new ps_DB;
$auth = $_SESSION['auth'];
$q = "SELECT product_id, attribute FROM #__{vm}_product WHERE product_id='$product_id'";
$db->query($q);
$db->next_record();
$advanced_attribute_list=$db->f("attribute");
if ($advanced_attribute_list) {
$has_advanced_attributes=1;
$fields=explode(";",$advanced_attribute_list);
$html = "";
foreach($fields as $field) {
$base=explode(",",$field);
$title=array_shift($base);
$titlevar=str_replace(" ","_",trim($title));
$html .= "<style=\"width:60%;float:left;text-align:right;margin:3px;\">";
$html .= "<label for=\"".$titlevar."_field\">$title</label>: ";
$html .= "<style=\"width:60%;float:left;margin:3px;\"><sele ct class=\"inputbox\" id=\"".$titlevar."_field\" name=\"$titlevar\">";
foreach ($base as $base_value) {
// the Option Text
$attribtxt=substr($base_value,0,strrpos($base_valu e, '['));
if( $attribtxt != "") {
$vorzeichen=substr($base_value,strrpos($base_value , '[')+1,1); // negative, equal or positive?
if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
$price = floatval(substr($base_value,strrpos($base_value, '[')+2))*(1+ @$_SESSION['product_sess'][$product_id]['tax_rate']); // calculate Tax
}
else {
$price = floatval(substr($base_value,strrpos($base_value, '[')+2));
}
// Apply shopper group discount
$price *= 1 - ($auth["shopper_group_discount"]/100);
if ($price=="0") {
$attribut_hint = "test";
}
$base_var=str_replace(" ","_",$base_value);
$base_var=substr($base_var,0,strrpos($base_var, '['));
$html.="<option value=\"$base_var\">$attribtxt";
if( $_SESSION['auth']['show_prices'] ) {
$html .= " ( ".$vorzeichen." ".$CURRENCY_DIS PLAY->getFullValue($price)." )";
}
$html .= "</option>";
}
else {
$base_var=str_replace(" ","_",$base_value);
$html.="<option value=\"$base_var\">$base_value</option>";
}
}
$html.="</select><br><br style=\"clear:both;\" />\n";
}
//$html.="</table>";
}
if ($advanced_attribute_list) {
return $html;
}
}
=============================================


LinkBack URL
About LinkBacks

Zitieren

Lesezeichen