Hallo,
ich habe mich hier im Forum angemeldet weil ich kurz vor der Verzweiflung stehe. Ich bin nicht sehr erfahren was PHP angeht deshalb bitte ich um Entschuldigung wenn ich eine Noobie frage stellen sollte.
Also, ich arbeite mit Joomla und Virtuemart um einen Online Shop zu realisieren. Ich biete MP3s an und habe den 1pixeloutplayer erfolgreich in die Virtuemart short description einfügen können um eine Preview für jede MP3 anbieten zu können. Nun möchte ich gerne die short description innerhalb eines Moduls (latest products) einfügen. Ich bin im Internet auf folgende Anleitung gestoßen.
http://forum.virtuemart.net/index.php?topic=64564.30
Ich habe alle Schritte genau so ausgeführt wie es dort angegeben ist. Nur mit der ps_product.php habe ich Probleme. Ich habe den Code für diese Datei 1zu1 aus dieser Anleitung kopiert aber erhalte folgenden Fehlercode:
Fatal error: Class 'vm_ps_product' not found in administrator/components/com_virtuemart/classes/ps_product.php on line 4
Der Code für die ps_product.php lautet wie folgt:
Ich habe schon in dem anderen Forum geposted aber niemand konnte mir weiterhelfen, deswegen habe ich gehofft vielleicht hier jemanden zu finden der mir helfen könnte. Würde mich über jeden Hilfsversuch sehr freuen.
ich habe mich hier im Forum angemeldet weil ich kurz vor der Verzweiflung stehe. Ich bin nicht sehr erfahren was PHP angeht deshalb bitte ich um Entschuldigung wenn ich eine Noobie frage stellen sollte.
Also, ich arbeite mit Joomla und Virtuemart um einen Online Shop zu realisieren. Ich biete MP3s an und habe den 1pixeloutplayer erfolgreich in die Virtuemart short description einfügen können um eine Preview für jede MP3 anbieten zu können. Nun möchte ich gerne die short description innerhalb eines Moduls (latest products) einfügen. Ich bin im Internet auf folgende Anleitung gestoßen.
http://forum.virtuemart.net/index.php?topic=64564.30
Ich habe alle Schritte genau so ausgeführt wie es dort angegeben ist. Nur mit der ps_product.php habe ich Probleme. Ich habe den Code für diese Datei 1zu1 aus dieser Anleitung kopiert aber erhalte folgenden Fehlercode:
Fatal error: Class 'vm_ps_product' not found in administrator/components/com_virtuemart/classes/ps_product.php on line 4
Der Code für die ps_product.php lautet wie folgt:
Code:
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); class ps_product extends vm_ps_product { /** * Alternative product_snapshot method which reads the product's description and * puts it into the template */ /** * Returns HTML code for a snapshot of a product based on the product sku. * This was written to provide a quick way to display a product inside of modules * * @param string $product_sku The SKU identifying the product * @param boolean $show_price Show the product price? * @param boolean $show_addtocart Show the add-to-cart link? * @param boolean $show_product_name Show the product name? */ function product_snapshot( $product_sku, $show_price=true, $show_addtocart=true, $show_product_name = true ) { global $sess, $mm_action_url; $db = new ps_DB; require_once(CLASSPATH.'ps_product_category.php'); $ps_product_category = new ps_product_category; $q = "SELECT product_id, product_name, product_parent_id, product_thumb_image, product_desc FROM #__{vm}_product WHERE product_sku='$product_sku'"; $db->query( $q ); if ($db->next_record()) { $product_id = $db->f("product_id" ); $tpl = new $GLOBALS['VM_THEMECLASS'](); $cid = $ps_product_category->get_cid( $product_id ); $tpl->set( 'product_id', $product_id); $tpl->set( 'product_name', $db->f("product_name") ); $tpl->set( 'product_desc', $db->f("product_desc") ); $tpl->set( 'show_product_name', $show_product_name ); if ($db->f("product_parent_id")) { $url = "?page=shop.product_details&category_id=$cid&flypage=".$this->get_flypage($db->f("product_parent_id")); $url .= "&product_id=" . $db->f("product_parent_id"); } else { $url = "?page=shop.product_details&category_id=$cid&flypage=".$this->get_flypage($db->f("product_id")); $url .= "&product_id=" . $db->f("product_id"); } $product_link = $sess->url($mm_action_url. "index.php" . $url); $tpl->set( 'product_link', $product_link ); $tpl->set( 'product_thumb_image', $db->f("product_thumb_image"), "alt=\"".$db->f("product_name")."\""); if (_SHOW_PRICES == '1' && $show_price) { // Show price, but without "including X% tax" $price = $this->show_price( $db->f("product_id"), true ); $tpl->set( 'price', $price ); } if (USE_AS_CATALOGUE != 1 && $show_addtocart && isset( $GLOBALS['product_info'][$product_id]['price']['product_price_id'] ) // Product must have a price to add it to cart && !$this->product_has_attributes($product_id, true) // Parent Products and Products with attributes can't be added to cart this way ) { $url = "?page=shop.cart&func=cartAdd&product_id=" . $db->f("product_id"); $addtocart_link = $sess->url($mm_action_url. "index.php" . $url); $tpl->set( 'addtocart_link', $addtocart_link ); } return $tpl->fetch( 'common/productsnapshot.tpl.php'); } return ´´; } } ?>
Kommentar