PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://vanphongphamdm.googlecode.com/
PHP | 116 lines | 99 code | 9 blank | 8 comment | 38 complexity | 87e453bd65cbc44767a86cd54e98244b 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. <?php
  3. mm_showMyFileName(__FILE__);
  4. // Start Ouputing the Child Detail
  5. ?>
  6. <div class="vmCartDetails<?php echo $cls_suffix ?>">
  7. <!-- Output The heading -->
  8. <?php if($display_header == "Y") { ?>
  9. <div class="vmCartChildHeading<?php echo $cls_suffix ?>">
  10. <span style="float: left;width: <?php echo $desc_width ?>;"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_DESC_TITLE') ?></span >
  11. <?php //Ouput Each Attribute Heading
  12. if( !empty( $headings )) {
  13. foreach($headings as $key => $value) { ?>
  14. <span style="float: left;width: <?php echo $attrib_width ?>;" ><?php echo $headings[$key] ?></span>
  15. <?php } ?>
  16. <span style="float: right;width: 15%;">&nbsp;</span>
  17. <span style="float: right;width: 10%;"><?php echo $VM_LANG->_('PHPSHOP_CART_QUANTITY') ?></span>
  18. <span style="float: right;width: 12%;"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_INVENTORY_PRICE') ?></span>
  19. </div><br/>
  20. <?php }
  21. }
  22. // Loop through each row and build the table
  23. foreach( $products as $product ) {
  24. foreach( $product as $attr => $val ) {
  25. // Using this we make all the variables available in the template
  26. // translated example: $this->set( 'product_name', $product_name );
  27. $this->set( $attr, $val );
  28. }
  29. if( CHECK_STOCK == '1' && ( $product['product_in_stock'] < 1 ) ) {
  30. $notify = true;
  31. } else {
  32. $notify = false;
  33. }
  34. ?>
  35. <div class="vmCartChild<?php echo $cls_suffix." ".$product['bgcolor'].$cls_suffix ?>">
  36. <form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $product['product_id'] ?>" class="addtocart_form" <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
  37. <div class="vmCartChildElement<?php echo $cls_suffix ?>">
  38. <input type="hidden" name="prod_id[]" value="<?php echo $product['product_id'] ?>" />
  39. <input type="hidden" name="product_id" value="<?php echo $product['parent_id'] ?>" />
  40. <span class="vmChildDetail<?php echo $cls_suffix ?>" style="float: left;width: <?php echo $desc_width ?>;" />
  41. <?php echo $product['product_title'] ?></span>
  42. <?php // Ouput Each Attribute
  43. if( !empty( $product['attrib_value'] )) {
  44. foreach($product['attrib_value'] as $attribute) { ?>
  45. <span class="vmChildDetail<?php echo $cls_suffix ?>" style="float: left;width :<?php echo $attrib_width ?>;" />
  46. <?php echo " ".$attribute ?></span>
  47. <?php
  48. }
  49. }
  50. if (USE_AS_CATALOGUE != '1' && $product_price != "" && !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL'))) {
  51. $button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO');
  52. $button_cls = 'addtocart_button';
  53. if( CHECK_STOCK == '1' && ( $product['product_in_stock'] < 1 ) ) {
  54. $button_lbl = $VM_LANG->_('VM_CART_NOTIFY');
  55. $button_cls = 'notify_button';
  56. }
  57. ?>
  58. <span class="vmChildDetail<?php echo $cls_suffix ?>" style="float: right;text-align: right;margin-top: 0px;">
  59. <input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" /></span>
  60. <?php }
  61. // Output Quantity Box
  62. if (USE_AS_CATALOGUE != '1' ) { ?>
  63. <span class="vmChildDetail<?php echo $cls_suffix ?>" style="float: right;text-align: right;margin-top: 0px;"><?php echo $product['quantity_box'] ?></span>
  64. <?php }
  65. // Output Price
  66. if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) { ?>
  67. <span class="vmChildDetail<?php echo $cls_suffix ?>" style="float: right;text-align: right;padding-right:5px;" >
  68. <?php
  69. if( $product['price'] != $product['actual_price'] ) { ?>
  70. <span class="product-Old-Price"><?php echo $product['price'] ?>&nbsp;</span>
  71. <?php }
  72. echo $product['actual_price'] ?></span>
  73. <?php } ?>
  74. </div>
  75. <br style="clear: both;"/>
  76. <input type="hidden" name="flypage" value="shop.<?php echo $product['flypage'] ?>" />
  77. <input type="hidden" name="category_id" value="<?php echo $product['category_id'] ?>" />
  78. <input type="hidden" name="page" value="shop.cart" />
  79. <input type="hidden" name="func" value="cartAdd" />
  80. <input type="hidden" name="option" value="com_virtuemart" />
  81. <input type="hidden" name="Itemid" value="<?php echo $product['Itemid'] ?>" />
  82. <input type="hidden" name="set_price[]" value="" />
  83. <input type="hidden" name="adjust_price[]" value="" />
  84. <input type="hidden" name="master_product[]" value="" />
  85. <?php
  86. // Out Put Product Type
  87. if ($display_product_type == "Y" && $product['product_type'] != "") { ?>
  88. <div class="vmChildType<?php echo $cls_suffix ?>">
  89. <?php echo $product['product_type'] ?>
  90. </div>
  91. <?php }
  92. // Output Advanced & Custom Attributes
  93. if(USE_AS_CATALOGUE != '1' && ($product['advanced_attribute'] != "" || $product['custom_attribute'] != "")) { ?>
  94. <div class="vmCartAttributes<?php echo $cls_suffix ?>">
  95. <?php if($product['advanced_attribute']) {
  96. echo $product['advanced_attribute'];
  97. }
  98. if($product['custom_attribute']) {
  99. echo $product['custom_attribute'];
  100. }
  101. ?>
  102. </div>
  103. <?php } ?>
  104. </form>
  105. </div>
  106. <?php } ?>
  107. </div >