Contributions

Features (Category Index)
Search: 

Shopping Cart as Tooltip

What it does:
********
This contribution shows a cart layer on product_info.php, when the customer klicks the ADD TO CART button. The layer contains following information:
- 1 product has been added to your shopping cart
- list of all products in cart
- sum of all products
- button CONTINUE SHOPPING (closes the layer)
- button SHOW CART (link to shopping_cart-php)
- button CHECKOUT (link to checkout_shipping.php)

This is very easy to install, only 2 files has to be changed, no databank changes.

/********************************/
/* IMPORTANT NOTES */
/********************************/
This addon only works if "Display Cart After Adding Product" in Admin/Configuration/My Store is set to false

Expand All / Collapse All

option addition 8 Jul 2011

In addition to this very gr8 contribution, the use of attributes now works fine.

In footer.php, just after :

$cart_contents_string .= $products[$i]['name'] . '</a> ['.$products[$i]['model'].']</li>';

Add this :

// Option mod
if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
while (list($option, $value) = each($products[$i]['attributes'])) {
echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
where pa.products_id = '" . (int)$products[$i]['id'] . "'
and pa.options_id = '" . (int)$option . "'
and pa.options_id = popt.products_options_id
and pa.options_values_id = '" . (int)$value . "'
and pa.options_values_id = poval.products_options_values_id
and popt.language_id = '" . (int)$languages_id . "'
and poval.language_id = '" . (int)$languages_id . "'");
$attributes_values = tep_db_fetch_array($attributes);

$products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
$products[$i][$option]['options_values_id'] = $value;
$products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
$products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
$products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
$cart_contents_string .= '<li><i>'. $products[$i][$option]['products_options_name'] . ' : ' .$products[$i][$option]['products_options_values_name'] . '</i></li>';
}
}
// Option mod end

That's all.

Version 2.1 - FULL Package 10 Jun 2009
Version 2.0 - FULL Package 10 Jun 2009
Credits / Things do be done 30 May 2009
Screenshot + Installation doc Update 29 May 2009
Shopping Cart as Tooltip 29 May 2009

Note: Contributions are used at own risk.