PageRenderTime 31ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

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

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