PageRenderTime 27ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/components/com_virtuemart/themes/default/templates/product_details/includes/addtocart_form.tpl.php

http://vanphongphamdm.googlecode.com/
PHP | 82 lines | 70 code | 8 blank | 4 comment | 31 complexity | 522944a5c0fef8c93034e54a258dc831 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1, Apache-2.0
  1. <?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>
  2. <div class="vmCartContainer">
  3. <?php
  4. mm_showMyFileName(__FILE__);
  5. // This function lists all product children ( = Items)
  6. // or, when not children are defined, the product_id
  7. // SO LEAVE THIS IN HERE!
  8. list($html,$children) = $ps_product_attribute->list_attribute( ( $product_parent_id > 0 ) ? $product_parent_id : $product_id );
  9. if ($children != "multi") {
  10. if( CHECK_STOCK == '1' && ( $product_in_stock < 1 ) ) {
  11. $notify = true;
  12. } else {
  13. $notify = false;
  14. }
  15. ?>
  16. <form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="<?php echo uniqid('addtocart_') ?>" class="addtocart_form" <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
  17. <?php
  18. }
  19. echo $html;
  20. if (USE_AS_CATALOGUE != '1' && $product_price != "" && !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )) {
  21. ?>
  22. <?php if ($children != "multi") { ?>
  23. <div style="float: right;vertical-align: middle;"> <?php
  24. if ($children == "drop") {
  25. echo $ps_product_attribute->show_quantity_box($product_id,$product_id);
  26. }
  27. if ($children == "radio") {
  28. echo $ps_product_attribute->show_radio_quantity_box();
  29. }
  30. $button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO');
  31. $button_cls = 'addtocart_button';
  32. if( CHECK_STOCK == '1' && ( $product_in_stock < 1) ) {
  33. $button_lbl = $VM_LANG->_('VM_CART_NOTIFY');
  34. $button_cls = 'notify_button';
  35. }
  36. ?>
  37. <input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
  38. </div>
  39. <?php } ?>
  40. <input type="hidden" name="flypage" value="shop.<?php echo $flypage ?>" />
  41. <input type="hidden" name="page" value="shop.cart" />
  42. <input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id ?>" />
  43. <input type="hidden" name="category_id" value="<?php echo $category_id ?>" />
  44. <input type="hidden" name="func" value="cartAdd" />
  45. <input type="hidden" name="option" value="<?php echo $option ?>" />
  46. <input type="hidden" name="Itemid" value="<?php echo $Itemid ?>" />
  47. <input type="hidden" name="set_price[]" value="" />
  48. <input type="hidden" name="adjust_price[]" value="" />
  49. <input type="hidden" name="master_product[]" value="" />
  50. <?php
  51. }
  52. if ($children != "multi") { ?>
  53. </form>
  54. <?php
  55. }
  56. if($children == "radio") { ?>
  57. <script language="JavaScript" type="text/javascript">//<![CDATA[
  58. function alterQuantity(myForm) {
  59. for (i=0;i<myForm.selItem.length;i++){
  60. setQuantity = myForm.elements['quantity'];
  61. selected = myForm.elements['selItem'];
  62. j = selected[i].id.substr(7);
  63. k= document.getElementById('quantity' + j);
  64. if (selected[i].checked==true){
  65. k.value = myForm.quantity_adjust.value; }
  66. else {
  67. k.value = 0;
  68. }
  69. }
  70. }
  71. //]]>
  72. </script>
  73. <?php } ?>
  74. </div>