Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I am trying to implement the Shopping Cart Tooltip addon: http://www.oscommerce.com/community/contributions,6789

However I am not getting any popups.

 

I've changed "Display Cart After Adding Product" to false in Admin,

Copied respective code to "stylesheet.css" "footer.php" and "english.php".

 

Tried several times, even with a un-modified versions of Oscommerce2.3, still cannot get any pop-ups to occur.

 

Does anyone have any ideas? I'm extremely unfamiliar with php and have no idea where to start in terms of debugging.

 

I've attached the 3 edited files.

 

Thanks in advance!

english.php

footer.php

stylesheet.css

  • 8 months later...
  • 5 months later...
  • 2 weeks later...
Posted

Hi frank, I really appreciate the work you're putting in for this. I've added the changes according to your most recent update, but nothing's happening when I add an item to my cart. I've tried in Chrome and IE, and neither has had any sort of pop-up happen. I haven't made any other changes to the site really, and I've double checked that display cart after adding items is off. Any thoughts?

  • 3 weeks later...
Posted

Hi Ed

 

Did you see "This addon only works if "Display Cart After Adding Product" in Admin/Configuration/My Store is set to false"?

 

If so let me know your site address and I can take a look.

osCommerce user since 2003! :thumbsup:

  • 10 months later...
Posted

Hi,

 

Sorry for my english.

 

I'm trying to install the addon on my 2.3.4 version and nothing happens.

 

I don't know if it's because I'm using an addon for a 2.3.4.4 version (which is not mine), or if I put the code of footer.php in the wrong place because my footer's text also desapeared.

 

I put this code at the very end of 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 echp 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><table width="100%"><tr><td>';
    $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></td>';
    $products_tax = tep_get_tax_rate($products[$i]['tax_class_id']);
    $popup_price = $currencies->calculate_price($products[$i]['final_price'], $products_tax, $products[$i]['quantity']);
    $cart_contents_string .= '<td style="text-align: right; padding: 1px;" width="20%">'  . $currencies->format($popup_price) . '</td></tr></table></li>';
    }
  }
echo $cart_contents_string;
echo tep_draw_separator('pixel_black.gif', '100%', '1');
echo '<li style="text-align: right; padding: 1px;"><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_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e') . '</a></li><li class="popcartButton"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) . '</a></li><li class="popcartButton"><a href="' . tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .  '</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 =- //-->

 

Thanks very much for help.

Posted (edited)

your footer disappeared because of this

 

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

 

change echp to echo

 

that should bring the footer back but this add-on still won't work with 2.3.4.

I tested it with 2.3.3.4 and it worked but it won't with 2.3.4. No clue why...

Edited by Tsimi
Posted

Thank you very much for your answer.

 

I corrected the mistake of echo, the footer reapreared but you're right, it still doesn't work...

 

If someone has a solution or another addon like this it would be great !

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...