Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Academic Free License (AFL 3.0)
- * that is bundled with this package in the file LICENSE_AFL.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/afl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category design
- * @package base_default
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- */
- /**
- * Product view template
- *
- * @see Mage_Catalog_Block_Product_View
- * @see Mage_Review_Block_Product_View
- */
- ?>
- <?php $_helper = $this->helper('catalog/output'); ?>
- <?php $_product = $this->getProduct(); ?>
- <?php
- $meigee_indigo_productpage = MAGE::helper('ThemeOptionsIndigo')->getThemeOptionsIndigo('meigee_indigo_productpage');
- if ($_product->getIndigoPrcolleteral() == 0):
- $productpage_collateral = $meigee_indigo_productpage['layout']['collateral'];
- else:
- switch ($_product->getIndigoPrcolleteral()) {
- case 1:
- $productpage_collateral = 'collateral_list';
- break;
- case 2:
- $productpage_collateral = 'collateral_tabs';
- break;
- case 3:
- $productpage_collateral = 'collateral_accordion';
- break;
- }
- endif;
- $productpage_sku = $meigee_indigo_productpage['general']['product_sku'];
- $productpage_additional = $meigee_indigo_productpage['additional'];
- if ($_product->getIndigoPrlayout() == 0):
- $productpage_pagelayout = $meigee_indigo_productpage['layout']['pagelayout'];
- else:
- $productpage_pagelayout = $_product->getIndigoPrlayout();
- switch ($productpage_pagelayout) {
- case 1:
- $productpage_pagelayout = 'productpage_small';
- break;
- case 2:
- $productpage_pagelayout = 'productpage_medium';
- break;
- case 3:
- $productpage_pagelayout = 'productpage_large';
- break;
- case 4:
- $productpage_pagelayout = 'productpage_extralarge';
- break;
- }
- endif;
- switch ($productpage_pagelayout) {
- case 'productpage_extralarge':
- $leftcol = 'grid_12';
- $rightcol = 'grid_9';
- $rightcol_no_rel = 'grid_12';
- break;
- case 'productpage_large':
- $leftcol = 'grid_3';
- $rightcol = 'grid_6';
- $rightcol_no_rel = 'grid_9';
- break;
- case 'productpage_medium':
- $leftcol = 'grid_4';
- $rightcol = 'grid_5';
- $rightcol_no_rel = 'grid_8';
- break;
- case 'productpage_small':
- $leftcol = 'grid_5';
- $rightcol = 'grid_4';
- $rightcol_no_rel = 'grid_7';
- break;
- default:
- $leftcol = 'grid_4';
- $rightcol = 'grid_5';
- $rightcol_no_rel = 'grid_8';
- break;
- }
- if ($_product->getIndigoPrbrand() == 0) {
- $pr_brand = $meigee_indigo_productpage['brand']['productbrand'];
- $pr_brandsearch = $meigee_indigo_productpage['brand']['brandsearch'];
- $pr_brandtarget = $meigee_indigo_productpage['brand']['brandtarget'];
- }
- else {
- $pr_brand = $_product->getIndigoPrbrand();
- $pr_brandsearch = $_product->getIndigoPrbrandlink();
- $pr_brandtarget = $_product->getIndigoPrbrandtarget();
- }
- if ($_product->getIndigoPrsidebar() == 0):
- $productpageSidebar = $meigee_indigo_productpage['layout']['productsidebar'];
- else:
- $productpageSidebar = $_product->getIndigoPrsidebar();
- switch ($productpageSidebar) {
- case 1:
- $productpageSidebar = 'left';
- break;
- case 2:
- $productpageSidebar = 'right';
- break;
- case 3:
- $productpageSidebar = 'none';
- break;
- }
- endif;
- ?>
- <script type="text/javascript">
- var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
- </script>
- <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
- <div class="product-view">
- <?php echo MAGE::helper('ThemeOptionsIndigo')->prevnext($_product) ?>
- <?php if($productpageSidebar == 'left' and $productpage_pagelayout != 'productpage_extralarge'): ?>
- <aside class="grid_3 alpha">
- <?php echo $this->getChildHtml('product_col'); ?>
- </aside>
- <?php endif; ?>
- <?php if($productpageSidebar != 'none' and $productpage_pagelayout == 'productpage_extralarge'): ?>
- <div class="grid_12 alpha omega">
- <?php elseif($productpageSidebar == 'left'): ?>
- <div class="grid_9 omega">
- <?php elseif($productpageSidebar == 'right'): ?>
- <div class="grid_9 alpha">
- <?php else: ?>
- <div class="grid_12 alpha omega">
- <?php endif; ?>
- <div class="product-essential">
- <div class="<?php echo $leftcol .' '. $productpage_pagelayout; ?> alpha <?php if($productpage_pagelayout == 'productpage_extralarge' and $productpageSidebar == 'none'): ?> omega<?php endif; ?> product-img-box">
- <?php echo $this->getChildHtml('media'); ?>
- </div>
- <?php if($productpageSidebar == 'left' and $productpage_pagelayout == 'productpage_extralarge'): ?>
- <aside class="grid_3 alpha">
- <?php echo $this->getChildHtml('product_col'); ?>
- </aside>
- <?php endif; ?>
- <div class="<?php if($productpageSidebar != 'none') echo $rightcol; else echo $rightcol_no_rel; ?> <?php if($productpage_pagelayout == 'productpage_extralarge' and $productpageSidebar == 'right'): ?> alpha<?php elseif($productpage_pagelayout == 'productpage_extralarge' and $productpageSidebar == 'none'): ?> alpha omega<?php else: ?> omega<?php endif; ?> product-shop">
- <?php if((($_product->isSaleable() && $this->hasOptions()) and $this->getChildChildHtml('container1', '', true, true)) or !($_product->isSaleable() && $this->hasOptions())): ?>
- <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
- <div class="no-display">
- <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
- <input type="hidden" name="related_product" id="related-products-field" value="" />
- </div>
- <?php endif; ?>
- <!--<?php echo $this->getChildHtml('manufacturer.center'); ?>-->
- <div class="product-name<?php if(!$this->getChildHtml('catalog.product.related')){echo ' no-rel';} ?>">
- <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
- <!-- div setting text to uppercase -->
- <span class="name2"><?php echo $_helper->productAttribute($_product, nl2br($_product->getName2()), 'name2') ?></span>
- <span class="tags">
- <?php
- $productvolume = $_product->getproductvolume();
- if (trim($productvolume)) {
- echo "(" . $_product->getAttributeText('productvolume') . ", " . $_helper->productAttribute($_product, nl2br($_product->getAlcoholpercentage()), 'alcoholpercentage') . "%, " . $_product->getAttributeText('region') . ")";
- }
- ?>
- </span>
- </div>
- <div class="clear"></div>
- <?php $isTypeData = ''; if(!$this->hasOptions()): ?>
- <?php echo $this->getChildHtml('product_type_data'); ?>
- <?php elseif($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE): ?>
- <?php echo $this->getChildHtml('product_type_data'); ?>
- <?php $isTypeData = 'bundle'; ?>
- <?php else: ?>
- <?php $isTypeData = 'left'; ?>
- <?php endif; ?>
- <?php if($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED){$isTypeData = 'left';} ?>
- <!--
- <?php if ($this->displayProductStockStatus()): ?>
- <?php if ($_product->isAvailable()): ?>
- <p class="availability <?php echo $isTypeData; ?> in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
- <?php else: ?>
- <p class="availability <?php echo $isTypeData; ?> out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
- <?php endif; ?>
- <?php endif; ?>
- -->
- <div class="clear"></div>
- <?php echo $this->getChildHtml('alert_urls') ?>
- <?php $optionsAvailability = false; if($_product->isSaleable() && $this->hasOptions()){$optionsAvailability = true;}?>
- <?php if ($_product->getShortDescription()):?>
- <div class="short-description">
- <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
- </div>
- <?php $angelssay = $_product->getangelssay(); ?>
- <?php if (trim($angelssay)): ?>
- <div class="angelssay">
- <span class="angelssay">
- <?php /* echo "What Our Angels Say:"; */?>
- </span>
- <?php echo $_helper->productAttribute($_product, nl2br($_product->getAngelssay()), 'angelssay'); ?>
- </div>
- <?php endif;?>
- <?php endif;?>
- <!-- Error Block 1 -->
- <?php $custom = $_product->getcustom(); ?>
- <?php if (trim($custom == 28)): ?>
- <div class="customproducttxt">
- <?php echo "Design your own Label by clicking the thumbnail below or if you want to add a more personal touch, enter your message below and we will hand write the message!"; ?>
- </div>
- <?php elseif (trim($custom == 29)): ?>
- <div class="customproducttxt">
- <?php echo "Click on the thumbnail below and start designing your own personalised message!";?>
- </div>
- <?php endif; ?>
- <!-- /Error Block 1 -->
- <?php if (!$this->hasOptions()):?>
- <div class="product-type-block">
- <div class="add-to-box">
- <?php if($_product->isSaleable()): ?>
- <?php echo $this->getChildHtml('addtocart') ?>
- <?php endif; ?>
- </div>
- <div class="add-to-links-box">
- <?php echo $this->getChildHtml('addto') ?>
- </div>
- <div class="clear"></div>
- <?php echo $this->getChildHtml('extra_buttons') ?>
- </div>
- <?php endif; ?>
- <?php if ($_product->isSaleable() && $this->hasOptions()):?>
- <div class="bundled-price">
- <?php echo $this->getChildHtml('product_type_data'); ?>
- </div>
- <?php endif;?>
- <?php echo $this->getChildHtml('extrahint') ?>
- <?php echo $this->getChildHtml('other');?>
- <?php echo $this->getTierPriceHtml() ?>
- <?php
- if ($_product->getIndigoPrcustom()):
- echo '<div class="product-custom">' . $_product->getIndigoPrcustom() . '</div>';
- else:
- $product_custom_blocks = explode(",", $productpage_additional['product_custom']);
- foreach ($product_custom_blocks as $product_custom_block) {
- echo '<div class="product-custom">' . $this->getLayout()->createBlock('cms/block')->setBlockId(trim($product_custom_block))->toHtml() . '</div>';
- };
- endif;
- ?>
- <?php echo $this->getChildHtml('upsell_products_slider'); ?>
- <?php if ($_product->isSaleable() && $this->hasOptions()):?>
- <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
- <?php endif;?>
- <?php if((($_product->isSaleable() && $this->hasOptions()) and $this->getChildChildHtml('container1', '', true, true)) or !($_product->isSaleable() && $this->hasOptions())): ?>
- </form>
- <?php endif; ?>
- <?php if ($meigee_indigo_productpage['layout']['collateral_position'] == 'details'): ?>
- <div class="product-collateral"<?php if ($productpage_collateral == 'collateral_accordion') echo " id='collateral-accordion'"; ?>>
- <?php
- if ($productpage_collateral == 'collateral_tabs'):
- echo $this->getChildHtml('info_tabs');
- else:
- foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):
- if ($title = $this->getChildData($alias, 'title')):
- echo '<h2>' . $this->escapeHtml($title) . '</h2>';
- endif;
- echo $html;
- endforeach;
- echo $this->getChildHtml('upsell_products');
- echo $this->getChildHtml('product_additional_data');
- if ($_product->getIndigoPrtabs()):
- $productpage_additional = $this->_product->getIndigoPrtabs();
- else:
- $productpage_additional = $meigee_indigo_productpage['additional'];
- $productpage_additional = $productpage_additional['product_tabs'];
- endif;
- $custom_tabs = array();
- $product_custom_tabs = explode(",", $productpage_additional);
- foreach ($product_custom_tabs as $product_custom_tab) {
- $custom_tabs[] = trim($product_custom_tab);
- };
- foreach ($custom_tabs as $key) {
- if(!empty($key)):
- ?>
- <h2 id="<?php echo $key; ?>"><?php echo Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())->load($key)->getTitle(); ?></h2>
- <?php endif;
- }
- endif;
- foreach ($custom_tabs as $key) {
- if(!empty($key)): ?>
- <div class="box-collateral" id="<?php echo $key; ?>_contents"><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId(trim($key))->toHtml() ?></div>
- <?php endif;
- } ?>
- </div>
- <?php endif; ?>
- </div>
- <?php if($productpageSidebar == 'right' and $productpage_pagelayout == 'productpage_extralarge'): ?>
- <aside class="grid_3 omega">
- <?php echo $this->getChildHtml('product_col'); ?>
- </aside>
- <?php endif; ?>
- <div class="clear"></div>
- <?php if ($_product->isSaleable() && $this->hasOptions()):?>
- <?php if (($_product->isSaleable() && $this->hasOptions()) and !$this->getChildChildHtml('container1', '', true, true)): ?>
- <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
- <div class="no-display">
- <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
- <input type="hidden" name="related_product" id="related-products-field" value="" />
- </div>
- <div class="bundled-price">
- <?php echo $this->getChildHtml('product_type_data'); ?>
- </div>
- <?php endif; ?>
- <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
- <?php if (($_product->isSaleable() && $this->hasOptions()) and !$this->getChildChildHtml('container1', '', true, true)): ?>
- </form>
- <?php endif; ?>
- <?php endif; ?>
- <script type="text/javascript">
- //<![CDATA[
- var productAddToCartForm = new VarienForm('product_addtocart_form');
- productAddToCartForm.submit = function(button, url) {
- if (this.validator.validate()) {
- var form = this.form;
- var oldUrl = form.action;
- if (url) {
- form.action = url;
- }
- var e = null;
- // Start of our new ajax code
- if (!url) {
- url = jQuery('#product_addtocart_form').attr('action');
- }
- url = url.replace("checkout/cart","ajax/index"); // New Code
- var data = jQuery('#product_addtocart_form').serialize();
- data += '&isAjax=1';
- jQuery('#ajax_loader').show();
- try {
- jQuery.ajax( {
- url : url,
- dataType : 'json',
- type : 'post',
- data : data,
- complete: function(){
- if(jQuery('body').hasClass('product-edit')){
- jQuery.ajax({
- url: "<?php echo $this->getUrl('meigeeactions/updatecart/') ?>",
- cache: false
- }).done(function(html){
- jQuery('header#header .top-cart').remove();
- jQuery('header#header .quick-access').prepend(html);
- });
- jQuery('#ajax_loader').hide();
- jQuery('body').append('<div class="add-to-cart-success"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name').' '.$this->__('Updated') ?><br/><a href="<?php echo $this->getUrl('checkout/cart'); ?>"><span><?php echo $this->__('Go to Shopping Basket') ?></span></a><a href="#" class="btn-remove"><i class="icon-remove"></i></a></div>');
- setTimeout(function () {jQuery('.add-to-cart-success').slideUp(500)}, 5000);
- jQuery('.add-to-cart-success a.btn-remove').click(function(){
- jQuery(this).parent().slideUp(500);
- return false;
- })
- }
- },
- success : function(data) {
- jQuery('#ajax_loader').hide();
- if(data.status == 'ERROR'){
- alert(data.message);
- }else{
- if(jQuery('.top-cart')){
- jQuery('.top-cart').replaceWith(data.sidebar);
- }
- /* if(jQuery('.header .links')){
- jQuery('.header .links').replaceWith(data.toplink);
- } */
- }
- jQuery('body').append('<div class="add-to-cart-success">' + data.message +' <a href="<?php echo $this->getUrl('checkout/cart'); ?>"><span><?php echo $this->__('Go to Shopping Basket') ?></span></a><a href="#" class="btn-remove"><i class="fa fa-times" /></a></div>');
- setTimeout(function () {jQuery('.add-to-cart-success').slideUp(500)}, 5000);
- jQuery('.add-to-cart-success a.btn-remove').click(function(){
- jQuery(this).parent().slideUp(500);
- return false;
- })
- }
- });
- } catch (e) {
- }
- // End of our new ajax code
- this.form.action = oldUrl;
- if (e) {
- throw e;
- }
- }
- }.bind(productAddToCartForm);
- productAddToCartForm.submitLight = function(button, url){
- if(this.validator) {
- var nv = Validation.methods;
- delete Validation.methods['required-entry'];
- delete Validation.methods['validate-one-required'];
- delete Validation.methods['validate-one-required-by-name'];
- if (this.validator.validate()) {
- if (url) {
- this.form.action = url;
- }
- this.form.submit();
- }
- Object.extend(Validation.methods, nv);
- }
- }.bind(productAddToCartForm);
- //]]>
- </script>
- </div>
- </div>
- <?php if($productpageSidebar == 'right' and $productpage_pagelayout != 'productpage_extralarge'): ?>
- <aside class="grid_3 omega">
- <div class="sidebarbanner">
- <?php $layout = Mage::getSingleton('core/layout'); $block = $layout->createBlock('cms/block'); $block->setBlockId('sidebarbanner'); echo $block->toHtml(); ?>
- </div>
- </aside>
- <?php endif; ?>
- <div class="clear"></div>
- <?php $region = $_product->getAttributeText('region'); ?>
- <?php $reg = strtolower("region-" . $region) ;?>
- <?php if ($meigee_indigo_productpage['layout']['collateral_position'] == 'underdetails'): ?>
- <div class="product-collateral"<?php if ($productpage_collateral == 'collateral_accordion') echo " id='collateral-accordion'"; ?>>
- <div class="product-collateral">
- <!-- Error Block 2 -->
- <?php $iftasting = $_product->gettastingnotes(); ?>
- <?php if (trim($iftasting !== false)): ?>
- <div class="box-collateral_region">
- <h2><?php echo "Tasting Notes" ; ?></h2>
- <div class="box-collateral">
- <div class="tasting-txt">
- <?php echo $_helper->productAttribute($_product, nl2br($_product->getTastingnotes()), 'tastingnotes') ;?>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <!-- /Error Block 2 -->
- <!-- Error Block 3 -->
- <?php $manufacturer = $_product->getAttributeText('manufacturer'); ?>
- <?php $manu = strtolower("manufacturer-" . $manufacturer) ;?>
- <?php $ifmanufactuer = $_product->getmanufacturer(); ?>
- <?php if (trim($ifmanufacturer !== false)): ?>
- <div class="box-collateral_manufacturer">
- <h2><?php echo "Distillery" ; ?></h2>
- <div class="box-collateral">
- <div class="manufacturer-img">
- <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'manufacturer/' . $manufacturer . ".png"; ?>" data-srcX2="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'manufacturer/' . $manufacturer . '@x2' . ".png"; ?>" alt="" >
- </div>
- <div class="manufacturer-txt">
- <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId($manu)->toHtml() ?>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <!-- /Error block 3 -->
- <?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
- <div class="box-collateral <?php echo "box-{$alias}"?>">
- <?php if ($title = $this->getChildData($alias, 'title')):?>
- <h2><?php echo $this->escapeHtml($title); ?></h2>
- <?php endif;?>
- <?php echo $html; ?>
- </div>
- <?php endforeach;?>
- <?php echo $this->getChildHtml('product_additional_data') ?>
- <?php echo $this->getChildHtml('upsell_products') ?>
- </div>
- </div>
- <?php endif; ?>
- <?php echo $this->getChildHtml('catalog.product.related.bottom'); ?>
- <!-- <?php echo $this->getChildHtml('product.info.review_list'); ?> -->
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement