Skip to content

Instantly share code, notes, and snippets.

@NickToye
Created September 8, 2012 11:11
Show Gist options
  • Save NickToye/3673596 to your computer and use it in GitHub Desktop.
Save NickToye/3673596 to your computer and use it in GitHub Desktop.
<?
$posted_options = Shop_ProductHelper::get_default_options($product);
?>
<?= open_form() ?>
<div id="left_col" class="grid_4">
<div id="product_images">
<? $this->render_partial('shop:image_slider', array('list'=>$product->images)) ?>
</div>
<div id="product_information">
<h3>Product Information</h3>
<p>Category: <a href="<?= $product->category_list[0]->page_url('/category') ?>"><?= h($product->category_list[0]->name) ?></a></p>
</div>
<? if ($product->properties->count): ?>
<div id="product_attributes">
<h3>Product Attributes</h3>
<? $this->render_partial('shop:product_attributes') ?>
</div>
<? endif ?>
<div id="product_related">
<? $this->render_partial('shop:related_products') ?>
</div>
</div>
<div id="right_col" class="grid_8">
<?= flash_message() ?>
<div id="product_title">
<h2><?= $product->name ?></h2>
<p class="brand">By <a href="/brands/<?= $product->manufacturer->url_name ?>"><?= h($product->manufacturer->name) ?></a></p>
<p class="price">
<?
$is_discounted = $product->is_discounted();
?>
<span class="<?= $is_discounted ? 'old_price' : null ?>"><?= format_currency($product->om('sale_price', $posted_options)) ?></span>
<? if ($is_discounted): ?>
<span class="sale_price"><?= format_currency($product->get_discounted_price(1)) ?></span>
<? endif ?>
</p>
<!--<div id="product_rating">
<? $this->render_partial('shop:product_rating_info') ?>
</div>-->
<div id="product_add">
<? if (!$product->om('is_out_of_stock') || $product->allow_pre_order): ?>
<input onclick="return $(this).getForm().sendRequest('shop:on_addToCart', {
extraFields: {flash_partial: 'shop:add_to_cart_partial'},
update: {'mini_cart': 'shop:mini_cart', 'product_page': 'shop:product_partial'}})" type="submit" value="Add To Basket" name="add_to_cart" class="btn" />
<? endif ?>
</div>
</div>
<? if ($product->description): ?>
<div id="product_description">
<?= $product->description ?>
</div>
<? endif ?>
<div id="product_availability" class="">
<h3>Product Availability</h3>
<p><? $product->om('in_stock', $posted_options); ?> in stock.</p>
<? if ($product->om('is_out_of_stock')): ?>
<div id="product_unavailable">
<p class="alert"><strong>This product is temporarily unavailable</strong></p>
<? if ($product->om('expected_availability_date', $posted_options)): ?>
<p class="available">The expected availability date is <strong class="info"><?= $product->om('expected_availability_date', $posted_options)->format('%x') ?></strong>
</p>
<? endif ?>
<? if ($product->om('allow_pre_order', $posted_options)): ?>
<p>This product is available to pre-order</p>
<? endif ?>
</div>
<? else : ?>
<? endif ?>
</div>
<div id="product_details" class="clearfix">
<? if ($product->options->count): ?>
<div id="product_options" class="">
<h3>Product Options</h3>
<? $this->render_partial('shop:product_options') ?>
</div>
<? endif ?>
<? if ($product->extra_options->count): ?>
<div id="extra_options">
<h3>Extra Options</h3>
<? $this->render_partial('shop:product_extra_options') ?>
</div>
<? endif ?>
</div>
<!--<div id="product_reviews" class="clearfix">
<? $this->render_partial('shop:product_reviews') ?>
<? $this->render_partial('shop:add_review_form') ?>
</div>-->
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment