tribulant

Product View

Apr 7th, 2011
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 33.77 KB | None | 0 0
  1. <div class="<?php echo $this -> pre; ?>product">
  2.     <?php if (!is_feed() && current_user_can('edit_plugins')) : ?>
  3.         <p><small>
  4.             <?php echo $wpcoHtml -> link(__('Edit Product', $this -> plugin_name), $wpcoHtml -> product_save_url($product -> id)); ?> |
  5.             <?php echo $wpcoHtml -> link(__('Delete Product', $this -> plugin_name), $wpcoHtml -> product_delete_url($product -> id), array('onclick' => "if (!confirm('" . __('Are you sure you wish to remove this product?', $this -> plugin_name) . "')) { return false; }")); ?>
  6.         </small></p>
  7.     <?php endif; ?>
  8.    
  9.     <?php $usedfirstextra = false; ?>
  10.     <div class="<?php echo $this -> pre; ?>images">
  11.         <?php if (!empty($product -> images)) : ?>
  12.             <?php $image = $product -> images[0]; ?>
  13.             <div><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($image -> filename), false, $image -> filename), $wpcoHtml -> image_url($image -> filename), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $image -> title)); ?></div>
  14.             <?php $usedfirstextra = true; ?>
  15.         <?php else : ?>
  16.             <div><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($product -> image -> name), false, $product -> image -> name), $wpcoHtml -> image_url($product -> image -> name), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $product -> title)); ?></div>
  17.         <?php endif; ?>
  18.         <small><?php echo $captions['product']['clicktoenlarge']; ?></small>
  19.        
  20.         <?php if (!empty($product -> images)) : ?>
  21.             <?php if ($usedfirstextra == true) { unset($product -> images[0]); }; ?>
  22.             <?php if ($this -> get_option('gallerytab') == "N" || ($this -> get_option('gallerytab') == "Y" && empty($product -> contents))) : ?>
  23.                 <div class="<?php echo $this -> pre; ?>imglist">                       
  24.                     <ul>
  25.                         <?php $imgcount = 1; ?>
  26.                         <?php foreach ($product -> images as $image) : ?>
  27.                             <?php if ($imgcount <= $this -> get_option('pimgcount')) : ?>
  28.                                 <li><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($image -> filename, 'small'), false, $image -> filename), $wpcoHtml -> image_url($image -> filename), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $image -> title)); ?></li>
  29.                             <?php else : ?>
  30.                                 <?php break; ?>
  31.                             <?php endif; ?>
  32.                             <?php $imgcount++; ?>
  33.                         <?php endforeach; ?>
  34.                     </ul>
  35.                     <br class="<?php echo $this -> pre; ?>cleaner" />
  36.                    
  37.                     <?php if (count($product -> images) > $this -> get_option('pimgcount')) : ?>
  38.                         <div style="margin:0 0 10px 0;"><?php echo $wpcoHtml -> link(__('View all images', $this -> plugin_name) . ' &raquo;', '?' . $this -> pre . 'method=images', array()); ?></div>
  39.                     <?php endif; ?>
  40.                 </div>
  41.             <?php endif; ?>
  42.         <?php endif; ?>
  43.     </div>
  44.  
  45.     <?php /*
  46.     <div class="<?php echo $this -> pre; ?>images">
  47.         <?php if ($this -> get_option('cropthumb') == "Y") : ?>
  48.             <?php $imagefull = ABSPATH . 'wp-content' . DS . 'uploads' . DS . $this -> plugin_name . DS . 'images' . DS . $wpcoHtml -> thumb_name($product -> image -> name); ?>
  49.             <?php if (file_exists($imagefull) && filesize($imagefull) > 0) : ?>
  50.                 <div><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($product -> image -> name), false, $product -> image -> name), $wpcoHtml -> image_url($product -> image -> name), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $product -> title)); ?></div>
  51.                 <small><?php echo $captions['product']['clicktoenlarge']; ?></small>
  52.             <?php else : ?>
  53.                 <div><?php echo $wpcoHtml -> image($wpcoHtml -> thumb_name($product -> image -> name), false, $product -> image -> name); ?></div>
  54.             <?php endif; ?>
  55.         <?php else : ?>
  56.             <div><?php echo $wpcoHtml -> image($product -> image -> name, false, $product -> image -> name); ?></div>
  57.         <?php endif; ?>
  58.        
  59.         <?php if (!empty($product -> images)) : ?>
  60.             <?php if ($this -> get_option('gallerytab') == "N" || ($this -> get_option('gallerytab') == "Y" && empty($product -> contents))) : ?>
  61.                 <div class="<?php echo $this -> pre; ?>imglist">                       
  62.                     <ul>
  63.                         <?php $imgcount = 1; ?>
  64.                         <?php foreach ($product -> images as $image) : ?>
  65.                             <?php if ($imgcount <= $this -> get_option('pimgcount')) : ?>
  66.                                 <li><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($image -> filename, 'small'), false, $image -> filename), $wpcoHtml -> image_url($image -> filename), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $image -> title)); ?></li>
  67.                             <?php else : ?>
  68.                                 <?php break; ?>
  69.                             <?php endif; ?>
  70.                             <?php $imgcount++; ?>
  71.                         <?php endforeach; ?>
  72.                     </ul>
  73.                     <br class="<?php echo $this -> pre; ?>cleaner" />
  74.                    
  75.                     <?php if (count($product -> images) > $this -> get_option('pimgcount')) : ?>
  76.                         <div style="margin:0 0 10px 0;"><?php echo $wpcoHtml -> link(__('View all images', $thsi -> plugin_name) . ' &raquo;', '?' . $this -> pre . 'method=images', array()); ?></div>
  77.                     <?php endif; ?>
  78.                 </div>
  79.             <?php endif; ?>
  80.         <?php endif; ?>
  81.     </div>
  82.     */ ?>
  83.    
  84.     <?php if ($this -> get_option('product_descriptionposition') == "above") : ?>
  85.         <?php if (empty($product -> contents) || !is_array($product -> contents)) : ?>
  86.             <?php echo wpautop(do_shortcode($product -> description)); ?>
  87.         <?php endif; ?>
  88.     <?php endif; ?>
  89.    
  90.     <?php if ($this -> get_option('showcase') == "N") : ?>
  91.         <!-- NOT SHOWCASE -->
  92.    
  93.         <!-- Price -->
  94.         <div class="pricewrap">
  95.             <?php if ($product -> price_type == "tiers") : ?>
  96.                 <?php $price = @unserialize($product -> price); ?>
  97.                 <?php echo (!empty($product -> sprice) && $product -> sprice != "0.00") ? '<span class="sprice"><strike>' . $wpcoHtml -> currency_price($product -> sprice) . '</strike></span>' : ''; ?>
  98.                 <span id="productprice<?php echo $product -> id; ?>" class="price"><?php echo (!empty($product -> price_type) && $product -> price_type == "tiers") ? __('From', $this -> plugin_name) . ' ' : ''; ?><?php echo $wpcoHtml -> currency_price($Product -> unit_price($product -> id, 9999)); ?></span>
  99.             <?php else : ?>
  100.                 <?php echo (!empty($product -> sprice) && $product -> sprice != "0.00") ? '<span class="sprice"><strike>' . $wpcoHtml -> currency_price($product -> sprice) . '</strike></span>' : ''; ?>
  101.                 <?php if (!empty($product -> price) && $product -> price != "0.00") : ?>
  102.                     <span id="productprice<?php echo $product -> id; ?>" class="price productprice"><?php echo $wpcoHtml -> currency_price($product -> price); ?></span>
  103.                 <?php else : ?>
  104.                     <span id="productprice<?php echo $product -> id; ?>" class="price productprice"><?php echo stripslashes($this -> get_option('product_zerotext')); ?></span>
  105.                 <?php endif; ?>
  106.             <?php endif; ?>
  107.         </div>
  108.    
  109.         <?php if ($product -> price_type == "tiers") : ?>                  
  110.             <fieldset class="<?php echo $this -> pre; ?>">
  111.                 <legend><?php _e('Your Price', $this -> plugin_name); ?></legend>
  112.                     <table class="<?php echo $this -> pre; ?>">
  113.                         <tbody>
  114.                             <?php $t = 1; ?>
  115.                             <?php $class = 'erow'; ?>
  116.                             <?php foreach ($price as $tier) : ?>
  117.                             <?php $tierstring = ($t == count($price)) ? $tier['min'] . ' ' . __('or more', $this -> plugin_name) : $tier['min'] . ' ' . __('to', $this -> plugin_name) . ' ' . $tier['max'] ; ?>
  118.                             <tr class="<?php echo $class = (empty($class) || $class == "erow") ? 'arow' : 'erow'; ?>">
  119.                                 <td><?php echo $tierstring; ?></td>
  120.                                 <td>=</td>
  121.                                 <td><b><?php echo $wpcoHtml -> currency_price($tier['price']); ?></b> <?php _e('per unit', $this -> plugin_name); ?></td>
  122.                             </tr>
  123.                             <?php $t++; ?>
  124.                             <?php endforeach; ?>
  125.                         </tbody>
  126.                     </table>
  127.             </fieldset>
  128.         <?php endif; ?>
  129.        
  130.         <?php if (empty($product -> oos) || $product -> oos != true) : ?>  
  131.             <?php echo $wpcoHtml -> addtocart_action($product -> id, false); ?>
  132.                 <?php echo $wpcoForm -> hidden('Item.product_id', array('value' => $product -> id)); ?>
  133.                
  134.                 <?php global $user_ID; ?>
  135.                 <?php echo $wpcoForm -> hidden('Item.user_id', array('value' => $user_ID)); ?>                 
  136.        
  137.                 <?php if ($this -> get_option('fieldsintab') == "N" || ($this -> get_option('fieldsintab') == "Y" && empty($product -> contents))) : ?>    
  138.                     <?php if (!empty($product -> styles) && !empty($product -> options)) : ?>
  139.                         <?php foreach ($product -> styles as $style_id) : ?>
  140.                             <?php echo $this -> render_style($style_id, $product -> options[$style_id], true, $product -> id); ?>
  141.                         <?php endforeach; ?>
  142.                     <?php endif; ?>
  143.  
  144.                     <?php if (!empty($product -> cfields)) : ?>
  145.                         <?php foreach ($product -> cfields as $field_id) : ?>
  146.                             <?php if (!empty($field_id)) : ?>
  147.                                 <?php $this -> render_field($field_id, true, false, $product -> id); ?>
  148.                             <?php endif; ?>
  149.                         <?php endforeach; ?>
  150.                     <?php endif; ?>
  151.                 <?php endif; ?>
  152.    
  153.                 <?php if ($this -> get_option('howmany') == "Y") : ?>
  154.                     <div class="<?php echo $this -> pre; ?>howmany">                       
  155.                         <b><?php _e('How many', "wp-checkout"); ?> <?php echo $product -> measurement; ?><?php _e('?', "wp-checkout"); ?></b>
  156.                         <?php $cvaluet = (empty($product -> min_order)) ? '1' : $product -> min_order; ?>
  157.                         <?php $cvalue = (empty($_POST['Item']['count'])) ? $cvaluet : $_POST['Item']['count']; ?>
  158.                         <?php echo $wpcoForm -> text('Item.count', array('value' => $cvalue, 'width' => '45px')); ?>
  159.                     </div>
  160.                 <?php else : ?>
  161.                     <?php /*hidden field for quantity as 1*/ ?>
  162.                     <?php echo $wpcoForm -> hidden('Item.count', array('value' => 1)); ?>
  163.                 <?php endif; ?>
  164.                
  165.                 <?php if ($this -> get_option('buynow') == "Y") : ?>
  166.                     <?php if ($this -> get_option('loop_btntxt') == "txt") : ?>
  167.                         <?php if (!empty($product -> affiliate) && $product -> affiliate == "Y") : ?>
  168.                             <span id="submit<?php echo $product -> id; ?>"><a class="<?php echo $this -> pre; ?>buylink" target="_<?php echo $product -> affiliatewindow; ?>" href="<?php echo $wpcoHtml -> retainquery($this -> pre . 'method=affiliate&amp;id=' . $product -> id); ?>" title="<?php echo $product -> title; ?>"><?php echo $this -> get_option('loop_btnlnktext'); ?></a>
  169.                         <?php else : ?>
  170.                             <span id="submit<?php echo $product -> id; ?>"><a href="#void" title="<?php _e('Buy this product now', $this -> plugin_name); ?>" onclick="jQuery('#<?php echo $this -> pre; ?>buy<?php echo $product -> id; ?>').submit();" class="<?php echo $this -> pre; ?>buylink"><?php echo $this -> get_option('loop_btnlnktext'); ?></a></span>
  171.                         <?php endif; ?>
  172.                     <?php else : ?>
  173.                         <span id="submit<?php echo $product -> id; ?>"><?php echo $wpcoForm -> submit($this -> get_option('loop_btnlnktext')); ?></span>
  174.                     <?php endif; ?>
  175.                 <?php else : ?>
  176.                     <?php if ($this -> get_option('loop_btntxt') == "txt") : ?>
  177.                         <?php if (!empty($product -> affiliate) && $product -> affiliate == "Y") : ?>
  178.                             <span id="submit<?php echo $product -> id; ?>"><a href="<?php echo $wpcoHtml -> retainquery($this -> pre . 'method=affiliate&amp;id=' . $product -> id); ?>" class="<?php echo $this -> pre; ?>buylink" target="_<?php echo $product -> affiliatewindow; ?>" title="<?php echo $product -> title; ?>"><?php echo $this -> get_option('loop_btnlnktext'); ?></a>
  179.                         <?php else : ?>
  180.                             <span id="submit<?php echo $product -> id; ?>"><a href="#void" title="<?php _e('Add this product to your shopping cart', $this -> plugin_name); ?>" onclick="wpco_addtocart(jQuery('#addtocart<?php echo $product -> id; ?>'), '<?php echo $product -> id; ?>', '<?php echo $this -> widget_active('cart'); ?>');" class="<?php echo $this -> pre; ?>buylink"><?php echo $this -> get_option('loop_btnlnktext'); ?></a></span>
  181.                         <?php endif; ?>
  182.                     <?php else : ?>
  183.                         <span id="submit<?php echo $product -> id; ?>" style="display:block;"><?php echo $wpcoForm -> submit($this -> get_option('loop_btnlnktext')); ?></span>
  184.                     <?php endif; ?>
  185.                     <span class="<?php echo $this -> pre; ?>loading" id="loading<?php echo $product -> id; ?>" style="display:none;"><img src="<?php echo $this -> url(); ?>/images/loading.gif" alt="loading" /> <?php _e('Adding Product...', $this -> plugin_name); ?></span>
  186.                     <span class="<?php echo $this -> pre; ?>added" style="display:none;" id="added<?php echo $product -> id; ?>"><img src="<?php echo $this -> url(); ?>/images/accept.png" /> <?php _e('Product has been added', $this -> plugin_name); ?></span>
  187.                 <?php endif; ?>
  188.                
  189.                 <?php if ($this -> get_option('fieldsintab') == "Y" && (!empty($product -> styles) || !empty($product -> cfields)) && !empty($product -> contents) && (is_array($product -> contents) || is_object($product -> contents))) : ?>
  190.                     <?php if ($this -> get_option('optionslinktb') == "B") : ?>
  191.                         <p class="<?php echo $this -> pre; ?>optionslink"><small><?php echo $wpcoHtml -> link(__('Product Options &raquo;', $this -> plugin_name), "#void", array('class' => "product-options-link")); ?></small></p>
  192.                     <?php endif; ?>
  193.                 <?php endif; ?>
  194.             <?php else : ?>
  195.                 <p class="<?php echo $this -> pre; ?>oos"><?php echo $captions['product']['oos']; ?></p>
  196.             <?php endif; ?>
  197.                
  198.             <p class="<?php echo $this -> pre; ?>error" id="message<?php echo $product -> id; ?>" style="display:none;"></p>
  199.            
  200.             <?php if (!empty($product -> contents) && (is_array($product -> contents) || is_object($product -> contents))) : ?>
  201.                 <?php $tabscount = 1; ?>
  202.                 <?php $tabscount2 = 1; ?>
  203.                 <div style="clear:both; display:block; height:1px; width:100%;"></div>
  204.            
  205.                 <div id="tabs<?php echo $product -> id; ?>">
  206.                     <!-- BEG Tabs Menu -->
  207.                     <ul>
  208.                         <li><a href="#tabs<?php echo $product -> id; ?>-1"><?php _e('Description', $this -> plugin_name); ?></a></li>
  209.                         <?php $tabscount2++; ?>
  210.                         <?php foreach ($product -> contents as $content) : ?>
  211.                             <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php echo $content -> title; ?></a></li>
  212.                             <?php $tabscount2++; ?>
  213.                         <?php endforeach; ?>
  214.                         <?php if (empty($product -> oos) || $product -> oos == false) : ?>
  215.                             <?php if (!$this -> get_option('fieldsintab') || $this -> get_option('fieldsintab') == "Y") : ?>
  216.                                 <?php if (!empty($product -> styles) || !empty($product -> cfields)) : ?>
  217.                                     <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php _e('Options', $this -> plugin_name); ?></a></li>
  218.                                     <?php $productoptionstab = $tabscount2; ?>
  219.                                     <?php $tabscount2++; ?>
  220.                                 <?php endif; ?>
  221.                             <?php endif; ?>
  222.                         <?php endif; ?>
  223.                         <?php if (!$this -> get_option('gallerytab') || $this -> get_option('gallerytab') == "Y") : ?>
  224.                             <?php if (!empty($product -> images)) : ?>
  225.                                 <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php _e('Gallery', $this -> plugin_name); ?></a></li>
  226.                                 <?php $tabscount2++; ?>
  227.                             <?php endif; ?>
  228.                         <?php endif; ?>
  229.                         <?php if (!empty($product -> related) && $this -> get_option('relatedintab') == "Y") : ?>
  230.                             <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php _e('Related Products', $this -> plugin_name); ?></a></li>
  231.                             <?php $tabscount2++; ?>
  232.                         <?php endif; ?>
  233.                     </ul>
  234.                     <!-- END Tabs Menu -->
  235.                
  236.                     <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  237.                         <h3><?php _e('Description', $this -> plugin_name); ?></h3>
  238.                         <div>
  239.                             <?php echo wpautop(do_shortcode($product -> description)); ?>
  240.                            
  241.                             <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  242.                                 <?php $message = $this -> get_option('unitextboxmessage'); ?>
  243.                                 <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  244.                                     <div class="<?php echo $this -> pre; ?>unitextbox">
  245.                                         <?php echo $message; ?>
  246.                                     </div>
  247.                                 <?php endif; ?>
  248.                             <?php endif; ?>
  249.                         </div>
  250.                     </div>
  251.                     <?php $tabscount++; ?>
  252.                     <?php foreach ($product -> contents as $content) : ?>
  253.                         <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  254.                             <h3><?php echo $content -> title; ?></h3>
  255.                             <div>
  256.                                 <?php echo wpautop(stripslashes(do_shortcode($content -> content))); ?>
  257.                                
  258.                                 <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  259.                                 <?php $message = $this -> get_option('unitextboxmessage'); ?>
  260.                                 <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  261.                                     <div class="<?php echo $this -> pre; ?>unitextbox">
  262.                                         <?php echo $message; ?>
  263.                                     </div>
  264.                                 <?php endif; ?>
  265.                             <?php endif; ?>
  266.                             </div>
  267.                         </div>
  268.                         <?php $tabscount++; ?>
  269.                     <?php endforeach; ?>
  270.                     <!-- BEG Custom Fields & Variations in Tab -->
  271.                     <?php if (empty($product -> oos) || $product -> oos == false) : ?>
  272.                         <?php if (!$this -> get_option('fieldsintab') || $this -> get_option('fieldsintab') == "Y") : ?>
  273.                             <?php if (!empty($product -> styles) || !empty($product -> cfields)) : ?>
  274.                                 <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  275.                                     <h3><?php _e('Options', $this -> plugin_name); ?></h3>
  276.                                     <div>
  277.                                         <?php if (!empty($product -> styles) && !empty($product -> options)) : ?>
  278.                                             <?php foreach ($product -> styles as $style_id) : ?>
  279.                                                 <?php $wpcoDb -> model = $Style -> model; ?>
  280.                                                 <?php if ($style = $wpcoDb -> find(array('id' => $style_id))) : ?>
  281.                                                     <?php echo $this -> render_style($style_id, $product -> options[$style_id], true, $product -> id); ?>
  282.                                                 <?php endif; ?>
  283.                                             <?php endforeach; ?>
  284.                                         <?php endif; ?>
  285.                                        
  286.                                         <?php if (!empty($product -> cfields)) : ?>
  287.                                             <?php foreach ($product -> cfields as $field_id) : ?>
  288.                                                 <?php if (!empty($field_id)) : ?>
  289.                                                     <?php $wpcoDb -> model = $wpcoField -> model; ?>
  290.                                                     <?php if ($field = $wpcoDb -> find(array('id' => $field_id))) : ?>
  291.                                                         <?php $_POST[$field -> slug] = $_POST['Item'][$field -> slug]; ?>
  292.                                                         <?php $this -> render_field($field_id, true, false, $product -> id); ?>
  293.                                                     <?php endif; ?>
  294.                                                 <?php endif; ?>
  295.                                             <?php endforeach; ?>
  296.                                         <?php endif; ?>
  297.                                        
  298.                                         <?php if ($this -> get_option('buynow') == "Y") : ?>
  299.                                             <p><?php echo $wpcoForm -> submit(__('Buy Now', $this -> plugin_name) . ' &raquo;'); ?></p>
  300.                                         <?php else : ?>
  301.                                             <p><?php echo $wpcoForm -> submit(__('Add to Basket', $this -> plugin_name) . ' &raquo;'); ?></p>
  302.                                         <?php endif; ?>
  303.                                        
  304.                                         <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  305.                                             <?php $message = $this -> get_option('unitextboxmessage'); ?>
  306.                                             <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  307.                                                 <div class="<?php echo $this -> pre; ?>unitextbox">
  308.                                                     <?php echo $message; ?>
  309.                                                 </div>
  310.                                             <?php endif; ?>
  311.                                         <?php endif; ?>
  312.                                     </div>
  313.                                 </div>
  314.                                 <?php $tabscount++; ?>
  315.                             <?php endif; ?>
  316.                         <?php endif; ?>
  317.                     <?php endif; ?>
  318.                     <!-- END Custom Fields & Variations in Tab -->
  319.                     <!-- BEG Gallery/extra Images in Tab -->
  320.                     <?php if (!$this -> get_option('gallerytab') || $this -> get_option('gallerytab') == "Y") : ?>
  321.                         <?php if (!empty($product -> images)) : ?>
  322.                             <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  323.                                 <h3><?php _e('Gallery', $this -> plugin_name); ?></h3>
  324.                                 <div>
  325.                                     <div class="<?php echo $this -> pre; ?>imglist <?php echo $this -> pre; ?>imglistfull">
  326.                                         <ul>
  327.                                             <?php foreach ($product -> images as $image) : ?>
  328.                                                 <li><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($image -> filename, 'small'), array('folder' => "images"), $image -> filename), $wpcoHtml -> image_url($image -> filename), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $image -> title)); ?></li>
  329.                                             <?php endforeach; ?>
  330.                                         </ul>
  331.                                         <br class="<?php echo $this -> pre; ?>cleaner" />
  332.                                     </div>
  333.                                    
  334.                                     <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  335.                                         <?php $message = $this -> get_option('unitextboxmessage'); ?>
  336.                                         <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  337.                                             <div class="<?php echo $this -> pre; ?>unitextbox">
  338.                                                 <?php echo $message; ?>
  339.                                             </div>
  340.                                         <?php endif; ?>
  341.                                     <?php endif; ?>
  342.                                 </div>
  343.                             </div>
  344.                             <?php $tabscount++; ?>
  345.                         <?php endif; ?>
  346.                     <?php endif; ?>
  347.                     <!-- END Gallery/extra Images in Tab -->
  348.                     <!-- BEG Related Products in Tab -->
  349.                     <?php if (!empty($product -> related) && $this -> get_option('relatedintab') == "Y") : ?>
  350.                         <?php $rproducts = array(); ?>
  351.                         <?php foreach ($product -> related as $rproduct) : ?>
  352.                             <?php $wpcoDb -> model = $Product -> model; ?>
  353.                             <?php $rproducts[] = $wpcoDb -> find(array('id' => $rproduct -> related_id)); ?>
  354.                         <?php endforeach; ?>
  355.                         <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  356.                             <h3 id="related"><?php _e('Related Products', $this -> plugin_name); ?></h3>
  357.                             <div>
  358.                                 <?php $this -> render('products' . DS . 'loop', array('products' => $rproducts, 'related' => true, 'tabber' => true, 'noaddtob' => true), true, 'default'); ?>
  359.                             </div>
  360.                         </div>
  361.                         <?php $tabscount++; ?>
  362.                     <?php endif; ?>
  363.                     <!-- END Related Products in Tab -->
  364.                 </div>
  365.                 <!-- END Tabber -->
  366.             <?php endif; ?>
  367.         <?php if (empty($product -> oos) || $product -> oos == false) : ?>
  368.                 <?php if ($this -> get_option('buynow') == "Y") : ?>
  369.                     <input type="hidden" name="buynow" value="Y" />
  370.                     <input type="hidden" name="fromproductpage" value="Y" />
  371.                 <?php endif; ?>
  372.             </form>
  373.         <?php endif; ?>
  374.        
  375.         <?php if ($this -> get_option('fieldsintab') == "Y" && (!empty($product -> styles) || !empty($product -> cfields)) && !empty($product -> contents) && (is_array($product -> contents) || is_object($product -> contents))) : ?>
  376.             <?php if ($this -> get_option('optionslinktb') == "T") : ?>
  377.                 <fieldset class="<?php echo $this -> pre; ?> <?php echo $this -> pre; ?>optionslinkfieldset">
  378.                     <legend><?php _e('Product Options', $this -> plugin_name); ?></legend>
  379.                     <span class="<?php echo $this -> pre; ?>optionslink"><?php echo $wpcoHtml -> link(__('Click for Options &raquo;', $this -> plugin_name), "#void", array('class' => "product-options-link")); ?></span>
  380.                 </fieldset>
  381.             <?php endif; ?>
  382.         <?php endif; ?>
  383.     <?php else : ?>    
  384.         <!-- SHOWCASE -->
  385.         <?php if (!empty($product -> contents) && (is_array($product -> contents) || is_object($product -> contents))) : ?>
  386.             <?php $tabscount = 1; ?>
  387.             <?php $tabscount2 = 1; ?>
  388.             <div style="clear:both; display:block; height:1px; width:100%;"></div>
  389.        
  390.             <div id="tabs<?php echo $product -> id; ?>">
  391.                 <!-- BEG Tabs Menu -->
  392.                 <ul>
  393.                     <li><a href="#tabs<?php echo $product -> id; ?>-1"><?php _e('Description', $this -> plugin_name); ?></a></li>
  394.                     <?php $tabscount2++; ?>
  395.                     <?php foreach ($product -> contents as $content) : ?>
  396.                         <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php echo $content -> title; ?></a></li>
  397.                         <?php $tabscount2++; ?>
  398.                     <?php endforeach; ?>
  399.                     <?php if (!$this -> get_option('gallerytab') || $this -> get_option('gallerytab') == "Y") : ?>
  400.                         <?php if (!empty($product -> images)) : ?>
  401.                             <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php _e('Gallery', $this -> plugin_name); ?></a></li>
  402.                             <?php $tabscount2++; ?>
  403.                         <?php endif; ?>
  404.                     <?php endif; ?>
  405.                     <?php if (!empty($product -> related) && $this -> get_option('relatedintab') == "Y") : ?>
  406.                         <li><a href="#tabs<?php echo $product -> id; ?>-<?php echo $tabscount2; ?>"><?php _e('Related Products', $this -> plugin_name); ?></a></li>
  407.                         <?php $tabscount2++; ?>
  408.                     <?php endif; ?>
  409.                 </ul>
  410.                 <!-- END Tabs Menu -->
  411.            
  412.                 <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  413.                     <h3><?php _e('Description', $this -> plugin_name); ?></h3>
  414.                     <div>
  415.                         <?php echo wpautop(do_shortcode($product -> description)); ?>
  416.                        
  417.                         <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  418.                             <?php $message = $this -> get_option('unitextboxmessage'); ?>
  419.                             <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  420.                                 <div class="<?php echo $this -> pre; ?>unitextbox">
  421.                                     <?php echo $message; ?>
  422.                                 </div>
  423.                             <?php endif; ?>
  424.                         <?php endif; ?>
  425.                     </div>
  426.                 </div>
  427.                 <?php $tabscount++; ?>
  428.                 <?php foreach ($product -> contents as $content) : ?>
  429.                     <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  430.                         <h3><?php echo $content -> title; ?></h3>
  431.                         <div>
  432.                             <?php echo wpautop(stripslashes(do_shortcode($content -> content))); ?>
  433.                            
  434.                             <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  435.                             <?php $message = $this -> get_option('unitextboxmessage'); ?>
  436.                             <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  437.                                 <div class="<?php echo $this -> pre; ?>unitextbox">
  438.                                     <?php echo $message; ?>
  439.                                 </div>
  440.                             <?php endif; ?>
  441.                         <?php endif; ?>
  442.                         </div>
  443.                     </div>
  444.                     <?php $tabscount++; ?>
  445.                 <?php endforeach; ?>
  446.                
  447.                 <!-- GALLERY IN TAB -->
  448.                 <?php if (!$this -> get_option('gallerytab') || $this -> get_option('gallerytab') == "Y") : ?>
  449.                     <?php if (!empty($product -> images)) : ?>
  450.                         <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  451.                             <h3><?php _e('Gallery', $this -> plugin_name); ?></h3>
  452.                             <div>
  453.                                 <div class="<?php echo $this -> pre; ?>imglist <?php echo $this -> pre; ?>imglistfull">
  454.                                     <ul>
  455.                                         <?php foreach ($product -> images as $image) : ?>
  456.                                             <li><?php echo $wpcoHtml -> link($wpcoHtml -> image($wpcoHtml -> thumb_name($image -> filename, 'small'), array('folder' => "images"), $image -> filename), $wpcoHtml -> image_url($image -> filename), array('class' => 'thickbox', 'rel' => $wpcoHtml -> sanitize($product -> title) . '-images', 'title' => $image -> title)); ?></li>
  457.                                         <?php endforeach; ?>
  458.                                     </ul>
  459.                                     <br class="<?php echo $this -> pre; ?>cleaner" />
  460.                                 </div>
  461.                                
  462.                                 <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  463.                                     <?php $message = $this -> get_option('unitextboxmessage'); ?>
  464.                                     <?php if (!empty($message) && $this -> get_option('unitextboxintabs') == "Y") : ?>
  465.                                         <div class="<?php echo $this -> pre; ?>unitextbox">
  466.                                             <?php echo $message; ?>
  467.                                         </div>
  468.                                     <?php endif; ?>
  469.                                 <?php endif; ?>
  470.                             </div>
  471.                         </div>
  472.                         <?php $tabscount++; ?>
  473.                     <?php endif; ?>
  474.                 <?php endif; ?>
  475.                
  476.                 <!-- RELATED PRODUCTS -->
  477.                 <?php if (!empty($product -> related) && $this -> get_option('relatedintab') == "Y") : ?>
  478.                     <?php $rproducts = array(); ?>
  479.                     <?php foreach ($product -> related as $rproduct) : ?>
  480.                         <?php $wpcoDb -> model = $Product -> model; ?>
  481.                         <?php $rproducts[] = $wpcoDb -> find(array('id' => $rproduct -> related_id)); ?>
  482.                     <?php endforeach; ?>
  483.                     <div id="tabs<?php echo $product -> id; ?>-<?php echo $tabscount; ?>">
  484.                         <h3 id="related"><?php _e('Related Products', $this -> plugin_name); ?></h3>
  485.                         <div>
  486.                             <?php $this -> render('products' . DS . 'loop', array('products' => $rproducts, 'related' => true, 'tabber' => true, 'noaddtob' => true), true, 'default'); ?>
  487.                         </div>
  488.                     </div>
  489.                     <?php $tabscount++; ?>
  490.                 <?php endif; ?>
  491.             </div>
  492.             <!-- END TABBER -->
  493.         <?php endif; ?>
  494.     <?php endif; ?>
  495.  
  496.     <?php if (!empty($product -> categories)) : ?> 
  497.         <fieldset class="<?php echo $this -> pre; ?>">
  498.             <?php if (count($product -> categories) == 1) : ?>
  499.                 <legend><?php echo $captions['product']['category']; ?></legend>
  500.             <?php else : ?>
  501.                 <legend><?php echo $captions['product']['categories']; ?></legend>
  502.             <?php endif; ?>
  503.            
  504.             <?php $c = 1; ?>
  505.             <?php foreach ($product -> categories as $category_id) : ?>
  506.                 <?php $wpcoDb -> model = $Category -> model; ?>
  507.                 <?php if ($category = $wpcoDb -> find(array('id' => $category_id))) : ?>
  508.                     <a href="<?php echo get_permalink($category -> post_id); ?>" title="<?php echo $category -> title; ?>"><?php echo $category -> title; ?></a>
  509.                     <?php echo ($c < count($product -> categories)) ? ', ' : ''; ?>
  510.                 <?php endif; ?>
  511.                 <?php $c++; ?>
  512.             <?php endforeach; ?>
  513.         </fieldset>
  514.     <?php endif; ?>
  515.    
  516.     <?php if ($this -> get_option('unitextbox') == "Y" && $this -> get_option('unitextfieldset') == "Y") : ?>
  517.         <?php $message = $this -> get_option('unitextboxmessage'); ?>
  518.         <?php if (!empty($message)) : ?>
  519.             <fieldset class="<?php echo $this -> pre; ?>">
  520.                 <legend><?php _e('Attention', $this -> plugin_name); ?></legend>
  521.                 <div class="<?php echo $this -> pre; ?>unitextbox">
  522.                     <?php echo $message; ?>
  523.                 </div>
  524.             </fieldset>
  525.         <?php endif; ?>
  526.     <?php endif; ?>
  527.    
  528.     <?php if (!empty($product -> supplier_id) && $this -> get_option('hidesuppliers') == "N") : ?>
  529.         <fieldset class="<?php echo $this -> pre; ?>">
  530.             <legend><?php echo $captions['product']['supplier']; ?></legend>
  531.             <?php if ($this -> get_option('supplierpages') == "Y" && !empty($product -> supplier -> post_id)) : ?>
  532.                 <?php if ($product -> supplier -> image == "Y" && !empty($product -> supplier -> imagename)) : ?>
  533.                     <?php echo $wpcoHtml -> link($wpcoHtml -> image($product -> supplier -> imagename, array('folder' => "suppliers"), $product -> supplier -> imagename), get_permalink($product -> supplier -> post_id), array('title' => $product -> supplier -> name)); ?>
  534.                 <?php else : ?>
  535.                     <?php echo $wpcoHtml -> link($product -> supplier -> name, get_permalink($product -> supplier -> post_id), array('title' => $product -> supplier -> name)); ?>
  536.                 <?php endif; ?>
  537.             <?php else : ?>
  538.                 <?php echo $product -> supplier -> name; ?>
  539.             <?php endif; ?>
  540.         </fieldset>
  541.     <?php endif; ?>
  542.    
  543.     <?php if (!empty($product -> kws) && is_array($product -> kws)) : ?>
  544.         <fieldset class="<?php echo $this -> pre; ?>">
  545.             <legend><?php echo $captions['product']['keywords']; ?></legend>
  546.             <div class="<?php echo $this -> pre; ?>keywords">
  547.                 <?php $k = 1; ?>
  548.                 <?php foreach ($product -> kws as $kw) : ?>
  549.                     <?php echo $wpcoHtml -> link($kw, rtrim(get_permalink($this -> get_option('allproductsppid')), '/') . '/?' . $this -> pre . 'searchterm=' . urlencode($kw), array('title' => $kw)); ?>
  550.                     <?php echo ($k < count($product -> kws)) ? ', ' : ''; ?>
  551.                     <?php $k++; ?>
  552.                 <?php endforeach; ?>
  553.             </div>
  554.         </fieldset>
  555.     <?php endif; ?>
  556.    
  557.     <?php if (!empty($product -> min_order)) : ?>
  558.         <fieldset class="<?php echo $this -> pre; ?>">
  559.             <legend><?php _e('Minimum Order', $this -> plugin_name); ?></legend>
  560.             <?php echo $product -> min_order; ?> <?php _e('units', $this -> plugin_name); ?>
  561.         </fieldset>
  562.     <?php endif; ?>
  563.    
  564.     <?php if ($this -> get_option('unitextbox') == "Y") : ?>
  565.         <?php $message = $this -> get_option('unitextboxmessage'); ?>
  566.         <?php if (!empty($message)) : ?>
  567.             <div class="<?php echo $this -> pre; ?>unitextbox">
  568.                 <?php echo $message; ?>
  569.             </div>
  570.         <?php endif; ?>
  571.     <?php endif; ?>
  572.    
  573.     <?php if ($this -> get_option('product_descriptionposition') == "below") : ?>
  574.         <?php if (empty($product -> contents) || !is_array($product -> contents)) : ?>
  575.             <?php echo wpautop(do_shortcode($product -> description)); ?>
  576.         <?php endif; ?>
  577.     <?php endif; ?>
  578.    
  579.     <?php if (!empty($product -> related) && ($this -> get_option('relatedintab') == "N" || empty($product -> contents))) : ?>
  580.         <br class="<?php echo $this -> pre; ?>cleaner" />
  581.    
  582.         <?php $rproducts = array(); ?>
  583.         <?php foreach ($product -> related as $rproduct) : ?>
  584.             <?php $wpcoDb -> model = $Product -> model; ?>
  585.             <?php $rproducts[] = $wpcoDb -> find(array('id' => $rproduct -> related_id)); ?>
  586.         <?php endforeach; ?>
  587.         <h3 id="related"><?php _e('Related Products', $this -> plugin_name); ?></h3>
  588.         <?php $this -> render('products' . DS . 'loop', array('products' => $rproducts, 'related' => true, 'tabber' => false), true, 'default'); ?>
  589.     <?php endif; ?>
  590. </div>
  591.  
  592. <?php if (!is_feed()) : ?>
  593.     <script type="text/javascript">
  594.     <?php if ($tabscount > 1) : ?>
  595.         jQuery(document).ready(function() {
  596.             $tabs = jQuery('#tabs<?php echo $product -> id; ?>').tabs();
  597.            
  598.             jQuery('.product-options-link').click(function() {
  599.                 wpco_scroll(jQuery('#tabs<?php echo $product -> id; ?>'));
  600.                 $tabs.tabs('select', '<?php echo $productoptionstab; ?>');
  601.                 return false;
  602.             });
  603.         });
  604.     <?php endif; ?>
  605.     </script>
  606. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment