purchase.phtml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * @version 7.8
  4. */
  5. ?>
  6. <?php /** @var \Ppb\Db\Table\Row\Listing $listing */ ?>
  7. <?php if ($this->userDetails($this->loggedInUser['id'])->getUser()->isVerified() === false) { ?>
  8. <?php echo $this->partial('partials/user-verification-message.phtml', null); ?>
  9. <?php } ?>
  10. <?php
  11. /** @var \Ppb\Db\Table\Row\User $seller */
  12. $seller = $listing->findParentRow('\Ppb\Db\Table\Users');
  13. $this->userDetails($seller);
  14. $this->listingDetails($listing);
  15. $productAttributes = $this->request()->getRequest()->getParam('product_attributes');
  16. ?>
  17. <div class="pull-right">
  18. <a href="<?php echo $this->url($listing->link()); ?>" class="btn btn-default">
  19. <?php echo $this->_('Return to Listing'); ?>
  20. </a>
  21. </div>
  22. <form action="<?php echo $this->form->getAction(); ?>" method="<?php echo $this->form->getMethod(); ?>"
  23. class="form-horizontal">
  24. <?php echo $this->form->hiddenElements; ?>
  25. <dl class="dl-horizontal">
  26. <dt><?php echo $this->_('Name'); ?></dt>
  27. <dd><?php echo $listing['name']; ?></dd>
  28. <?php $media = $listing->getMedia(array('image', 'video')); ?>
  29. <?php if (count($media) > 0) {
  30. $mainImage = $listing->getMainImage();
  31. ?>
  32. <dd>
  33. <?php echo $this->thumbnail($mainImage, 76, true,
  34. array('alt' => $listing['name'])); ?>
  35. </dd>
  36. <?php } ?>
  37. <?php if ($listing->isBuyOut()) {
  38. $price = (isset($price)) ? $price : $listing->getData('buyout_price');
  39. ?>
  40. <dt><?php echo $this->_('Price'); ?></dt>
  41. <dd>
  42. <span id="product-price">
  43. <?php echo $this->amount($price, $listing['currency']); ?>
  44. </span>
  45. </dd>
  46. <?php if ($this->type == 'buy') { ?>
  47. <dd>
  48. <div class="col-sm-6 col-xs-12">
  49. <?php echo $this->partial('partials/voucher-code.phtml', array(
  50. 'userId' => $seller['id'],
  51. 'listingId' => $listing['id'],
  52. )); ?>
  53. </div>
  54. </dd>
  55. <?php } ?>
  56. <dt><?php echo $this->_('Quantity Available'); ?></dt>
  57. <dd>
  58. <span id="quantity-available">
  59. <?php echo $this->listingDetails()->availableQuantity($productAttributes); ?>
  60. </span>
  61. </dd>
  62. <?php } ?>
  63. <?php if ($this->type == 'bid') { ?>
  64. <dt><?php echo $this->_('Current Bid'); ?></dt>
  65. <dd><?php echo $this->amount($listing->currentBid(true), $listing['currency']); ?></dd>
  66. <dt><?php echo $this->_('Bids'); ?></dt>
  67. <dd><?php echo count($listing->getBids()); ?></dd>
  68. <dt><?php echo $this->_('Minimum Bid'); ?></dt>
  69. <dd><?php echo $this->amount($listing->minimumBid(), $listing['currency']); ?></dd>
  70. <?php } ?>
  71. <?php if ($this->type == 'offer') { ?>
  72. <?php if ($seller->displayMakeOfferRanges()) { ?>
  73. <dt><?php echo $this->_('Offer Range'); ?></dt>
  74. <dd><?php echo $this->offerRanges($listing); ?></dd>
  75. <?php } ?>
  76. <?php } ?>
  77. <?php if (($taxType = $listing->getTaxType()) !== false) { ?>
  78. <dt><?php echo $this->_('Tax'); ?></dt>
  79. <dd><?php echo $this->taxType($taxType)->display(); ?></dd>
  80. <?php } ?>
  81. <dt><?php echo $this->_('Payment Methods'); ?></dt>
  82. <dd><?php
  83. $object = $this;
  84. echo $this->fieldDisplay(array_map(function ($array) use (&$object) {
  85. return $object->_($array['name']);
  86. }, $listing->getPaymentMethods()), null, 'N/A'); ?></dd>
  87. <?php if ($this->type == 'buy' && $this->settings['enable_shipping'] && !$listing->pickUpOnly()) { ?>
  88. <?php if ($listing[\Ppb\Model\Shipping::FLD_INSURANCE] > 0) { ?>
  89. <dt><?php echo $this->_('Insurance'); ?></dt>
  90. <dd><?php echo $this->amount($listing[\Ppb\Model\Shipping::FLD_INSURANCE],
  91. $listing['currency']); ?></dd>
  92. <?php } ?>
  93. <dt class="shipping-costs-padding"><?php echo $this->_('Shipping Costs'); ?></dt>
  94. <dd>
  95. <?php echo $this->action('calculate-postage', 'listing', 'listings',
  96. array(
  97. 'ids' => $listing['id'],
  98. 'quantity' => $quantity,
  99. 'locationId' => $user['country'],
  100. 'postCode' => $user['zip_code']
  101. ));
  102. ?>
  103. </dd>
  104. <?php } ?>
  105. </dl>
  106. <?php foreach ($this->form->getElements() as $element) { ?>
  107. <?php echo $this->partial('partials/form-element.phtml', array('element' => $element)); ?>
  108. <?php } ?>
  109. </form>