Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2. if($_product->getMybutton()){
  3.  
  4. ?>
  5. <button type="button">Special order </button>
  6. <?php } ?>
  7.  
  8. <style>
  9. .tooltip{display: inline;position: relative;}
  10. .tooltip:hover:after{background: #333;background: rgba(0,0,0,.8);border-radius: 5px;bottom: 10px;color: #fff;content: attr(title);
  11. left: 20%;padding: 5px 15px;position: absolute;z-index: 98;width: 220px;}
  12. .tooltip:hover:before{border: solid;border-color: #333 transparent;border-width: 6px 6px 0 6px;bottom: 6px;content: "";left: 50%;position: absolute;z-index: 99;}
  13. .tip{display:inline-block;padding-left:12px;}
  14. </style>
  15.  
  16. <?php
  17. if($_product->getMybutton()){ //yes or no button
  18. ?>
  19. <div class="tip">
  20. <p class="tooltip">This can be anything you want and your text goes in ehre</p></div>
  21. <?php } ?>
  22.  
  23. <?php $attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('attribute name'); ?>
  24. <?php if ($attributeValue == 'check with attributed value'){ ?>
  25. <!--html code-->
  26. <img src="img/special.png" onMouseOver="show_sidebar()" onMouseOut="hide_sidebar()" alt="Special Order" />
  27. <div id="sidebar">text goes here</div>
  28. <!--js for hide show-->
  29. <script type="text/javascript">
  30. function show_sidebar()
  31. {
  32. document.getElementById('sidebar').style.visibility="visible";
  33. }
  34.  
  35. function hide_sidebar()
  36. {
  37. document.getElementById('sidebar').style.visibility="hidden";
  38. }
  39. </script>
  40. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement