PageRenderTime 261ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/wp-e-commerce/themes/default/single_product.php

https://gitlab.com/endomorphosis/reservationtelco
PHP | 229 lines | 193 code | 36 blank | 0 comment | 41 complexity | 77313b641504f75bebafab7d7420ca8b MD5 | raw file
  1. <?php
  2. global $wpsc_query, $wpdb;
  3. $image_width = get_option('single_view_image_width');
  4. $image_height = get_option('single_view_image_height');
  5. ?>
  6. <div id='products_page_container' class="wrap wpsc_container">
  7. <?php if(wpsc_has_breadcrumbs()) :?>
  8. <div class='breadcrumb'>
  9. <a href='<?php echo get_option('product_list_url'); ?>'><?php echo get_option('blogname'); ?></a> &raquo;
  10. <?php while (wpsc_have_breadcrumbs()) : wpsc_the_breadcrumb(); ?>
  11. <?php if(wpsc_breadcrumb_url()) :?>
  12. <a href='<?php echo wpsc_breadcrumb_url(); ?>'><?php echo wpsc_breadcrumb_name(); ?></a> &raquo;
  13. <?php else: ?>
  14. <?php echo wpsc_breadcrumb_name(); ?>
  15. <?php endif; ?>
  16. <?php endwhile; ?>
  17. </div>
  18. <?php endif; ?>
  19. <?php do_action('wpsc_top_of_products_page'); // Plugin hook for adding things to the top of the products page, like the live search ?>
  20. <div class="productdisplay">
  21. <?php /** start the product loop here, this is single products view, so there should be only one */?>
  22. <?php while (wpsc_have_products()) : wpsc_the_product(); ?>
  23. <div class="single_product_display product_view_<?php echo wpsc_the_product_id(); ?>">
  24. <div class="textcol">
  25. <?php if(get_option('show_thumbnails')) :?>
  26. <div class="imagecol">
  27. <?php if(wpsc_the_product_thumbnail()) :?>
  28. <a rel="<?php echo str_replace(array(" ", '"',"'", '&quot;','&#039;'), array("_", "", "", "",''), wpsc_the_product_title()); ?>" class="thickbox preview_link" href="<?php echo wpsc_the_product_image(); ?>">
  29. <img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_image($image_width, $image_height); ?>" />
  30. </a>
  31. <?php else: ?>
  32. <div class="item_no_image">
  33. <a href="<?php echo wpsc_the_product_permalink(); ?>">
  34. <span>No Image Available</span>
  35. </a>
  36. </div>
  37. <?php endif; ?>
  38. </div>
  39. <?php endif; ?>
  40. <div class="producttext">
  41. <h2 class="prodtitles"><span><?php echo wpsc_the_product_title(); ?></span><?php echo wpsc_edit_the_product_link(); ?></h2>
  42. <?php
  43. do_action('wpsc_product_before_description', wpsc_the_product_id(), $wpsc_query->product);
  44. ?>
  45. <div class="wpsc_description"><?php echo wpsc_the_product_description(); ?></div>
  46. <?php
  47. do_action('wpsc_product_addons', wpsc_the_product_id());
  48. ?>
  49. <?php if(wpsc_the_product_additional_description()) : ?>
  50. <div class="single_additional_description">
  51. <?php
  52. $value = '';
  53. $the_addl_desc = wpsc_the_product_additional_description();
  54. if( is_serialized($the_addl_desc) ) {
  55. $addl_descriptions = @unserialize($the_addl_desc);
  56. } else {
  57. $addl_descriptions = array('addl_desc', $the_addl_desc);
  58. }
  59. if( isset($addl_descriptions['addl_desc']) ) {
  60. $value = $addl_descriptions['addl_desc'];
  61. }
  62. if( function_exists('wpsc_addl_desc_show') ) {
  63. echo wpsc_addl_desc_show( $addl_descriptions );
  64. } else {
  65. echo stripslashes( wpautop($the_addl_desc, $br=1));
  66. }
  67. ?>
  68. </div>
  69. <?php endif; ?>
  70. <?php do_action('wpsc_product_addon_after_descr', wpsc_the_product_id()); ?>
  71. <?php /** the custom meta HTML and loop */ ?>
  72. <div class="custom_meta">
  73. <?php while (wpsc_have_custom_meta()) : wpsc_the_custom_meta();
  74. if (stripos(wpsc_custom_meta_name(),'g:') !== FALSE){
  75. continue;
  76. }
  77. ?>
  78. <strong><?php echo wpsc_custom_meta_name(); ?>: </strong><?php echo wpsc_custom_meta_value(); ?><br />
  79. <?php endwhile; ?>
  80. </div>
  81. <?php /** the custom meta HTML and loop ends here */?>
  82. <form class='product_form' enctype="multipart/form-data" action="<?php echo wpsc_this_page_url(); ?>" method="post" name="1" id="product_<?php echo wpsc_the_product_id(); ?>">
  83. <?php if(wpsc_product_has_personal_text()) : ?>
  84. <div class='custom_text'>
  85. <h4><?php echo __('Personalize your product', 'wpsc'); ?></h4>
  86. <?php echo __('Complete this form to include a personalized message with your purchase.', 'wpsc'); ?><br />
  87. <input type='text' name='custom_text' value='' />
  88. </div>
  89. <?php endif; ?>
  90. <?php if(wpsc_product_has_supplied_file()) : ?>
  91. <div class='custom_file'>
  92. <h4><?php echo __('Upload a File', 'wpsc'); ?></h4>
  93. <?php echo __('Select a file from your computer to include with this purchase. ', 'wpsc'); ?><br />
  94. <input type='file' name='custom_file' value='' />
  95. </div>
  96. <?php endif; ?>
  97. <?php /** the variation group HTML and loop */?>
  98. <div class="wpsc_variation_forms">
  99. <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
  100. <p>
  101. <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
  102. <?php /** the variation HTML and loop */?>
  103. <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
  104. <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
  105. <option value="<?php echo wpsc_the_variation_id(); ?>" <?php echo wpsc_the_variation_out_of_stock(); ?>><?php echo wpsc_the_variation_name(); ?></option>
  106. <?php endwhile; ?>
  107. </select>
  108. </p>
  109. <?php endwhile; ?>
  110. </div>
  111. <?php /** the variation group HTML and loop ends here */?>
  112. <!-- THIS IS THE QUANTITY OPTION MUST BE ENABLED FROM ADMIN SETTINGS -->
  113. <?php if(wpsc_has_multi_adding()): ?>
  114. <fieldset>
  115. <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity', 'wpsc'); ?>:</label>
  116. <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
  117. <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
  118. <input type="hidden" name="wpsc_update_quantity" value="true"/>
  119. </fieldset>
  120. <?php endif ;?>
  121. <div class="wpsc_product_price">
  122. <?php if(wpsc_product_is_donation()) : ?>
  123. <label for='donation_price_<?php echo wpsc_the_product_id(); ?>'><?php echo __('Donation', 'wpsc'); ?>:</label>
  124. <input type='text' id='donation_price_<?php echo wpsc_the_product_id(); ?>' name='donation_price' value='<?php echo $wpsc_query->product['price']; ?>' size='6' />
  125. <br />
  126. <?php else : ?>
  127. <?php if(wpsc_product_on_special()) : ?>
  128. <span class='oldprice'><?php echo __('Price', 'wpsc'); ?>: <?php echo wpsc_product_normal_price(); ?></span><br />
  129. <?php endif; ?>
  130. <span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span><?php echo __('Price', 'wpsc'); ?>: <br/>
  131. <!-- multi currency code -->
  132. <?php if(wpsc_product_has_multicurrency()) : ?>
  133. <?php echo wpsc_display_product_multicurrency(); ?>
  134. <?php endif; ?>
  135. <!-- end multi currency code -->
  136. <?php if(get_option('display_pnp') == 1) : ?>
  137. <span class="pricedisplay"><?php echo wpsc_product_postage_and_packaging(); ?></span><?php echo __('P&amp;P', 'wpsc'); ?>: <br />
  138. <?php endif; ?>
  139. <?php endif; ?>
  140. </div>
  141. <?php if(function_exists('wpsc_akst_share_link') && (get_option('wpsc_share_this') == 1)) {
  142. echo wpsc_akst_share_link('return');
  143. } ?>
  144. <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
  145. <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>
  146. <?php if(wpsc_product_is_customisable()) : ?>
  147. <input type="hidden" value="true" name="is_customisable"/>
  148. <?php endif; ?>
  149. <!-- END OF QUANTITY OPTION -->
  150. <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow') !='1')) : ?>
  151. <?php if(wpsc_product_has_stock()) : ?>
  152. <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
  153. <?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
  154. <input class="wpsc_buy_button" type='button' value='<?php echo __('Buy Now', 'wpsc'); ?>' onclick='gotoexternallink("<?php echo $action; ?>")'>
  155. <?php else: ?>
  156. <input type="submit" value="<?php echo __('Add To Cart', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
  157. <?php endif; ?>
  158. <div class='wpsc_loading_animation'>
  159. <img title="Loading" alt="Loading" src="<?php echo WPSC_URL ;?>/images/indicator.gif" class="loadingimage" />
  160. <?php echo __('Updating cart...', 'wpsc'); ?>
  161. </div>
  162. <?php else : ?>
  163. <p class='soldout'><?php echo __('This product has sold out.', 'wpsc'); ?></p>
  164. <?php endif ; ?>
  165. <?php endif ; ?>
  166. </form>
  167. <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow')=='1')) : ?>
  168. <?php echo wpsc_buy_now_button(wpsc_the_product_id()); ?>
  169. <?php endif ; ?>
  170. <?php echo wpsc_product_rater(); ?>
  171. <?php
  172. if(function_exists('gold_shpcrt_display_gallery')) :
  173. echo gold_shpcrt_display_gallery(wpsc_the_product_id());
  174. endif;
  175. echo wpsc_also_bought(wpsc_the_product_id());
  176. ?>
  177. </div>
  178. <form onsubmit="submitform(this);return false;" action="<?php echo wpsc_this_page_url(); ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>" id="product_extra_<?php echo wpsc_the_product_id(); ?>">
  179. <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="prodid"/>
  180. <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="item"/>
  181. </form>
  182. </div>
  183. </div>
  184. </div>
  185. <?php echo wpsc_product_comments(); ?>
  186. <?php endwhile; ?>
  187. <?php /** end the product loop here */?>
  188. <?php
  189. if(function_exists('fancy_notifications')) {
  190. echo fancy_notifications();
  191. }
  192. ?>
  193. </div>