Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping Cart as Tooltip, pls help


Fashion-Art

Recommended Posts

  • 2 months later...

Hi There,

You need to change the stylesheet and the includes/footer.php file as well. Also very important to include the addon that makes it work with attributes.

 

Hope this helps.

 

############################################################

################ I N S T A L L A T I O N #################

############################################################

 

/********************************/

/* STEP 1 */

/********************************/

 

Backup your files !

 

/********************************/

/* STEP 2 (Upload) */

/********************************/

 

Upload the file button_show_cart.gif to includes/languages/english/images/buttons (and any language your shop is working with)

 

/********************************/

/*STEP 3 (Edit stylesheet.css)*/

/********************************/

 

1 ) Go to the very end of the file

Add directly AT THE END OF THE FILE

 

#popCart {

position: absolute; /*do not change this*/

top: 35%;

left: 35%;

width: 450px;

background-color: #f8f8f8;

border: 3px solid #BAC4D0;

color: #000;

z-index: 100000; /*do not change this*/

display: none; /*do not change this*/

padding: 20px;

}

 

ul.popcartList {list-style-type:none; margin:0; padding:0;}

li.popcartButton {float:right;padding-right:10px;}

 

#popCart_overlay {

position: fixed;

z-index:100;

top: 0px;

left: 0px;

height:100%;

width:100%;

background-color: #000;

display:none;

opacity:0.75;

filter:alpha(opacity=75);

-moz-opacity: 0.75;

}

 

* html #popCart_overlay { /* ie6 hack */

position: absolute;

height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');

}

 

 

/********************************/

/*STEP 4 (Edit includes/footer.php)*/

/********************************/

 

 

<!-- BOF - -= Cart on Product Page =- (This line only in Product Info, leave out in stylesheet) //-->

<div id="popCart_overlay" onclick="document.getElementById('popCart').style.display='none'; document.getElementById('popCart_overlay').style.display='none'; return false;">

</div>

<div id="popCart">

<?php

if (tep_session_is_registered('new_products_id_in_cart')) {

?>

<h4><?php echo PRODUCT_ADDED; ?></h4>

<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>

<ul class="popcartList">

<?php

$cart_contents_string = '';

if ($cart->count_contents() > 0) {

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

$cart_contents_string .= '<li>';

$cart_contents_string .= $products[$i]['quantity'] . ' x <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

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

}

}

echo $cart_contents_string;

echo tep_draw_separator('pixel_black.gif', '100%', '1');

echo '<li><b>Total: ' . $currencies->format($cart->show_total()) . '</b></li>';

?>

</ul>

<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>

<ul class="popcartList"><li class="popcartButton"> <?php echo '<a href="javascript:void(0);" onclick="document.getElementById(\'popCart\').style.display=\'none\'; document.getElementById(\'popCart_overlay\').style.display=\'none\'; return false;">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a></li><li class="popcartButton"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('button_show_cart.gif', IMAGE_BUTTON_SHOW_CART) . '</a></li><li class="popcartButton"><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>' ?></li></ul>

<script type="text/javascript">

var item=document.getElementById("popCart");

function pop(el){

if(el.style.display=="block"){

el.style.display="none";

}else{

el.style.display="block";

}

}

pop(item);

</script>

<script type="text/javascript">

var item=document.getElementById("popCart_overlay");

function overlay(el){

if(el.style.display=="block"){

el.style.display="none";

}else{

el.style.display="block";

}

}

overlay(item);

</script>

 

 

<?php

tep_session_unregister('new_products_id_in_cart');

}

?>

</div>

<!-- EOF - -= Cart on Product Page =- //-->

Link to comment
Share on other sites

  • 4 years later...

Hi all,

This add-on is very usefull but how can we install it in the bootstrap version ? When I put the code in footer.php, it doesn't work and cuts the footer.

 

I installed it in my old 2.2 version shop and it was very usefull.

 

Thank you very much.

Link to comment
Share on other sites

Thank you very much, I didn't try to install the add-on you mentioned but found that there's an error in code in the installation notice from Shopping cart as tooltip :

 

On this line :

<h4><?php echo PRODUCT_ADDED; ?></h4>

 

 

On the installation file it's written echp and not echo. So we have to correct it to make it work.

 

Now technically it works, but there's a lot of css adaptations to make.

 

I don't understand why so few people use this add-on whereas all big shops have a little tooltip when adding product to cart. In Oscommerce when we set to false "show cart after adding product", I find it not clear that the product has been added to the cart. And I also don't like to go to the cart for each product.

Link to comment
Share on other sites

This message appears when a product is added to cart (for sure in Edge, Gold also I think - could be wrong I have not looked at Gold for year):



And if you want to do something more, there are many things possible, here are two:


this popup shows when the cart link is clicked


this tooltip shows when the cart link is clicked

It's important to leave old addons behind.
Use the new structure, the new system ... and you make your life much easier.
 

Link to comment
Share on other sites

Yes the green message appears but when we are at the bottom of the page we don't see it.

 

Your first option is exactly what I want ! How to do it ?

 

And you're right, this old add-on is not very cool... I didn't manage to make it responsive so I simply hid it in the small and medium sizes.

Link to comment
Share on other sites

  • 1 year later...

good day, I am having issues on popup add to cart, on click add to cart ads second item on click ads the same item qty 2 click on different items still ads same item

advanced_search_result.php works fine

 

          case 'PRODUCT_ADD_CART':
            if ($listing['products_quantity']){
           $a_cart = '' .  tep_draw_button(IMAGE_BUTTON_ADD_CART, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now' . '', 'SSL'), NULL, NULL, 'btn-success btn-sm listbuy-sm') . '';
            } else {
           $a_cart = '<span class="productSpecialPrice">'.out_a_stocks('','out a stocks','','','') . '</span>';
            }
            break;

----------------------------------------------------------------

          case 'PRODUCT_ADD_CART':
            if (($listing['products_quantity']<>0) and ($listing['products_quantity'] > 0)){
           $a_cart = '' .  tep_draw_button(IMAGE_BUTTON_ADD_CART, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'], '', 'SSL'), NULL, NULL, 'btn-success btn-sm listbuy-sm') . '';
            } else {
           $a_cart = '<span class="productSpecialPrice">'.out_a_stocks('','out a stocks','','','') . '</span>';
            }
            break;

Edited by Kevin.Dallas
Link to comment
Share on other sites

i found the issue, upon adding a item what it does is, add a link on the toolbar for example: ?products_id=1093&sort=10a now you adding another item in the shopping cart the id doesn't change is stays the same and add the same item in the shopping cart, i'll give you guys update once i fix it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...