Jump to content
xt:Commerce Community Forum

Modul Preis als Grafik -> Sonderangebote


Johnny0815

Recommended Posts

Moin Jungs,

hab das Modul Preis als Grafik bei mir "installiert".

Nun folgende Frage:

Wie kann ich das hinkiegen, dass bei Sonderangeboten

das Statt XX,XX€ wieder durchgestrichen angezeigt wird und nur das

Jetzt XX,XX€ als Grafik angezeigt wird?

Jemand eine Idee? Also es muss wohl was an der "get_price_image.php" geändert werden. Soviel konnte ich schon googeln *g*

Johnny :D

Link to comment
Share on other sites

So sieht meine get_price_image.php aus

<?php

/*

Gibt einen Preis als Grafik aus

Copyright© 2006 Sergej Stroh und Walter Lutz.

www.*****************************************************************************.de

21.10.2006

*/

function getPriceImage($price, $cur_sym_right = '')

{

$price_string_pre = '';

$price_string_suf = '';

$specials = false;

if (strstr ($price, INSTEAD))

{

$split_price = split (INSTEAD, $price);

$new_price = split (ONLY, $split_price[1]);

$price = $new_price[0];

$currency = split (' ', $new_price[1]);

$cur_sym_right = end($currency);

$price_string_pre = INSTEAD;

$specials = true;

}

else if (strstr ($price, FROM))

{

$price_string_pre = FROM;

}

// Zahlen als Grafiken, bei Bedarf anpassen

$images = array('<img src="templates/'.CURRENT_TEMPLATE.'/img/0.gif" alt="0" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/1.gif" alt="1" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/2.gif" alt="2" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/3.gif" alt="3" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/4.gif" alt="4" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/5.gif" alt="5" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/6.gif" alt="6" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/7.gif" alt="7" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/8.gif" alt="8" />',

'<img src="templates/'.CURRENT_TEMPLATE.'/img/9.gif" alt="9" />');

$image_comma = '<img src="templates/'.CURRENT_TEMPLATE.'/img/komma.gif" alt="komma" />';

$currency = '<img src="templates/'.CURRENT_TEMPLATE.'/img/' . strtolower($cur_sym_right) . '.gif" alt="curr" />';

$number = array("0","1","2","3","4","5","6","7","8","9");

if(is_string($price)){ //is_numeric

$strlen_price = strlen($price) - 1;

$count_number_array = count ($number);

for ($i = 0; $i < $strlen_price; $i++)

{

if ($price{$i} == ',')

$price_string_suf .= $image_comma;

for ($y = 0; $y < $count_number_array; $y++)

{

if ($price{$i} == $number[$y])

$price_string_suf .= $images[$y];

}

}

$price_string_suf .= $currency;

$price_string = $price_string_pre . $price_string_suf;

}

if ($specials)

{

$price_string_suf = '';

$price = $new_price[1];

if(is_string($price))

{ //is_numeric

$strlen_price = strlen($price) - 1;

$count_number_array = count ($number);

$price_string_pre = ' <br /> ' . ONLY;

if (strstr ($price, FROM))

$price_string_pre .= ' ' . FROM;

for ($i = 0; $i < $strlen_price; $i++)

{

if ($price{$i} == ',')

$price_string_suf .= $image_comma;

for ($y = 0; $y < $count_number_array; $y++)

{

if ($price{$i} == $number[$y])

$price_string_suf .= $images[$y];

}

}

$price_string_suf .= $currency;

$price_string .= $price_string_pre . $price_string_suf;

}

}

return $price_string;

}

?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...