Guten Abend liebe Gemeinde,
viele kennen sicherlich das Problem, dass wenn man sich im Warenkorb befindet und man die Artikelmenge ändern möchte, zuerst das Icon anklicken muss bevor diese geändert wird. Ich habe eine Lösung für euch programmiert, getestet bis VM 1.0.7!
Bitte sichert die entsprechende Originale vor der modifizierung:
Datei "basket.php" editiren: Zeile 109-110
mit diesen Code ersetzen:Dateien "basket_b2b.html.php" und "basket_b2c.html.php" ganz mit diesen Code ersetzen:Code:/* Quantity Box */ $product_rows[$i]['quantity_box'] = "<input type=\"text\" title=\"". $VM_LANG->_PHPSHOP_CART_UPDATE ."\" class=\"inputbox\" size=\"4\" maxlength=\"4\" name=\"quantity\" value=\"".$cart[$i]["quantity"]."\" onChange=\"window.document.versand".($i+1).".submit();\" />";
Abspeichern, Browser Cache löschen und fertig: wenn Ihr jetzt die Menge im Warenkorb ändert und der Zeiger die Inputbox verlässt, aktualisiert sich automatisch die Menge udn der Preis, ohne den "Aktualisieren Icon" zu klicken.Code:<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); /** * This is the default Basket Template. Modify as you like. * * @version $Id: basket_b2c.html.php,v 1.3.2.1 2006/02/27 19:41:42 soeren_nb Exp $ * @package VirtueMart * @subpackage templates * @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details. * * http://virtuemart.net */ ?> <style type="text/css"> <!-- .layer-content { position: relative; top:93px; height: 100%; margin-left: 10px; background-color: #F8F4EB; border: 1px solid #F8CEA3; padding: 5px; } --> </style> <table width="100%" cellspacing="2" cellpadding="4" border="0"> <tr align="left" class="sectiontableheader"> <th><?php echo $VM_LANG->_PHPSHOP_CART_NAME ?></th> <th><?php echo $VM_LANG->_PHPSHOP_CART_SKU ?></th> <th><?php echo $VM_LANG->_PHPSHOP_CART_PRICE ?></th> <th><?php echo $VM_LANG->_PHPSHOP_CART_QUANTITY ?></th> <th><?php echo $VM_LANG->_PHPSHOP_CART_SUBTOTAL ?></th> <th colspan="2" align="center"><?php echo $VM_LANG->_PHPSHOP_CART_ACTION ?></th> </tr> <?php $i = 1; ?> <?php foreach( $product_rows as $product ) { ?> <tr valign="top" class="<?php echo $product['row_color'] ?>"> <form name="versand<?php echo $i; ?>" action="<?php echo $action_url ?>" method="post"> <input type="hidden" name="option" value="com_virtuemart" /> <td><?php echo $product['product_name'] . $product['product_attributes'] ?></td> <td><?php echo $product['product_sku'] ?></td> <td><?php echo $product['product_price'] ?></td> <td><?php echo $product['quantity_box'] ?></td> <td><?php echo $product['subtotal'] ?></td> <td><?php echo $product['update_form'] ?></td> <td><?php echo $product['delete_form'] ?></td> </tr> <?php $i = $i+1; } ?> <!--Begin of SubTotal, Tax, Shipping, Coupon Discount and Total listing --> <tr class="sectiontableentry2"> <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_CART_SUBTOTAL ?>:</td> <td colspan="3"><?php echo $subtotal_display ?></td> </tr> <?php if( $discount_before ) { ?> <tr class="sectiontableentry1"> <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_COUPON_DISCOUNT ?>: </td> <td colspan="3"><?php echo $coupon_display ?></td> </tr> <?php } if( $shipping ) { ?> <tr class="sectiontableentry1"> <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SHIPPING ?>: </td> <td colspan="3"><?php echo $shipping_display ?></td> </tr> <?php } if($discount_after) { ?> <tr class="sectiontableentry1"> <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_COUPON_DISCOUNT ?>: </td> <td colspan="3"><?php echo $coupon_display ?></td> </tr> <?php } ?> <tr> <td colspan="3"> </td> <td colspan="4"><hr /></td> </tr> <tr> <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_TOTAL ?>: </td> <td colspan="3"><strong><?php echo $order_total_display ?></strong> </td> </tr> <?php if ( $show_tax ) { ?> <tr class="sectiontableentry2"> <td colspan="4" align="right" valign="top"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_TOTAL_TAX ?>: </td> <td colspan="3"><?php echo $tax_display ?></td> </tr> <?php } ?> <tr> <td colspan="7"><hr /></td> </tr> </table>
Was wurde gemacht: in der basket.php wurde ein JavaScript eingebunden mit dem Namen des Formulars und der automatischen aktualisierung, sofern man das Inputfeld verläßt. In den basket Templates wurde in die Schleife eine "Hochzähl Variable" eingebunden und dem Formular der Name "versand" zugewiesen!
Viel Spaß damit!
MfG Eseno


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen