page-store.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php /* Template Name: Store */ ?>
  2. <?php get_header(); ?>
  3. <div id="store-wrap">
  4. <div class="container">
  5. <div class="store-page">
  6. <div class="row">
  7. <div class="tencol">
  8. <p style="font-size:18px;background:#feffa4;color:#f00;padding:5px 10px;">Due to Covid-19, we are temporarily unable to fulfill orders. Please check back later.</p>
  9. </div>
  10. <div class="twocol last">
  11. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="last buy-now">
  12. <fieldset>
  13. <input type="hidden" name="business" value="sales@phfilms.com" />
  14. <input type="hidden" name="cmd" value="_cart" />
  15. <input type="hidden" name="display" value="1" />
  16. <input type="submit" name="submit" value="View Your Cart" class="button" />
  17. </fieldset>
  18. </form>
  19. </div>
  20. </div>
  21. <div class="row">
  22. <div class="twelvecol">
  23. <?php
  24. $args = array(
  25. 'post_type' => 'film',
  26. 'meta_query' => array(
  27. array(
  28. 'key' => 'price',
  29. 'value' => '0',
  30. 'compare' => '>',
  31. 'type' => 'NUMERIC'
  32. )
  33. )
  34. );
  35. $query = new WP_Query( $args ); query_posts($args); while (have_posts()) : the_post(); ?>
  36. <div class="threecol">
  37. <div class="store-item">
  38. <?php if (class_exists('MultiPostThumbnails')
  39. && MultiPostThumbnails::has_post_thumbnail('film', 'secondary-image')) :
  40. MultiPostThumbnails::the_post_thumbnail('film', 'secondary-image'); endif; ?>
  41. <!--<h3 class="film-title"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>-->
  42. <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
  43. <input type="hidden" name="on0" value="Format">
  44. <select name="os0">
  45. <?php $price = get_post_custom_values('price'); if (!empty($price[0])) { ?><option value="Personal DVD">Personal DVD <?php echo get_post_meta($post->ID, 'price', true) ?></option><?php } ?>
  46. <?php $price2 = get_post_custom_values('price2'); if (!empty($price2[0])) { ?><option value="Library DVD">Library DVD <?php echo get_post_meta($post->ID, 'price2', true) ?></option><?php } ?>
  47. <?php $price3 = get_post_custom_values('price3'); if (!empty($price3[0])) { ?><option value="University DVD">University DVD <?php echo get_post_meta($post->ID, 'price3', true) ?></option><?php } ?>
  48. </select>
  49. <input class="buy-now" type="submit" value="Add to Cart" border="0" name="submit" disabled>
  50. <input type="hidden" name="add" value="1">
  51. <input type="hidden" name="cmd" value="_cart">
  52. <input type="hidden" name="business" value="sales@phfilms.com">
  53. <input type="hidden" name="item_name" value="<?php the_title() ?>">
  54. <input type="hidden" name="item_number" value="xxxx">
  55. <input type="hidden" name="option_select0" value="Personal DVD">
  56. <input type="hidden" name="option_amount0" value="<?php echo get_post_meta($post->ID, 'price', true) ?>">
  57. <input type="hidden" name="option_select1" value="Library DVD">
  58. <input type="hidden" name="option_amount1" value="<?php echo get_post_meta($post->ID, 'price2', true) ?>">
  59. <input type="hidden" name="option_select2" value="University DVD">
  60. <input type="hidden" name="option_amount2" value="<?php echo get_post_meta($post->ID, 'price3', true) ?>">
  61. <input type="hidden" name="return" value="http://www.phfilms.com/index.php/completedpayment/">
  62. <input type="hidden" name="cancel_return" value="http://www.phfilms.com/index.php/cancelledpayment/">
  63. <input type="hidden" name="currency_code" value="USD">
  64. <input type="hidden" name="lc" value="US">
  65. </form>
  66. </div>
  67. </div>
  68. <?php endwhile; ?>
  69. </div>
  70. <div class="fourcol">
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <?php get_footer(); ?>