aggiunta bottone nel box carrello

Postate qui discussioni di carattere generale riguardo a problemi di installazione e configurazione di osCommerce

Moderatore: mod Generali

Rispondi
valdo
membro Regular
membro Regular
Messaggi: 122
Iscritto il: 16/06/2004, 0:00
Località: ITALIA
Contatta:

aggiunta bottone nel box carrello

Messaggio da valdo »

E' possibile aggiungere un bottone del tipo passa alla cassa nel box carrello spesa?
Se è già stato fatto come si può modificare il codice?
Esiste una contribution ad hoc?
Grazie per le eventuali risposte
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Re: aggiunta bottone nel box carrello

Messaggio da marcus »

valdo ha scritto:E' possibile aggiungere un bottone del tipo passa alla cassa nel box carrello spesa?
Se è già stato fatto come si può modificare il codice?
Esiste una contribution ad hoc?
Grazie per le eventuali risposte
http://www.oscommerce.com/community/con ... nhancement

Saluti
Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
valdo
membro Regular
membro Regular
Messaggi: 122
Iscritto il: 16/06/2004, 0:00
Località: ITALIA
Contatta:

Re: aggiunta bottone nel box carrello

Messaggio da valdo »

marcus ha scritto:
valdo ha scritto:E' possibile aggiungere un bottone del tipo passa alla cassa nel box carrello spesa?
Se è già stato fatto come si può modificare il codice?
Esiste una contribution ad hoc?
Grazie per le eventuali risposte
http://www.oscommerce.com/community/con ... nhancement

Saluti
Marcus
Ho provato ad inserire il codice indicato dalla contribution ma non ho ottenuto effetti di sorta.
Dove sbaglio? Allego il codice di shoppin_cart

<?php
/*
$Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- shopping_cart //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);


new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART), $column_location);

$cart_contents_string = '';
if ($cart->count_contents() > 0) {
$cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';

if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
$cart_contents_string .= '<span class="newItemInCart">';
} else {
$cart_contents_string .= '<span class="infoBoxContents">';
}

$cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
$cart_contents_string .= '<span class="newItemInCart">';
} else {
$cart_contents_string .= '<span class="infoBoxContents">';
}

$cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
tep_session_unregister('new_products_id_in_cart');
}
}
$cart_contents_string .= '</table>';
} else {
$cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
}

$info_box_contents = array();
$info_box_contents[] = array('text' => $cart_contents_string);

//TotalB2B start
global $customer_id;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if ((($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
$box_text = $currencies->format($cart->show_total());
} else {
$box_text = PRICES_LOGGED_IN_TEXT;
}
if ($cart->count_contents() > 0) {
$info_box_contents[] = array('text' => tep_draw_separator());
$info_box_contents[] = array('align' => 'right',
'text' => $box_text);
}
//TotalB2B end

new infoBox($info_box_contents, $column_location);// Bof Shopping Cart Box Enhancement
$showcheckoutbutton = 1; // set to 1: show checkout button (default); set to 0: never show checkout button
$showhowmuchmore = 1; // set to 1: show how much more to spend for free shipping (default); set to 0: don't show

$cart_show_string = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>' . tep_draw_separator('pixel_trans.gif', '100%', '4') . '</td></tr>';

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
if (($cart->show_total()) < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'both') {
$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_LIMIT, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER));
}
else if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'international') {
$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_LIMIT_INTERNATIONAL, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER),tep_get_country_name(STORE_COUNTRY));
}
else {
$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_LIMIT_NATIONAL, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER),tep_get_country_name(STORE_COUNTRY));
}
if (($showhowmuchmore) && ($cart->count_contents() > 0)) {
$cart_show_string .= '<br>' . sprintf(TEXT_ADD_TO_GET_FREE_SHIPPING, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER - ($cart->show_total())));
}
$cart_show_string .='</td></tr>';
}
if ((($cart->show_total()) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)&&($showhowmuchmore)) {
if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'both') {
$cart_show_string .= '<tr><td class="smalltext" align="center">' . TEXT_FREE_SHIPPING_RECEIVED . '</td></tr>';
}
else if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'international') {
$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_RECEIVED_INTERNATIONAL, tep_get_country_name(STORE_COUNTRY)) . '</td></tr>'; }
else {
$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_RECEIVED_NATIONAL, tep_get_country_name(STORE_COUNTRY)) . '</td></tr>';
}
}
}

if (($showcheckoutbutton==1) && ($cart->count_contents() > 0) && (substr(basename($PHP_SELF), 0, 8) != 'checkout')) {
$cart_show_string .= '<tr><td>' . tep_draw_separator('pixel_trans.gif', '100%', '7') . '</td></tr><tr><td align="center"><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a></td></tr>';
}
$cart_show_string .= '</table>';
$info_box_contents[] = array('text' => $cart_show_string);
// Eof Shopping Cart Box Enhancement

?> </td>
</tr>

<!-- shopping_cart_eof //-->
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Messaggio da marcus »

L'errore risiede nel fatto che la linea :

Codice: Seleziona tutto

new infoBox($info_box_contents, $column_location);
va messa in fondo.

Ecco il codice corretto:

Codice: Seleziona tutto

<?php
/*
$Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- shopping_cart //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);


new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART), $column_location);

$cart_contents_string = '';
if ($cart->count_contents() > 0) {
	$cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
	$products = $cart->get_products();
	for ($i=0, $n=sizeof($products); $i<$n; $i++) {
		$cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';

		if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
			$cart_contents_string .= '<span class="newItemInCart">';
		} else {
			$cart_contents_string .= '<span class="infoBoxContents">';
		}

		$cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

		if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
			$cart_contents_string .= '<span class="newItemInCart">';
		} else {
			$cart_contents_string .= '<span class="infoBoxContents">';
		}

		$cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

		if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
			tep_session_unregister('new_products_id_in_cart');
		}
	}
	$cart_contents_string .= '</table>';
} else {
	$cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
}

$info_box_contents = array();
$info_box_contents[] = array('text' => $cart_contents_string);

//TotalB2B start
global $customer_id;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if ((($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
	$box_text = $currencies->format($cart->show_total());
} else {
	$box_text = PRICES_LOGGED_IN_TEXT;
}
if ($cart->count_contents() > 0) {
	$info_box_contents[] = array('text' => tep_draw_separator());
	$info_box_contents[] = array('align' => 'right',
	'text' => $box_text);
}
//TotalB2B end

// Bof Shopping Cart Box Enhancement
$showcheckoutbutton = 1; // set to 1: show checkout button (default); set to 0: never show checkout button
$showhowmuchmore = 1; // set to 1: show how much more to spend for free shipping (default); set to 0: don't show

$cart_show_string = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>' . tep_draw_separator('pixel_trans.gif', '100%', '4') . '</td></tr>';

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
	if (($cart->show_total()) < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
		if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'both') {
			$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_LIMIT, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER));
		}
		else if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'international') {
			$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_LIMIT_INTERNATIONAL, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER),tep_get_country_name(STORE_COUNTRY));
		}
		else {
			$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_LIMIT_NATIONAL, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER),tep_get_country_name(STORE_COUNTRY));
		}
		if (($showhowmuchmore) && ($cart->count_contents() > 0)) {
			$cart_show_string .= '<br>' . sprintf(TEXT_ADD_TO_GET_FREE_SHIPPING, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER - ($cart->show_total())));
		}
		$cart_show_string .='</td></tr>';
	}
	if ((($cart->show_total()) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)&&($showhowmuchmore)) {
		if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'both') {
			$cart_show_string .= '<tr><td class="smalltext" align="center">' . TEXT_FREE_SHIPPING_RECEIVED . '</td></tr>';
		}
		else if (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION == 'international') {
			$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_RECEIVED_INTERNATIONAL, tep_get_country_name(STORE_COUNTRY)) . '</td></tr>'; }
			else {
				$cart_show_string .= '<tr><td class="smalltext" align="center">' . sprintf(TEXT_FREE_SHIPPING_RECEIVED_NATIONAL, tep_get_country_name(STORE_COUNTRY)) . '</td></tr>';
			}
	}
}

if (($showcheckoutbutton==1) && ($cart->count_contents() > 0) && (substr(basename($PHP_SELF), 0, 8) != 'checkout')) {
	$cart_show_string .= '<tr><td>' . tep_draw_separator('pixel_trans.gif', '100%', '7') . '</td></tr><tr><td align="center"><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a></td></tr>';
}
$cart_show_string .= '</table>';
$info_box_contents[] = array('text' => $cart_show_string);
// Eof Shopping Cart Box Enhancement

new infoBox($info_box_contents, $column_location);
?> </td>
</tr>

<!-- shopping_cart_eof //-->
Saluti
Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
valdo
membro Regular
membro Regular
Messaggi: 122
Iscritto il: 16/06/2004, 0:00
Località: ITALIA
Contatta:

Messaggio da valdo »

marcus ha scritto:L'errore risiede nel fatto che la linea :

Codice: Seleziona tutto

new infoBox($info_box_contents, $column_location);
va messa in fondo.

.................
Saluti
Marcus
Ora funziona.
Ti ringrazio molto per la disponibilità
Cordialità
Rispondi