Contributions
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
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.
Some minor tweaks i forgot
>>> Popup now closes on every click.
Just click somewhere on the page and it disappears.
>>>Splitted code and design
Style information now goes to stylesheet.css and code goes to includes/footer.php
Updated install.txt - FULL PACKAGE
Just modified the original version to show darkened background just like those lightboxes do. So popup is easier to find on big screens :-)
Modified installation instructions and code to work ON ALL PAGES now. Original contrib just worked on product_info.php
Should work on all systems, all osc-versions and all browsers now (hopefully)
Thanks for the nice work to karlchen ;-)
Sorry, I forgot to mention the credits, here they are:
1) This Addon is based on a free XTC modul, which I only modified for OSC
2) The essentail hint to get the script working with OSC was given by SIR.K.O from german osc forum, thanks.
Things to be done:
1) design improvement
2) center the layer in browser window with Javascript
3) make it work in modified shops, where you could add products to the cart elsewhere, e.g. on products_new.php, specials.php etc. For this case I would place the code in the footer, this should work (and of course the CSS in stylesheet.css)
FULL PACKAGE
-= NOT FULL PACKAGE =-
Tested it and works fine with IE 7 & FireFox 3
That is except i have Ultimate SEO URLs installed and get this message when I click on Buy Now:
"
The requested URL /catalog/microsoft-intellimouse-explorer-p-26 was not found on this server.
"
But Backspace fixes this.
All credits to our new member -=karlchen=-
-= NOT FULL PACKAGE =-
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
Note: Contributions are used at own risk.