Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $wpsc_query, $wpdb;
- $image_width = get_option('single_view_image_width');
- $image_height = get_option('single_view_image_height');
- $imagecolwidth = $image_width + 15;
- ?>
- <h1 class="prodtitles"><?php echo wpsc_the_product_title(); ?></h1>
- <div id='products_page_container' class="wrap wpsc_container">
- <div id="page-container">
- <?php if(wpsc_has_breadcrumbs()) :?>
- <div class='breadcrumb'>
- <a href='<?php echo get_option('product_list_url'); ?>'><?php echo get_option('blogname'); ?></a> »
- <?php while (wpsc_have_breadcrumbs()) : wpsc_the_breadcrumb(); ?>
- <?php if(wpsc_breadcrumb_url()) :?>
- <a href='<?php echo wpsc_breadcrumb_url(); ?>'><?php echo wpsc_breadcrumb_name(); ?></a> »
- <?php else: ?>
- <?php echo wpsc_breadcrumb_name(); ?>
- <?php endif; ?>
- <?php endwhile; ?>
- </div>
- <?php endif; ?>
- <?php do_action('wpsc_top_of_products_page'); // Plugin hook for adding things to the top of the products page, like the live search ?>
- <div class="productdisplay">
- <?php /** start the product loop here, this is single products view, so there should be only one */?>
- <?php while (wpsc_have_products()) : wpsc_the_product(); ?>
- <div class="single_product_display product_view_<?php echo wpsc_the_product_id(); ?>">
- <?php if(get_option('show_thumbnails')) :?>
- <div class="imagecol" style="max-width:<?php echo $imagecolwidth;?>px;">
- <?php if(wpsc_the_product_thumbnail()) :?>
- <a class="thickbox preview_link" href="<?php echo wpsc_the_product_image(); ?>" rel="productgallery">
- <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_thumbnail($image_width, $image_height); ?>" />
- </a>
- <?php else: ?>
- <div class="item_no_image">
- <a style="width:<?php echo $image_width;?>px;height:<?php echo $image_height;?>px;" href="<?php echo wpsc_the_product_permalink(); ?>">
- <span>No Image Available</span>
- </a>
- </div>
- <?php endif; ?>
- <div id="sft-single-product-gallery">
- <?php /*?><style type="text/css">div.single_product_display div.textcol div.imagecol a img.gallery {width:auto;height:auto;max-width:<?php if(isset($thumbwidth)){echo $thumbwidth."px";}?>;}</style><?php */?>
- <?php
- $featured_image = get_post_thumbnail_id();
- $args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'post_parent' => $post->ID, 'exclude' => $featured_image,'numberposts' => 0);
- $attachments = get_posts($args);
- $numposts = count($attachments);
- $roundheight = round($numposts / 2);
- $thumbwidth = $image_width / 2 - 12;
- $galleryheight = $roundheight * $thumbwidth + 85 + $image_height;
- if ($attachments) {$i = 0;
- foreach ( $attachments as $attachment ) {$i++;
- $thumbnail = wp_get_attachment_url( $attachment->ID , false );
- $image = vt_resize('', $thumbnail, $thumbwidth, $thumbwidth, true);
- ?>
- <?php /*?><style type="text/css">#sft-single-product-gallery img.gallery {max-width:<?php echo $thumbwidth;?>px!important;}</style><?php */?>
- <a rel="<?php echo str_replace(array(" ", '"',"'", '"','''), array("_", "", "", "",''), wpsc_the_product_title()); ?>" class="thickbox" href="<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>"><img class="gallery" src="<?php echo $image['url']; ?>" alt="<?php the_title(); ?>" style="width:<?php echo $thumbwidth;?>; height:<?php echo $thumbwidth;?>;" border="0" /></a>
- <?php }
- } ?>
- <?php $imagecolheight = $thumbwidth * $i / 2 + $image_height + 50;?>
- <?php /*?><style type="text/css">
- div.single_product_display div.textcol {min-height:<?php echo $imagecolheight;?>px!important;}
- div.single_product_display {min-height:<?php echo $galleryheight;?>px!important;}
- </style><?php */?>
- <div class="clear"></div>
- </div><!-- /END SINGLE PRODUCT GALLERY -->
- <div class="clear"></div>
- </div>
- <?php endif; ?>
- <div class="text-col">
- <div class="producttext">
- <?php
- do_action('wpsc_product_before_description', wpsc_the_product_id(), $wpsc_query->product);
- ?>
- <div class="wpsc_description"><?php echo wpsc_the_product_description(); ?></div>
- <?php
- do_action('wpsc_product_addons', wpsc_the_product_id());
- ?>
- <?php do_action('wpsc_product_addon_after_descr', wpsc_the_product_id()); ?>
- <?php
- // ##############################################################
- // ## ##
- // ## If price is set to £0.00 then display "Price on Request" ##
- // ## ##
- // ##############################################################
- if(price_on_request_check(wpsc_the_product_price(true), false, "", false) == true):
- ?>
- <div class="wpsc_request_product_price">
- <?php echo __('Price', 'wpsc'); ?>: <span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo __('Price On Request', 'wpsc'); ?></span><br/>
- <?php price_on_request_check(wpsc_the_product_price(true), "form", wpsc_the_product_title()); ?>
- </div>
- <?php
- else:
- ?>
- <form class='product_form upload-file-form' enctype="multipart/form-data" action="<?php echo wpsc_this_page_url(); ?>" method="post" name="1" id="product_<?php echo wpsc_the_product_id(); ?>">
- <?php if(wpsc_product_has_personal_text()) : ?>
- <div class='custom_text storefront-single-product-section'>
- <h4><?php echo __('Personalize your product', 'wpsc'); ?></h4>
- <?php echo __('Complete this form to include a personalized message with your purchase.', 'wpsc'); ?><br />
- <input type='text' name='custom_text' value='' />
- </div>
- <?php endif; ?>
- <?php if(wpsc_product_has_supplied_file()) : ?>
- <div class='custom_file storefront-single-product-section'>
- <strong><?php echo __('Upload a File', 'wpsc'); ?></strong>
- <div class="clear"></div>
- <?php echo __('Select a file from your computer to include with this purchase. ', 'wpsc'); ?><br />
- <input type='file' name='custom_file' value='' />
- </div>
- <?php endif; ?>
- <?php /** the variation group HTML and loop */?>
- <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
- <div class="wpsc_variation_forms">
- <p>
- <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
- <?php /** the variation HTML and loop */?>
- <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
- <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
- <option value="<?php echo wpsc_the_variation_id(); ?>" <?php echo wpsc_the_variation_out_of_stock(); ?>><?php echo wpsc_the_variation_name() . " - " . wpsc_the_variation_price(); ?></option>
- <?php endwhile; ?>
- </select>
- </p>
- </div>
- <?php endwhile; ?>
- <?php /* Automatically select the first variation */ ?>
- <?php /** the variation group HTML and loop ends here */?>
- <!-- THIS IS THE QUANTITY OPTION MUST BE ENABLED FROM ADMIN SETTINGS -->
- <?php if(wpsc_has_multi_adding()): ?>
- <fieldset>
- <label class='wpsc_quantity_update'><?php echo __('Quantity', 'wpsc'); ?>:</label>
- <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
- <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
- <input type="hidden" name="wpsc_update_quantity" value="true"/>
- </fieldset>
- <?php endif ;?>
- <div class="wpsc_product_price">
- <?php if(wpsc_show_stock_availability()): ?>
- <?php if(wpsc_product_has_stock()) : ?>
- <div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="in_stock"><?php _e('Product in stock', 'wpsc'); ?></div>
- <?php else: ?>
- <div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="out_of_stock"><?php _e('Product not in stock', 'wpsc'); ?></div>
- <?php endif; ?>
- <?php endif; ?>
- <?php if(wpsc_product_is_donation()) : ?>
- <label for='donation_price_<?php echo wpsc_the_product_id(); ?>'><?php echo __('Donation', 'wpsc'); ?>:</label>
- <input type='text' id='donation_price_<?php echo wpsc_the_product_id(); ?>' name='donation_price' value='<?php echo $wpsc_query->product['price']; ?>' size='6' />
- <br />
- <?php else : ?>
- <?php if(wpsc_product_on_special()) : ?>
- <span class='oldprice'><?php echo __('Price', 'wpsc'); ?>: <?php echo wpsc_product_normal_price(); ?></span><br />
- <?php endif; ?>
- <?php echo __('Price', 'wpsc'); ?>: <span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span><br/>
- <!-- multi currency code -->
- <?php if(wpsc_product_has_multicurrency()) : ?>
- <?php echo wpsc_display_product_multicurrency(); ?>
- <?php endif; ?>
- <!-- end multi currency code -->
- <?php if(get_option('display_pnp') == 1) : ?>
- <?php echo __('P&P', 'wpsc'); ?>: <span class="pricedisplay"><?php echo wpsc_product_postage_and_packaging(); ?></span><br />
- <?php endif; ?>
- <?php endif; ?>
- </div>
- <?php if(function_exists('wpsc_akst_share_link') && (get_option('wpsc_share_this') == 1)) {
- echo wpsc_akst_share_link('return');
- } ?>
- <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
- <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>
- <?php if(wpsc_product_is_customisable()) : ?>
- <input type="hidden" value="true" name="is_customisable"/>
- <?php endif; ?>
- <!-- END OF QUANTITY OPTION -->
- <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow') !='1')) : ?>
- <?php if(wpsc_product_has_stock()) : ?>
- <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
- <?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
- <input class="wpsc_buy_button" type='button' value='<?php echo __('Buy Now', 'wpsc'); ?>' onclick='gotoexternallink("<?php echo $action; ?>")'>
- <?php else: ?>
- <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"/>
- <?php endif; ?>
- <div class='wpsc_loading_animation'>
- <img title="Loading" alt="Loading" src="<?php echo WPSC_URL ;?>/images/indicator.gif" class="loadingimage" />
- <?php echo __('Updating cart...', 'wpsc'); ?>
- </div>
- <?php else : ?>
- <p class='soldout'><?php echo __('This product has sold out.', 'wpsc'); ?></p>
- <?php endif ; ?>
- <?php endif ; ?>
- </form>
- <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow')=='1')) : ?>
- <?php echo wpsc_buy_now_button(wpsc_the_product_id()); ?>
- <?php endif ; ?>
- <?php echo wpsc_product_rater(); ?>
- <?php
- if(function_exists('gold_shpcrt_display_gallery')) :
- echo gold_shpcrt_display_gallery(wpsc_the_product_id());
- endif;
- //echo wpsc_also_bought(wpsc_the_product_id());
- ?>
- <?php
- endif;
- ?>
- </div>
- <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(); ?>">
- <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="prodid"/>
- <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="item"/>
- </form>
- <?php
- $tags = get_the_product_tags(wpsc_the_product_id());
- if($tags !== false)
- {
- ?>
- <div id="product_tags" style="float:left; position:relative; width:100%; margin-top:20px;">
- <h4>Tags</h4>
- <?php
- foreach($tags as $tag)
- {
- echo '<a href="' . get_bloginfo('url')."/tagged/". $tag->slug . '">' . $tag->name . "</a> ";
- }
- ?>
- </div>
- <?php
- }
- ?>
- <?php
- if(wpsc_show_fb_like()): ?>
- <div class="FB_like">
- <iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo wpsc_the_product_permalink(); ?>&layout=standard&show_faces=true&width=435&action=like&font=arial&colorscheme=light" frameborder="0"></iframe>
- </div><!--close FB_like-->
- <?php endif; ?>
- </div>
- </div>
- </div>
- <?php /*if ( get_option('storefront_product_comments') == "true" ) {comments_template();} else {*/comments_template();/*}*/ ?>
- <?php if (get_option('storefront_product_comments') == "true") { echo "Comments are on!"; } ?>
- <?php endwhile; ?>
- <?php /** end the product loop here */?>
- <?php
- if(function_exists('fancy_notifications')) {
- echo fancy_notifications();
- }
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement