Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
Das wäre eine andere Frage. Erstmal das Hauptproblem lösen.Warum versucht die Seite Sterne an den Stellen anzuzeigen wo überhaupt keine Bewertung abgegeben wurde?
Vor reviews dürfte nur ein backslash stehen und der Name von.gif stimmt auch nicht.<img src="http://herzog.cubemedia.info/components/com_virtuemart/assets//reviews/.gif" alt=" Sternchen">
echo $product->votes->rating
wenn was ausgegeben wird siehste es vielleicht besser. Oder schreib irgendwoecho '<h1>'$product->votes->rating'</h1>'
<?php
$ratingtest = $product->votes->rating;
echo "<script type="text/javascript">alert(".$ratingtest.");</script>";
?>
<?php
$ratingtest = $product->votes->rating;
echo '<script type="text/javascript">alert("'.$ratingtest.'");</script>';
echo '<h1>';
$product->votes->rating;
echo'</h1>';
?>
########################################################################
Bei mir ab Zeile 79
########################################################################
//foreach($products as $product){ DIESER BEREICH WIRD ERSETZT
// $product->stock = $productModel->getStockIndicator($product); DIESER BEREICH WIRD ERSETZT
//} DIESER BEREICH WIRD ERSETZT
$ratingModel = VmModel::getModel('ratings');
foreach($products as $product)
{
$product->stock = $productModel->getStockIndicator($product);
$product->showRating = $ratingModel->showRating($product->virtuemart_product_id);
if ($product->showRating)
{
$product->vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
$product->rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
}
}
########################################################################
Dann ab Zeile 96 werden 2 Zeilen hinzugefügt:
########################################################################
$ratingModel = VmModel::getModel('ratings');
$showRating = $ratingModel->showRating();
$this->assignRef('showRating', $showRating);
$rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
$this->assignRef('rating', $rating);
Ich habe jetzt natürlich ein riesen Durcheinander aber wir ersetzen einfach die Stelle:
<?php if ($this->showRating) { ?>
<span class="contentpagetitle"><?php echo JText::_ ('COM_VIRTUEMART_CUSTOMER_RATING') ?>:</span>
<?php
$img_url = JURI::root().VmConfig::get('assets_general_path').'/reviews/'.$product->votes->rating.'.gif';
echo JHTML::image($img_url, $product->votes->rating.' '.JText::_('COM_VIRTUEMART_REVIEW_STARS'));
echo JText::_('COM_VIRTUEMART_TOTAL_VOTES').": ". $product->votes->allvotes;
?>
<?php } ?>
mit:
<?php
if ($this->showRating) {
$maxrating = VmConfig::get ('vm_maximum_rating_scale', 5); // these are imp
$ratingsShow = VmConfig::get ('vm_num_ratings_show', 3); // these are imp
if (empty($product->rating)) {
/* ICH HABE HIER AUSKOMMENTIERT WEIL: KEIN VOTING / KEINE ANZEIGE
FÜR MICH UNNÖTIG UND UNSCHÖN
?>
<span class="vote"><?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' . JText::_('COM_VIRTUEMART_UNRATED') ?></span>
<?php*/
} else {
$ratingwidth = ( $product->rating->rating * 100 ) / $maxrating;
?>
<span class="vote">
<?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' . round($product->rating->rating, 2) . '/' . $maxrating; ?><br/>
<span title=" <?php echo (JText::_("COM_VIRTUEMART_RATING_TITLE") . $product->rating->rating . '/' . $maxrating) ?>" class="vmicon ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth.'%'; ?>"></span>
</span>
</span>
<?php
}
}
?>
.ratingbox span {