Hallo Community,
ich versuche verzweifelt die Verfügbarkeit der Produkte nicht erst in den Produktdetails sondern schon in der Übersicht der Produkte zu zeitgen. Zur genaueren Erläuterung: Wenn ich in meinem Shop 50fifty-scooter.de z.B. die Kategorie "Komplettscooter" wähle und dann die Marke "Mgp- MADD" dann werden alle Stunt-Scooter dieser Marke aufgelistet. Hier sollte schon das Bild der Verfügbarkeit angezeigt werden. So wie sie angezeigt wird wenn ich eins der Produkte auswähle/anklicke.
Ich glaube den richtigen Codeschnipsel schon gefunden zu haben
- <?php // Availability Image for Category page
- $stockhandle = VmConfig::get('stockhandle', 'none');
- if (($product->product_in_stock - $product->product_ordered) < 1) {
- if ($stockhandle == 'risetime' and VmConfig::get('rised_availability') and empty($product->product_availability)) {
- ?> <div class="availability">
- <?php echo (file_exists(JPATH_BASE . DS . VmConfig::get('assets_general_path') . 'images/availability/' . VmConfig::get('rised_availability'))) ? JHTML::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' . VmConfig::get('rised_availability', '7d.gif'), VmConfig::get('rised_availability', '7d.gif'), array('class' => 'availability')) : VmConfig::get('rised_availability'); ?>
- </div>
- <?php
- } else if (!empty($product->product_availability)) {
- ?>
- <div class="availability">
- <?php echo (file_exists(JPATH_BASE . DS . VmConfig::get('assets_general_path') . 'images/availability/' . $this->product->product_availability)) ? JHTML::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' . $product->product_availability, $product->product_availability, array('class' => 'availability')) : $product->product_availability; ?>
- </div>
- <?php
- }
- }
- ?>
Das Problem bzw. mein Problem ist, dass ich ein Theme von "developing-and-design.com" nutze und die richtige Datei in der ich den Code ienfügen sollte scheinbar diese ist: /templates/your template/html/com_virtuemart/themes/grids/products/centered.php
- <?php
- /**
- * Theme: VirtueMart Theme
- *
- * @package FrontEnd / Template
- * @author MoWebSo.com / Eugen Stranz
- * @copyright (C) 2009 - 2013 ENYtheme e.K.
- * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
- */
- function outputProductsCentered($product,$show) {
- // Get The Instance Of The Current Currency
- $currency = CurrencyDisplay::getInstance( );
- // Definition Of Product Link
- $productLink = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id;
- // Definition Of Category Link
- $categoryURL = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $product->virtuemart_category_id );
- // Build The Product Output
- $html = '';
- $html.= '<div class="item-column" itemscope itemtype="http://schema.org/Product">';
- $html.= '<div class="spacer">';
- // Output: Product Name
- // if($show['show_product_name'] == 'yes') {
- $html.= '<h3 class="product-name" itemprop="name">';
- $html.= '<a itemprop="url" href="'.$productLink.'" title="'.$product->product_name.'">';
- $html.= $product->product_name;
- $html.= '</a>';
- $html.= '</h3>';
- //}
- // Output Category Link
- /* //if($show['show_limit_cat'] == 'yes') {
- $html.= '<div class="category-name">';
- $html.= JText::_('COM_VIRTUEMART_CATEGORY_NAME').': '.JHTML::link($categoryURL, '<span>'.$product->category_name.'</span>', array('title' => $product->category_name,'class' => 'category-name-link'));
- $html.= '</div>';
- //} */
- // Output: Product Image
- if ($product->images[0]->file_name) {
- // && $show['show_product_image'] == 'yes'
- $html.= '<div class="product-thumbnail">';
- $html.= '<a href="'.$productLink.'" title="'.$product->product_name.'">';
- $html.= '<img src="'.JRoute::_($product->images[0]->file_url_thumb).'" itemprop="image" class="product-image" title="'.$product->product_name.'" alt="'.$product->product_name.'" />';
- $html.= '</a>';
- $html.= '</div>';
- } else {
- $html.= '<div class="product-thumbnail">';
- $html.= '<a href="'.$productLink.'" title="'.$product->product_name.'">';
- $html.= $product->images[0]->displayMediaThumb('class="product-image"', false);
- $html.= '</a>';
- $html.= '</div>';
- }
- // Output: Product Short Description
- /*//if (!empty($product->product_s_desc) && $show['show_product_desc'] == 'yes') {
- $html.= '<div class="product-short-desc">';
- $html.= shopFunctionsF::limitStringByWord($product->product_s_desc, 60 , '...');
- $html.= '</div>';
- //} */
- // Output: Product Prices
- //if (VmConfig::get ( 'show_prices' ) == '1' && $show['show_product_price'] == 'yes') {
- $html.= '<div class="product-prices" id="productPrice'.$product->virtuemart_product_id.'" itemprop="offers" itemscope itemtype="http://schema.org/Offer">';
- if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and !$product->images[0]->file_is_downloadable) {
- $html.= JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
- }
- //todo add config settings
- $html.= $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
- $html.= $currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $product->prices);
- $html.= $currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
- if (round($product->prices['basePriceWithTax'],$currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
- $html.= '<div class="price-crossed" >' . $currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</div>";
- }
- if (round($product->prices['salesPriceWithDiscount'],$currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
- $html.= $currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
- }
- $html.= '<div itemprop="price">';
- $html.= $currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
- $html.= '</div>';
- if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
- $html.= $currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
- } else {
- $html.= $currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
- }
- $html.= $currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
- $html.= $currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
- $html.= $currency->createPriceDiv ('unitPrice', JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit), $product->prices);
- $html.= '</div>';
- //}
- // Product Link As Action Button
- //if($show['show_product_details'] == 'yes') {
- $html.= '<div class="product-link">';
- $html.= JHTML::link ( JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id ), '<span>'.JText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ).'</span>', array ('title' => $product->product_name, 'class' => 'btn btn-small' ) );
- $html.= '</div>';
- //}
- /*
- if (!VmConfig::get ('use_as_catalog', 0)) {
- // && $show['show_addtocart'] == 'yes'
- $stockhandle = VmConfig::get ('stockhandle', 'none');
- if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($product->product_in_stock - $product->product_ordered) < 1) {
- $html.= '<div>';
- $html.= '<a href="'.JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id=' . $product->virtuemart_product_id).'" class="btn">'.JText::_ ('COM_VIRTUEMART_CART_NOTIFY').'</a>';
- $html.= '</div>';
- } else {
- $html.= '<div class="addtocart-area">';
- $html.= '<form id="productfrom'.$product->virtuemart_product_id.'" method="post" class="product" action="index.php">';
- // Output: Product Custom Fields
- if (!empty($product->customfieldsCart)) {
- // && $show['show_custom_field'] == 'yes'
- $html.= '<div class="product-fields">';
- foreach ($product->customfieldsCart as $field) {
- $html.= '<div class="product-field product-field-type-'.$field->field_type.'">';
- $html.= '<span class="title">'.$field->custom_title.'</span>';
- $html.= '<span class="display">'.$field->display.'</span>';
- $html.= '<span class="desc">'.$field->custom_field_desc.'</span>';
- $html.= '</div>';
- }
- $html.= '</div>';
- }
- $html.= '<div class="addtocart-bar">';
- // Output: Quantity Controls
- $minOrderLevel = (isset($product->min_order_level) && (int) $product->min_order_level > 0) ? $minOrderLevel = $product->min_order_level : $minOrderLevel = '1';
- $html.= '<span class="quantity-box">';
- $html.= '<input type="text" class="quantity-input js-recalculate" name="quantity" value="'.$minOrderLevel.'" />';
- $html.= '</span>';
- $html.= '<span class="quantity-controls">';
- $html.= '<input type="button" class="quantity-controls quantity-plus"/>';
- $html.= '<input type="button" class="quantity-controls quantity-minus"/>';
- $html.= '</span>';
- // Output: Add To Cart Button
- $html.= '<span class="addtocart-button">';
- $addToCartButton = shopFunctionsF::getAddToCartButton($product->orderable);
- $html.= str_replace('class="addtocart-button"','class="btn btn-success addtocart-button"', $addToCartButton);
- $html.= '</span>';
- $html.= '<div class="clear"></div>';
- $html.= '</div>';
- // Output: Required Hidden Fields
- $html.= '<input type="hidden" class="pname" value="'.$product->product_name.'"/>';
- $html.= '<input type="hidden" name="option" value="com_virtuemart"/>';
- $html.= '<input type="hidden" name="view" value="cart"/>';
- $html.= '<noscript><input type="hidden" name="task" value="add"/></noscript>';
- $html.= '<input type="hidden" name="virtuemart_product_id[]" value="'.$product->virtuemart_product_id.'"/>';
- $html.= '<input type="hidden" name="virtuemart_category_id[]" value="'.$product->virtuemart_category_id.'"/>';
- $html.= '</form>';
- $html.= '<div class="clear"></div>';
- $html.= '</div>';
- }
- } */
- $html.= '<div class="clear"></div>';
- $html.= '</div>';
- $html.= '</div>';
- return $html;
- }
Kann jemand helfen den Code hier zu integrieren? Oder mir anderweitig helfen wenn ich daneben liegen sollte?
Sorry für die lange ansprache aber ich möchte so genau wie möglich zu sein da es ein Problem ist dessen Lösung sehr wichtig für mich ist.
Vielen Dank und genre liefere ich weitere Infos falls benötigt!
Gruß
Nikolas