So Leute, hier mal eine Möglichkeit, die Versandkosten bereits im Warenkorb anzeigen zu lassen.
/includes/modules/order_details_cart.phpsuche:$module_smarty->assign('TOTAL_CONTENT', $total_content);
$module_smarty->assign('language', $_SESSION['language']);
$module_smarty->assign('module_content', $module_content);
davor das hier einfügen://BOF - GTB - show Shipping in cartrequire (DIR_WS_CLASSES
.'order.php');$order = new order
();$total_weight = $_SESSION['cart']->show_weight();$total_count = $_SESSION['cart']->count_contents();if (!isset($order->delivery['country']['iso_code_2']) || $order->delivery['country']['iso_code_2'] == '') { unset($_SESSION['shipping']); $delivery_zone = xtc_db_fetch_array
(xtc_db_query
("SELECT countries_id, countries_iso_code_2, countries_name FROM ".TABLE_COUNTRIES
." WHERE countries_id = ". STORE_COUNTRY
)); $order->delivery['country']['iso_code_2'] = $delivery_zone['countries_iso_code_2']; $order->delivery['country']['title'] = $delivery_zone['countries_name']; $order->delivery['country']['id'] = $delivery_zone['countries_id'];}$_SESSION['delivery_zone'] = $order->delivery['country']['iso_code_2'];require (DIR_WS_CLASSES
.'shipping.php');$shipping = new shipping
;$quotes = $shipping->quote();if (defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING
== 'true')) { switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION
) { case 'national' : if ($order->delivery['country']['id'] == STORE_COUNTRY
) $pass = true; break; case 'international' : if ($order->delivery['country']['id'] != STORE_COUNTRY
) $pass = true; break; case 'both' : $pass = true; break; default : $pass = false; break; } $free_shipping = false; if (($pass == true) && ($order->info['total']>= $xtPrice->xtcFormat(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER
, false, 0, true))) { $free_shipping = true; }} else { $free_shipping = false;}include (DIR_WS_LANGUAGES
.$_SESSION['language'].'/modules/order_total/ot_shipping.php');$shipping_content = array ();if ($free_shipping == true) { $shipping_content[] = array( 'NAME' => FREE_SHIPPING_TITLE
, 'VALUE' => $xtPrice->xtcFormat(0, true, 0, true) );} else { $module_smarty->assign('FREE_SHIPPING_INFO', sprintf(FREE_SHIPPING_DESCRIPTION
, $xtPrice->xtcFormat(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER
, true, 0, true))); $i = 0; foreach ($quotes AS $quote) { if ($quote['id'] != 'freeamount' && is_array($quote['methods'])) { $shipping_content[$i] = array( 'NAME' => $quote['module'] . ' - ' . $quote['methods'][0]['title'], 'VALUE' => $xtPrice->xtcFormat(((isset($quote['tax']) && $quote['tax']> 0) ?
$xtPrice->xtcAddTax($quote['methods'][0]['cost'],$quote['tax']) : (!empty($quote['methods'][0]['cost']) ?
$quote['methods'][0]['cost'] : '0')), true) ); $i++; } }}unset($_SESSION['delivery_zone']);$module_smarty->assign('shipping_content', $shipping_content);$module_smarty->assign('COUNTRY', $order->delivery['country']['title']);//EOF - GTB - show Shipping in cart /templates/xtc5/module/order_details.htmldas hier am Ende einfügen:<br/>
<table class="orderdetails" width="100%" border="0" cellspacing="0" cellpadding="6">
<tr class="headerrow">
<td class="left">{#text_possible_shipping_type#} {$COUNTRY}{if $FREE_SHIPPING_INFO} - {$FREE_SHIPPING_INFO}{/if}</td>
<td class="center"> </td>
</tr>
{foreach name=aussen item=shipping_data from=$shipping_content}
<tr>
<td colspan="1" class="subtotal">{$shipping_data.NAME} :<strong>{$shipping_data.VALUE}</strong></td>
<td class="subtotal"> </td>
</tr>
{/foreach}
</table>
/lang/german/lang_german.confsuche das hier:#shopping cart
[shopping_cart]
heading_cart = 'Ihr Warenkorb enthält:'
text_empty = 'Ihr Warenkorb ist leer.'
text_remove = 'Entfernen'
text_qty = 'Anzahl'
text_article = 'Artikel'
text_total = 'Summe'
text_single = 'Einzelpreis'
füge danach das hier ein:text_possible_shipping_type = 'mögliche Versandarten für'
BUGFIXbisher hatte ich nie die Möglichkeit den immer wieder gemeldete Fehlermeldung nicht nachstellen. Durch Zufall hatte ich plötzlich auch diese Meldung.
Cannot use object of type __PHP_Incomplete_Class as array
Jetzt habe ich auch eine Lösung dafür:
/includes/classes/order.php
ca. Zeile 361
'shipping_method' => isset($_SESSION['shipping']) ?
$_SESSION['shipping']['title'] : '', 'shipping_cost' => isset($_SESSION['shipping']) ?
$_SESSION['shipping']['cost'] : '', 'comments' => isset($_SESSION['comments']) ?
$_SESSION['comments'] : '', 'shipping_class' => isset($_SESSION['shipping']) ?
$_SESSION['shipping']['id'] : '', ersetzen mit dem hier:
'shipping_method' => is_array($_SESSION['shipping']) ?
$_SESSION['shipping']['title'] : '', 'shipping_cost' => is_array($_SESSION['shipping']) ?
$_SESSION['shipping']['cost'] : '', 'comments' => isset($_SESSION['comments']) ?
$_SESSION['comments'] : '', 'shipping_class' => is_array($_SESSION['shipping']) ?
$_SESSION['shipping']['id'] : '', Damit ist auch die Fehlermeldung weg.
Hier natürlich noch ein paar Screenshots dazu:
[ Für Gäste sind keine Dateianhänge sichtbar ]
[ Für Gäste sind keine Dateianhänge sichtbar ]
[ Für Gäste sind keine Dateianhänge sichtbar ]
Viel Spass damit, GTB
[E
DIT Tomcraft 12.02.2011: Eine erweiterte Version mit Länderdropdown gibt es hier:
MODUL: Versandkosten im Warenkorb anzeigen mit Länderdropdown]
Linkback: https://www.modified-shop.org/forum/index.php?topic=9883.0