Version Notes
Added support for Magento 1.9
Download this release
Release Info
Developer | SetuBridge |
Extension | Product_Back_Image_On_Hover |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- app/design/frontend/base/default/layout/moreview.xml +53 -0
- app/design/frontend/base/default/template/moreview/crosssell.phtml +60 -0
- app/design/frontend/base/default/template/moreview/list.phtml +139 -0
- app/design/frontend/base/default/template/moreview/moreview.phtml +74 -0
- app/design/frontend/base/default/template/moreview/related.phtml +97 -0
- app/design/frontend/base/default/template/moreview/upsell.phtml +55 -0
- app/design/frontend/rwd/default/layout/moreview.xml +53 -0
- app/design/frontend/rwd/default/template/moreview/crosssell.phtml +80 -0
- app/design/frontend/rwd/default/template/moreview/list.phtml +214 -0
- app/design/frontend/rwd/default/template/moreview/moreview.phtml +74 -0
- app/design/frontend/rwd/default/template/moreview/related.phtml +112 -0
- app/design/frontend/rwd/default/template/moreview/upsell.phtml +76 -0
- package.xml +5 -5
- skin/frontend/base/default/css/moreview.css +24 -0
- skin/frontend/rwd/default/css/moreview.css +24 -0
app/design/frontend/base/default/layout/moreview.xml
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss" ifconfig="moreview_section/general_group/module_moreview"><stylesheeet>css/moreview.css</stylesheeet></action>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<moreview_index_index>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="moreview/moreview" name="moreview" template="moreview/moreview.phtml" />
|
11 |
+
</reference>
|
12 |
+
</moreview_index_index>
|
13 |
+
|
14 |
+
<catalog_category_layered translate="label">
|
15 |
+
<reference name="product_list">
|
16 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/module_moreview">
|
17 |
+
<template>moreview/list.phtml</template>
|
18 |
+
</action>
|
19 |
+
</reference>
|
20 |
+
</catalog_category_layered>
|
21 |
+
|
22 |
+
<catalog_category_default translate="label">
|
23 |
+
<reference name="product_list">
|
24 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/module_moreview">
|
25 |
+
<template>moreview/list.phtml</template>
|
26 |
+
</action>
|
27 |
+
</reference>
|
28 |
+
</catalog_category_default>
|
29 |
+
|
30 |
+
<checkout_cart_index translate="label">
|
31 |
+
<reference name="checkout.cart.crosssell">
|
32 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/short_desc_instructions">
|
33 |
+
<template>moreview/crosssell.phtml</template>
|
34 |
+
</action>
|
35 |
+
</reference>
|
36 |
+
</checkout_cart_index>
|
37 |
+
|
38 |
+
<catalog_product_view translate="label">
|
39 |
+
<reference name="catalog.product.related">
|
40 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/related_products">
|
41 |
+
<template>moreview/related.phtml</template>
|
42 |
+
</action>
|
43 |
+
</reference>
|
44 |
+
</catalog_product_view>
|
45 |
+
|
46 |
+
<catalog_product_view translate="label">
|
47 |
+
<reference name="product.info.upsell">
|
48 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/upsell_products">
|
49 |
+
<template>moreview/upsell.phtml</template>
|
50 |
+
</action>
|
51 |
+
</reference>
|
52 |
+
</catalog_product_view>
|
53 |
+
</layout>
|
app/design/frontend/base/default/template/moreview/crosssell.phtml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Setubridge Technolabs
|
5 |
+
* http://www.setubridge.com/
|
6 |
+
* @author SetuBridge
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
**/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
/**
|
12 |
+
* Cart cross sell items template
|
13 |
+
*
|
14 |
+
* @see Mage_Checkout_Block_Cart_Crosssell
|
15 |
+
*/
|
16 |
+
$config = Mage::getStoreConfig('moreview_section/general_group/module_moreview');
|
17 |
+
if($config == 1):
|
18 |
+
?>
|
19 |
+
<?php if($this->getItemCount()): ?>
|
20 |
+
<div class="crosssell">
|
21 |
+
<h2><?php echo $this->__('Based on your selection, you may be interested in the following items:') ?></h2>
|
22 |
+
<ul id="crosssell-products-list">
|
23 |
+
<?php foreach ($this->getItems() as $_item): ?>
|
24 |
+
<li class="item">
|
25 |
+
<a class="product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>">
|
26 |
+
|
27 |
+
<?php
|
28 |
+
$sb=0;
|
29 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_item->getId())->getMediaGalleryImages();
|
30 |
+
if(count($imagesCount) >1 ):
|
31 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
32 |
+
if($_images)
|
33 |
+
{
|
34 |
+
$sb=1;
|
35 |
+
?>
|
36 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail', $_images->getFile())->resize(75); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
37 |
+
<?php }
|
38 |
+
endif;?>
|
39 |
+
|
40 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
|
41 |
+
<div class="product-details">
|
42 |
+
<h3 class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></h3>
|
43 |
+
<?php echo $this->getPriceHtml($_item, true) ?>
|
44 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
45 |
+
<ul class="add-to-links">
|
46 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
47 |
+
<li><a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
48 |
+
<?php endif; ?>
|
49 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
|
50 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
51 |
+
<?php endif; ?>
|
52 |
+
</ul>
|
53 |
+
</div>
|
54 |
+
</li>
|
55 |
+
<?php endforeach; ?>
|
56 |
+
</ul>
|
57 |
+
<script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script>
|
58 |
+
</div>
|
59 |
+
<?php endif; ?>
|
60 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/moreview/list.phtml
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Setubridge Technolabs
|
5 |
+
* http://www.setubridge.com/
|
6 |
+
* @author SetuBridge
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
**/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
/**
|
12 |
+
* Product list template
|
13 |
+
*
|
14 |
+
* @see Mage_Catalog_Block_Product_List
|
15 |
+
*/
|
16 |
+
?>
|
17 |
+
<?php
|
18 |
+
$_productCollection=$this->getLoadedProductCollection();
|
19 |
+
$_helper = $this->helper('catalog/output');
|
20 |
+
?>
|
21 |
+
<?php if(!$_productCollection->count()): ?>
|
22 |
+
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
23 |
+
<?php else: ?>
|
24 |
+
<div class="category-products">
|
25 |
+
<?php echo $this->getToolbarHtml() ?>
|
26 |
+
<?php // List mode ?>
|
27 |
+
<?php if($this->getMode()!='grid'): ?>
|
28 |
+
<?php $_iterator = 0; ?>
|
29 |
+
<ol class="products-list" id="products-list">
|
30 |
+
<?php foreach ($_productCollection as $_product): ?>
|
31 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
32 |
+
<?php // Product Image ?>
|
33 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
34 |
+
<?php
|
35 |
+
$sb=0;
|
36 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
|
37 |
+
if(count($imagesCount) >1 ):
|
38 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
39 |
+
if($_images)
|
40 |
+
{
|
41 |
+
$sb=1;
|
42 |
+
?>
|
43 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_images->getFile())->resize(135); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
44 |
+
<?php }
|
45 |
+
endif;?>
|
46 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
47 |
+
<?php // Product description ?>
|
48 |
+
<div class="product-shop">
|
49 |
+
<div class="f-fix">
|
50 |
+
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
51 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
52 |
+
<?php if($_product->getRatingSummary()): ?>
|
53 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
54 |
+
<?php endif; ?>
|
55 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
56 |
+
<?php if($_product->isSaleable()): ?>
|
57 |
+
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
58 |
+
<?php else: ?>
|
59 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
60 |
+
<?php endif; ?>
|
61 |
+
<div class="desc std">
|
62 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
63 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
64 |
+
</div>
|
65 |
+
<ul class="add-to-links">
|
66 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
67 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
68 |
+
<?php endif; ?>
|
69 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
70 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
71 |
+
<?php endif; ?>
|
72 |
+
</ul>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php endforeach; ?>
|
77 |
+
</ol>
|
78 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
79 |
+
|
80 |
+
<?php else: ?>
|
81 |
+
|
82 |
+
<?php // Grid Mode ?>
|
83 |
+
|
84 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
85 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
86 |
+
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
87 |
+
<?php if ($i++%$_columnCount==0): ?>
|
88 |
+
<ul class="products-grid">
|
89 |
+
<?php endif; ?>
|
90 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
91 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
92 |
+
<?php
|
93 |
+
$sb=0;
|
94 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
|
95 |
+
if(count($imagesCount) >1 ):
|
96 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
97 |
+
if($_images)
|
98 |
+
{
|
99 |
+
$sb=1;
|
100 |
+
?>
|
101 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_images->getFile())->resize(135); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
102 |
+
<?php }
|
103 |
+
endif;?>
|
104 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
|
105 |
+
<!--<img src="<?php echo $this->getSkinUrl('images/')?>home_main_callout.jpg" class="sbmoreview"/>-->
|
106 |
+
</a>
|
107 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
108 |
+
<?php if($_product->getRatingSummary()): ?>
|
109 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
110 |
+
<?php endif; ?>
|
111 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
112 |
+
<div class="actions">
|
113 |
+
<?php if($_product->isSaleable()): ?>
|
114 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
115 |
+
<?php else: ?>
|
116 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
117 |
+
<?php endif; ?>
|
118 |
+
<ul class="add-to-links">
|
119 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
120 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
121 |
+
<?php endif; ?>
|
122 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
123 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
124 |
+
<?php endif; ?>
|
125 |
+
</ul>
|
126 |
+
</div>
|
127 |
+
</li>
|
128 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
129 |
+
</ul>
|
130 |
+
<?php endif ?>
|
131 |
+
<?php endforeach ?>
|
132 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
133 |
+
<?php endif; ?>
|
134 |
+
|
135 |
+
<div class="toolbar-bottom">
|
136 |
+
<?php echo $this->getToolbarHtml() ?>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/moreview/moreview.phtml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Setubridge Technolabs
|
5 |
+
* http://www.setubridge.com/
|
6 |
+
* @author SetuBridge
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
**/
|
9 |
+
?>
|
10 |
+
<h4><?php echo $this->__('Module List') ?></h4>
|
11 |
+
<?php
|
12 |
+
|
13 |
+
/*
|
14 |
+
This shows how to load specific fields from a record in the database.
|
15 |
+
1) Note the load(15), this corresponds to saying "select * from table where table_id = 15"
|
16 |
+
2) You can then just use the get(fieldname) to pull specific data from the table.
|
17 |
+
3) If you have a field named news_id, then it becomes getNewsId, etc.
|
18 |
+
*/
|
19 |
+
/*
|
20 |
+
$news = Mage::getModel('moreview/moreview')->load(15);
|
21 |
+
echo $news->getNewsId();
|
22 |
+
echo $news->getTitle();
|
23 |
+
echo $news->getContent();
|
24 |
+
echo $news->getStatus();
|
25 |
+
*/
|
26 |
+
|
27 |
+
/*
|
28 |
+
This shows an alternate way of loading datas from a record using the database the "Magento Way" (using blocks and controller).
|
29 |
+
Uncomment blocks in /app/code/local/Namespace/Module/controllers/IndexController.php if you want to use it.
|
30 |
+
|
31 |
+
*/
|
32 |
+
/*
|
33 |
+
$object = $this->getMoreview();
|
34 |
+
echo 'id: '.$object['test_id'].'<br/>';
|
35 |
+
echo 'title: '.$object['title'].'<br/>';
|
36 |
+
echo 'content: '.$object['content'].'<br/>';
|
37 |
+
echo 'status: '.$object['status'].'<br/>';
|
38 |
+
*/
|
39 |
+
|
40 |
+
|
41 |
+
/*
|
42 |
+
This shows how to load multiple rows in a collection and save a change to them.
|
43 |
+
1) The setPageSize function will load only 5 records per page and you can set the current Page with the setCurPage function.
|
44 |
+
2) The $collection->walk('save') allows you to save everything in the collection after all changes have been made.
|
45 |
+
*/
|
46 |
+
/*
|
47 |
+
$i = 0;
|
48 |
+
|
49 |
+
$collection = Mage::getModel('moreview/moreview')->getCollection();
|
50 |
+
$collection->setPageSize(5);
|
51 |
+
$collection->setCurPage(2);
|
52 |
+
$size = $collection->getSize();
|
53 |
+
$cnt = count($collection);
|
54 |
+
foreach ($collection as $item) {
|
55 |
+
$i = $i+1;
|
56 |
+
$item->setTitle($i);
|
57 |
+
echo $item->getTitle();
|
58 |
+
}
|
59 |
+
|
60 |
+
$collection->walk('save');
|
61 |
+
*/
|
62 |
+
|
63 |
+
/*
|
64 |
+
This shows how to load a single record and save a change.
|
65 |
+
1) Note the setTitle, this corresponds to the table field name, title, and then you pass it the text to change.
|
66 |
+
2) Call the save() function only on a single record.
|
67 |
+
*/
|
68 |
+
/*
|
69 |
+
$object = Mage::getModel('moreview/moreview')->load(1);
|
70 |
+
$object->setTitle('This is a changed title');
|
71 |
+
$object->save();
|
72 |
+
*/
|
73 |
+
|
74 |
+
?>
|
app/design/frontend/base/default/template/moreview/related.phtml
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Setubridge Technolabs
|
5 |
+
* http://www.setubridge.com/
|
6 |
+
* @author SetuBridge
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
**/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
$config = Mage::getStoreConfig('moreview_section/general_group/module_moreview');
|
12 |
+
if($config == 1):
|
13 |
+
?>
|
14 |
+
<?php if($this->getItems()->getSize()): ?>
|
15 |
+
<div class="block block-related">
|
16 |
+
<div class="block-title">
|
17 |
+
<strong><span><?php echo $this->__('Related Products') ?></span></strong>
|
18 |
+
</div>
|
19 |
+
<div class="block-content">
|
20 |
+
<p class="block-subtitle"><?php echo $this->__('Check items to add to the cart or') ?> <a href="#" onclick="selectAllRelated(this); return false;"><?php echo $this->__('select all') ?></a></p>
|
21 |
+
<ol class="mini-products-list" id="block-related">
|
22 |
+
<?php foreach($this->getItems() as $_item): ?>
|
23 |
+
<li class="item">
|
24 |
+
<?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
|
25 |
+
<?php if (!$_item->getRequiredOptions()): ?>
|
26 |
+
<input type="checkbox" class="checkbox related-checkbox" id="related-checkbox<?php echo $_item->getId() ?>" name="related_products[]" value="<?php echo $_item->getId() ?>" />
|
27 |
+
<?php endif; ?>
|
28 |
+
<?php endif; ?>
|
29 |
+
<div class="product">
|
30 |
+
<a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" class="product-image">
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$sb=0;
|
34 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_item->getId())->getMediaGalleryImages();
|
35 |
+
if(count($imagesCount) >1 ):
|
36 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
37 |
+
if($_images)
|
38 |
+
{
|
39 |
+
$sb=1;
|
40 |
+
?>
|
41 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail', $_images->getFile())->resize(50); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
42 |
+
<?php }
|
43 |
+
endif;?>
|
44 |
+
|
45 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
|
46 |
+
<div class="product-details">
|
47 |
+
<p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p>
|
48 |
+
<?php echo $this->getPriceHtml($_item, true, '-related') ?>
|
49 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
50 |
+
<a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
51 |
+
<?php endif; ?>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
</li>
|
55 |
+
<?php endforeach ?>
|
56 |
+
</ol>
|
57 |
+
<script type="text/javascript">decorateList('block-related', 'none-recursive')</script>
|
58 |
+
</div>
|
59 |
+
<script type="text/javascript">
|
60 |
+
//<![CDATA[
|
61 |
+
$$('.related-checkbox').each(function(elem){
|
62 |
+
Event.observe(elem, 'click', addRelatedToProduct)
|
63 |
+
});
|
64 |
+
|
65 |
+
var relatedProductsCheckFlag = false;
|
66 |
+
function selectAllRelated(txt){
|
67 |
+
if (relatedProductsCheckFlag == false) {
|
68 |
+
$$('.related-checkbox').each(function(elem){
|
69 |
+
elem.checked = true;
|
70 |
+
});
|
71 |
+
relatedProductsCheckFlag = true;
|
72 |
+
txt.innerHTML="<?php echo $this->__('unselect all') ?>";
|
73 |
+
} else {
|
74 |
+
$$('.related-checkbox').each(function(elem){
|
75 |
+
elem.checked = false;
|
76 |
+
});
|
77 |
+
relatedProductsCheckFlag = false;
|
78 |
+
txt.innerHTML="<?php echo $this->__('select all') ?>";
|
79 |
+
}
|
80 |
+
addRelatedToProduct();
|
81 |
+
}
|
82 |
+
|
83 |
+
function addRelatedToProduct(){
|
84 |
+
var checkboxes = $$('.related-checkbox');
|
85 |
+
var values = [];
|
86 |
+
for(var i=0;i<checkboxes.length;i++){
|
87 |
+
if(checkboxes[i].checked) values.push(checkboxes[i].value);
|
88 |
+
}
|
89 |
+
if($('related-products-field')){
|
90 |
+
$('related-products-field').value = values.join(',');
|
91 |
+
}
|
92 |
+
}
|
93 |
+
//]]>
|
94 |
+
</script>
|
95 |
+
</div>
|
96 |
+
<?php endif ?>
|
97 |
+
<?php endif ?>
|
app/design/frontend/base/default/template/moreview/upsell.phtml
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Setubridge Technolabs
|
5 |
+
* http://www.setubridge.com/
|
6 |
+
* @author SetuBridge
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
**/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
$config = Mage::getStoreConfig('moreview_section/general_group/module_moreview');
|
12 |
+
if($config == 1):
|
13 |
+
?>
|
14 |
+
<?php if(count($this->getItemCollection()->getItems())): ?>
|
15 |
+
<div class="box-collateral box-up-sell">
|
16 |
+
<h2><?php echo $this->__('You may also be interested in the following product(s)') ?></h2>
|
17 |
+
<table class="products-grid" id="upsell-product-table">
|
18 |
+
<?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
|
19 |
+
<?php $this->resetItemsIterator() ?>
|
20 |
+
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
|
21 |
+
<tr>
|
22 |
+
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
23 |
+
<?php if($_link=$this->getIterableItem()): ?>
|
24 |
+
<td>
|
25 |
+
<a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>" class="product-image">
|
26 |
+
|
27 |
+
<?php
|
28 |
+
$sb=0;
|
29 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_link->getId())->getMediaGalleryImages();
|
30 |
+
if(count($imagesCount) >1 ):
|
31 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
32 |
+
if($_images)
|
33 |
+
{
|
34 |
+
$sb=1;
|
35 |
+
?>
|
36 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_link, 'thumbnail', $_images->getFile())->resize(125); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
37 |
+
<?php }
|
38 |
+
endif;?>
|
39 |
+
|
40 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a>
|
41 |
+
<h3 class="product-name"><a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>"><?php echo $this->htmlEscape($_link->getName()) ?></a></h3>
|
42 |
+
<?php echo $this->getPriceHtml($_link, true, '-upsell') ?>
|
43 |
+
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
44 |
+
</td>
|
45 |
+
<?php else: ?>
|
46 |
+
<td class="empty"> </td>
|
47 |
+
<?php endif; ?>
|
48 |
+
<?php endfor; ?>
|
49 |
+
</tr>
|
50 |
+
<?php endfor; ?>
|
51 |
+
</table>
|
52 |
+
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
53 |
+
</div>
|
54 |
+
<?php endif ?>
|
55 |
+
<?php endif ?>
|
app/design/frontend/rwd/default/layout/moreview.xml
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss" ifconfig="moreview_section/general_group/module_moreview"><stylesheeet>css/moreview.css</stylesheeet></action>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<moreview_index_index>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="moreview/moreview" name="moreview" template="moreview/moreview.phtml" />
|
11 |
+
</reference>
|
12 |
+
</moreview_index_index>
|
13 |
+
|
14 |
+
<catalog_category_layered translate="label">
|
15 |
+
<reference name="product_list">
|
16 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/module_moreview">
|
17 |
+
<template>moreview/list.phtml</template>
|
18 |
+
</action>
|
19 |
+
</reference>
|
20 |
+
</catalog_category_layered>
|
21 |
+
|
22 |
+
<catalog_category_default translate="label">
|
23 |
+
<reference name="product_list">
|
24 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/module_moreview">
|
25 |
+
<template>moreview/list.phtml</template>
|
26 |
+
</action>
|
27 |
+
</reference>
|
28 |
+
</catalog_category_default>
|
29 |
+
|
30 |
+
<checkout_cart_index translate="label">
|
31 |
+
<reference name="checkout.cart.crosssell">
|
32 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/short_desc_instructions">
|
33 |
+
<template>moreview/crosssell.phtml</template>
|
34 |
+
</action>
|
35 |
+
</reference>
|
36 |
+
</checkout_cart_index>
|
37 |
+
|
38 |
+
<catalog_product_view translate="label">
|
39 |
+
<reference name="catalog.product.related">
|
40 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/related_products">
|
41 |
+
<template>moreview/related.phtml</template>
|
42 |
+
</action>
|
43 |
+
</reference>
|
44 |
+
</catalog_product_view>
|
45 |
+
|
46 |
+
<catalog_product_view translate="label">
|
47 |
+
<reference name="product.info.upsell">
|
48 |
+
<action method="setTemplate" ifconfig="moreview_section/general_group/upsell_products">
|
49 |
+
<template>moreview/upsell.phtml</template>
|
50 |
+
</action>
|
51 |
+
</reference>
|
52 |
+
</catalog_product_view>
|
53 |
+
</layout>
|
app/design/frontend/rwd/default/template/moreview/crosssell.phtml
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package rwd_default
|
23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Cart cross sell items template
|
30 |
+
*
|
31 |
+
* @see Mage_Checkout_Block_Cart_Crosssell
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<?php if($this->getItemCount()): ?>
|
35 |
+
<div class="crosssell">
|
36 |
+
<h2><?php echo $this->__('Based on your selection, you may be interested in the following items:') ?></h2>
|
37 |
+
<ul id="crosssell-products-list" class="products-grid products-grid--max-3-col">
|
38 |
+
<?php foreach ($this->getItems() as $_item): ?>
|
39 |
+
<li class="item">
|
40 |
+
<a class="product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
41 |
+
|
42 |
+
<?php
|
43 |
+
$config = Mage::getStoreConfig('moreview_section/general_group/module_moreview');
|
44 |
+
if($config==1)
|
45 |
+
{
|
46 |
+
$sb=0;
|
47 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_item->getId())->getMediaGalleryImages();
|
48 |
+
if(count($imagesCount) >1 ):
|
49 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
50 |
+
if($_images)
|
51 |
+
{
|
52 |
+
$sb=1;
|
53 |
+
?>
|
54 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail', $_images->getFile())->resize(210); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
55 |
+
<?php }
|
56 |
+
|
57 |
+
endif;
|
58 |
+
}?>
|
59 |
+
|
60 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(210); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
|
61 |
+
</a>
|
62 |
+
<div class="product-details">
|
63 |
+
<h3 class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
|
64 |
+
<?php echo $this->getPriceHtml($_item, true) ?>
|
65 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
66 |
+
<ul class="add-to-links">
|
67 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
68 |
+
<li><a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
69 |
+
<?php endif; ?>
|
70 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
|
71 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
72 |
+
<?php endif; ?>
|
73 |
+
</ul>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php endforeach; ?>
|
77 |
+
</ul>
|
78 |
+
<?php // <script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script> ?>
|
79 |
+
</div>
|
80 |
+
<?php endif; ?>
|
app/design/frontend/rwd/default/template/moreview/list.phtml
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package rwd_default
|
23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Product list template
|
30 |
+
*
|
31 |
+
* @see Mage_Catalog_Block_Product_List
|
32 |
+
*/
|
33 |
+
/* @var $this Mage_Catalog_Block_Product_List */
|
34 |
+
?>
|
35 |
+
<?php
|
36 |
+
$_productCollection=$this->getLoadedProductCollection();
|
37 |
+
$_helper = $this->helper('catalog/output');
|
38 |
+
?>
|
39 |
+
<?php if(!$_productCollection->count()): ?>
|
40 |
+
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
41 |
+
<?php else: ?>
|
42 |
+
<div class="category-products">
|
43 |
+
<?php echo $this->getToolbarHtml() ?>
|
44 |
+
<?php // List mode ?>
|
45 |
+
<?php if($this->getMode()!='grid'): ?>
|
46 |
+
<?php $_iterator = 0; ?>
|
47 |
+
<ol class="products-list" id="products-list">
|
48 |
+
<?php foreach ($_productCollection as $_product): ?>
|
49 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
50 |
+
<?php // Product Image ?>
|
51 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
52 |
+
|
53 |
+
<?php /* Based on the native RWD styling, product images are displayed at a max of ~400px wide when viewed on a
|
54 |
+
one column page layout with four product columns from a 1280px viewport. For bandwidth reasons,
|
55 |
+
we are going to serve a 300px image, as it will look fine at 400px and most of the times, the image
|
56 |
+
will be displayed at a smaller size (eg, if two column are being used or viewport is smaller than 1280px).
|
57 |
+
This $_imgSize value could even be decreased further, based on the page layout
|
58 |
+
(one column, two column, three column) and number of product columns. */ ?>
|
59 |
+
<?php
|
60 |
+
$sb=0;
|
61 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
|
62 |
+
if(count($imagesCount) >1 ):
|
63 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
64 |
+
if($_images)
|
65 |
+
{
|
66 |
+
$sb=1;
|
67 |
+
$_imgSize = 300;
|
68 |
+
?>
|
69 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_images->getFile())->resize($_imgSize); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
70 |
+
<?php }
|
71 |
+
endif;?>
|
72 |
+
<?php $_imgSize = 300; ?>
|
73 |
+
<img id="product-collection-image-<?php echo $_product->getId(); ?>"
|
74 |
+
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
|
75 |
+
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="<?php if($sb==1)echo "sbview";?>"/>
|
76 |
+
</a>
|
77 |
+
<?php // Product description ?>
|
78 |
+
<div class="product-shop">
|
79 |
+
<div class="f-fix">
|
80 |
+
<div class="product-primary">
|
81 |
+
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
82 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
83 |
+
<?php if($_product->getRatingSummary()): ?>
|
84 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
85 |
+
<?php endif; ?>
|
86 |
+
|
87 |
+
<?php
|
88 |
+
$_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
|
89 |
+
foreach($_nameAfterChildren as $_nameAfterChildName):
|
90 |
+
$_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
|
91 |
+
$_nameAfterChild->setProduct($_product);
|
92 |
+
?>
|
93 |
+
<?php echo $_nameAfterChild->toHtml(); ?>
|
94 |
+
<?php endforeach; ?>
|
95 |
+
</div>
|
96 |
+
<div class="product-secondary">
|
97 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
98 |
+
</div>
|
99 |
+
<div class="product-secondary">
|
100 |
+
<?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
|
101 |
+
<p class="action"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
102 |
+
<?php elseif($_product->isSaleable()): ?>
|
103 |
+
<p class="action"><a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
|
104 |
+
<?php else: ?>
|
105 |
+
<p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
106 |
+
<?php endif; ?>
|
107 |
+
<ul class="add-to-links">
|
108 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
109 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
110 |
+
<?php endif; ?>
|
111 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
112 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
113 |
+
<?php endif; ?>
|
114 |
+
</ul>
|
115 |
+
</div>
|
116 |
+
<div class="desc std">
|
117 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
118 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
</li>
|
123 |
+
<?php endforeach; ?>
|
124 |
+
</ol>
|
125 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
126 |
+
|
127 |
+
<?php else: ?>
|
128 |
+
|
129 |
+
<?php // Grid Mode ?>
|
130 |
+
|
131 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
132 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
133 |
+
<ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
|
134 |
+
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
135 |
+
<?php /*if ($i++%$_columnCount==0): ?>
|
136 |
+
<?php endif*/ ?>
|
137 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
138 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
139 |
+
<?php
|
140 |
+
$sb=0;
|
141 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
|
142 |
+
if(count($imagesCount) >1 ):
|
143 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
144 |
+
if($_images)
|
145 |
+
{
|
146 |
+
$sb=1;
|
147 |
+
$_imgSize = 210;
|
148 |
+
?>
|
149 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_images->getFile())->resize($_imgSize); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
150 |
+
<?php }
|
151 |
+
endif;?>
|
152 |
+
|
153 |
+
<?php $_imgSize = 210; ?>
|
154 |
+
<img id="product-collection-image-<?php echo $_product->getId(); ?>"
|
155 |
+
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
|
156 |
+
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="<?php if($sb==1)echo "sbview";?>"/>
|
157 |
+
</a>
|
158 |
+
<div class="product-info">
|
159 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
160 |
+
|
161 |
+
<?php
|
162 |
+
$_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
|
163 |
+
foreach($_nameAfterChildren as $_nameAfterChildName):
|
164 |
+
$_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
|
165 |
+
$_nameAfterChild->setProduct($_product);
|
166 |
+
?>
|
167 |
+
<?php echo $_nameAfterChild->toHtml(); ?>
|
168 |
+
<?php endforeach; ?>
|
169 |
+
|
170 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
171 |
+
<?php if($_product->getRatingSummary()): ?>
|
172 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
173 |
+
<?php endif; ?>
|
174 |
+
<div class="actions">
|
175 |
+
<?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
|
176 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
177 |
+
<?php elseif($_product->isSaleable()): ?>
|
178 |
+
<a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
|
179 |
+
<?php else: ?>
|
180 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
181 |
+
<?php endif; ?>
|
182 |
+
<ul class="add-to-links">
|
183 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
184 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
185 |
+
<?php endif; ?>
|
186 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
187 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
188 |
+
<?php endif; ?>
|
189 |
+
</ul>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
</li>
|
193 |
+
<?php /*if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
194 |
+
<?php endif*/ ?>
|
195 |
+
<?php endforeach ?>
|
196 |
+
</ul>
|
197 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
198 |
+
<?php endif; ?>
|
199 |
+
|
200 |
+
<div class="toolbar-bottom">
|
201 |
+
<?php echo $this->getToolbarHtml() ?>
|
202 |
+
</div>
|
203 |
+
</div>
|
204 |
+
<?php endif; ?>
|
205 |
+
|
206 |
+
<?php
|
207 |
+
//set product collection on after blocks
|
208 |
+
$_afterChildren = $this->getChild('after')->getSortedChildren();
|
209 |
+
foreach($_afterChildren as $_afterChildName):
|
210 |
+
$_afterChild = $this->getChild('after')->getChild($_afterChildName);
|
211 |
+
$_afterChild->setProductCollection($_productCollection);
|
212 |
+
?>
|
213 |
+
<?php echo $_afterChild->toHtml(); ?>
|
214 |
+
<?php endforeach; ?>
|
app/design/frontend/rwd/default/template/moreview/moreview.phtml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Setubridge Technolabs
|
5 |
+
* http://www.setubridge.com/
|
6 |
+
* @author SetuBridge
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
**/
|
9 |
+
?>
|
10 |
+
<h4><?php echo $this->__('Module List') ?></h4>
|
11 |
+
<?php
|
12 |
+
|
13 |
+
/*
|
14 |
+
This shows how to load specific fields from a record in the database.
|
15 |
+
1) Note the load(15), this corresponds to saying "select * from table where table_id = 15"
|
16 |
+
2) You can then just use the get(fieldname) to pull specific data from the table.
|
17 |
+
3) If you have a field named news_id, then it becomes getNewsId, etc.
|
18 |
+
*/
|
19 |
+
/*
|
20 |
+
$news = Mage::getModel('moreview/moreview')->load(15);
|
21 |
+
echo $news->getNewsId();
|
22 |
+
echo $news->getTitle();
|
23 |
+
echo $news->getContent();
|
24 |
+
echo $news->getStatus();
|
25 |
+
*/
|
26 |
+
|
27 |
+
/*
|
28 |
+
This shows an alternate way of loading datas from a record using the database the "Magento Way" (using blocks and controller).
|
29 |
+
Uncomment blocks in /app/code/local/Namespace/Module/controllers/IndexController.php if you want to use it.
|
30 |
+
|
31 |
+
*/
|
32 |
+
/*
|
33 |
+
$object = $this->getMoreview();
|
34 |
+
echo 'id: '.$object['test_id'].'<br/>';
|
35 |
+
echo 'title: '.$object['title'].'<br/>';
|
36 |
+
echo 'content: '.$object['content'].'<br/>';
|
37 |
+
echo 'status: '.$object['status'].'<br/>';
|
38 |
+
*/
|
39 |
+
|
40 |
+
|
41 |
+
/*
|
42 |
+
This shows how to load multiple rows in a collection and save a change to them.
|
43 |
+
1) The setPageSize function will load only 5 records per page and you can set the current Page with the setCurPage function.
|
44 |
+
2) The $collection->walk('save') allows you to save everything in the collection after all changes have been made.
|
45 |
+
*/
|
46 |
+
/*
|
47 |
+
$i = 0;
|
48 |
+
|
49 |
+
$collection = Mage::getModel('moreview/moreview')->getCollection();
|
50 |
+
$collection->setPageSize(5);
|
51 |
+
$collection->setCurPage(2);
|
52 |
+
$size = $collection->getSize();
|
53 |
+
$cnt = count($collection);
|
54 |
+
foreach ($collection as $item) {
|
55 |
+
$i = $i+1;
|
56 |
+
$item->setTitle($i);
|
57 |
+
echo $item->getTitle();
|
58 |
+
}
|
59 |
+
|
60 |
+
$collection->walk('save');
|
61 |
+
*/
|
62 |
+
|
63 |
+
/*
|
64 |
+
This shows how to load a single record and save a change.
|
65 |
+
1) Note the setTitle, this corresponds to the table field name, title, and then you pass it the text to change.
|
66 |
+
2) Call the save() function only on a single record.
|
67 |
+
*/
|
68 |
+
/*
|
69 |
+
$object = Mage::getModel('moreview/moreview')->load(1);
|
70 |
+
$object->setTitle('This is a changed title');
|
71 |
+
$object->save();
|
72 |
+
*/
|
73 |
+
|
74 |
+
?>
|
app/design/frontend/rwd/default/template/moreview/related.phtml
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package rwd_default
|
23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php if($this->getItems()->getSize()): ?>
|
28 |
+
<div class="block block-related">
|
29 |
+
<div class="block-title">
|
30 |
+
<h2><?php echo $this->__('Related Products') ?></h2>
|
31 |
+
</div>
|
32 |
+
<div class="block-content">
|
33 |
+
<p class="block-subtitle"><?php echo $this->__('Check items to add to the cart or') ?> <a href="#" onclick="selectAllRelated(this); return false;"><?php echo $this->__('select all') ?></a></p>
|
34 |
+
<ol class="mini-products-list" id="block-related">
|
35 |
+
<?php foreach($this->getItems() as $_item): ?>
|
36 |
+
<li class="item">
|
37 |
+
<?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
|
38 |
+
<?php if (!$_item->getRequiredOptions()): ?>
|
39 |
+
<input type="checkbox" class="checkbox related-checkbox" id="related-checkbox<?php echo $_item->getId() ?>" name="related_products[]" value="<?php echo $_item->getId() ?>" />
|
40 |
+
<?php endif; ?>
|
41 |
+
<?php endif; ?>
|
42 |
+
<div class="product">
|
43 |
+
<a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="product-image">
|
44 |
+
<?php
|
45 |
+
$config = Mage::getStoreConfig('moreview_section/general_group/module_moreview');
|
46 |
+
if($config==1)
|
47 |
+
{
|
48 |
+
$sb=0;
|
49 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_item->getId())->getMediaGalleryImages();
|
50 |
+
if(count($imagesCount) >1 ):
|
51 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
52 |
+
if($_images)
|
53 |
+
{
|
54 |
+
$sb=1;
|
55 |
+
?>
|
56 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail', $_images->getFile())->resize(75); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>" width="75" height="75"/>
|
57 |
+
<?php }
|
58 |
+
endif;
|
59 |
+
}?>
|
60 |
+
|
61 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(75) ?>" width="75" height="75" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" /></a>
|
62 |
+
<div class="product-details">
|
63 |
+
<p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></p>
|
64 |
+
<?php echo $this->getPriceHtml($_item, true, '-related') ?>
|
65 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
66 |
+
<a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
|
67 |
+
<?php endif; ?>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
</li>
|
71 |
+
<?php endforeach ?>
|
72 |
+
</ol>
|
73 |
+
<script type="text/javascript">decorateList('block-related', 'none-recursive')</script>
|
74 |
+
</div>
|
75 |
+
<script type="text/javascript">
|
76 |
+
//<![CDATA[
|
77 |
+
$$('.related-checkbox').each(function(elem){
|
78 |
+
Event.observe(elem, 'click', addRelatedToProduct)
|
79 |
+
});
|
80 |
+
|
81 |
+
var relatedProductsCheckFlag = false;
|
82 |
+
function selectAllRelated(txt){
|
83 |
+
if (relatedProductsCheckFlag == false) {
|
84 |
+
$$('.related-checkbox').each(function(elem){
|
85 |
+
elem.checked = true;
|
86 |
+
});
|
87 |
+
relatedProductsCheckFlag = true;
|
88 |
+
txt.innerHTML="<?php echo $this->__('unselect all') ?>";
|
89 |
+
} else {
|
90 |
+
$$('.related-checkbox').each(function(elem){
|
91 |
+
elem.checked = false;
|
92 |
+
});
|
93 |
+
relatedProductsCheckFlag = false;
|
94 |
+
txt.innerHTML="<?php echo $this->__('select all') ?>";
|
95 |
+
}
|
96 |
+
addRelatedToProduct();
|
97 |
+
}
|
98 |
+
|
99 |
+
function addRelatedToProduct(){
|
100 |
+
var checkboxes = $$('.related-checkbox');
|
101 |
+
var values = [];
|
102 |
+
for(var i=0;i<checkboxes.length;i++){
|
103 |
+
if(checkboxes[i].checked) values.push(checkboxes[i].value);
|
104 |
+
}
|
105 |
+
if($('related-products-field')){
|
106 |
+
$('related-products-field').value = values.join(',');
|
107 |
+
}
|
108 |
+
}
|
109 |
+
//]]>
|
110 |
+
</script>
|
111 |
+
</div>
|
112 |
+
<?php endif ?>
|
app/design/frontend/rwd/default/template/moreview/upsell.phtml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package rwd_default
|
23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php if(count($this->getItemCollection()->getItems())): ?>
|
28 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
29 |
+
<div class="box-collateral box-up-sell">
|
30 |
+
<h2><?php echo $this->__('You may also be interested in the following product(s)') ?></h2>
|
31 |
+
<ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col" id="upsell-product-table">
|
32 |
+
<?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
|
33 |
+
<?php $this->resetItemsIterator() ?>
|
34 |
+
<?php foreach ($this->getItemCollection()->getItems() as $_link): ?>
|
35 |
+
<?php /*for($_i=0;$_i<$this->getRowCount();$_i++): ?>
|
36 |
+
<tr>
|
37 |
+
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
38 |
+
<?php if($_link=$this->getIterableItem()): */ ?>
|
39 |
+
<li>
|
40 |
+
<a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_link->getName()) ?>" class="product-image">
|
41 |
+
<?php
|
42 |
+
$config = Mage::getStoreConfig('moreview_section/general_group/module_moreview');
|
43 |
+
if($config==1)
|
44 |
+
{
|
45 |
+
$sb=0;
|
46 |
+
$imagesCount = Mage::getModel('catalog/product')->load($_link->getId())->getMediaGalleryImages();
|
47 |
+
if(count($imagesCount) >1 ):
|
48 |
+
$_images = $imagesCount->getItemByColumnValue('label', 'back');
|
49 |
+
if($_images)
|
50 |
+
{
|
51 |
+
$sb=1;
|
52 |
+
?>
|
53 |
+
<img class="sbmoreview" src="<?php echo $this->helper('catalog/image')->init($_link, 'thumbnail', $_images->getFile())->resize(280); ?>" alt="<?php echo $this->htmlEscape($_images->getLabel());?>" title="<?php $this->htmlEscape($_images->getLabel());?>"/>
|
54 |
+
<?php }
|
55 |
+
endif;
|
56 |
+
}?>
|
57 |
+
|
58 |
+
<img class="<?php if($sb==1)echo "sbview";?>" src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(280) ?>" alt="<?php echo $this->escapeHtml($_link->getName()) ?>" />
|
59 |
+
</a>
|
60 |
+
<h3 class="product-name"><a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_link->getName()) ?>"><?php echo $this->escapeHtml($_link->getName()) ?></a></h3>
|
61 |
+
<?php echo $this->getPriceHtml($_link, true, '-upsell') ?>
|
62 |
+
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
63 |
+
</li>
|
64 |
+
<?php /*else: ?>
|
65 |
+
<td class="empty"> </td>
|
66 |
+
<?php endif; ?>
|
67 |
+
<?php endfor; ?>
|
68 |
+
</tr>
|
69 |
+
<?php endfor; */?>
|
70 |
+
<?php endforeach; ?>
|
71 |
+
</ul>
|
72 |
+
<?php /*
|
73 |
+
<script type="text/javascript">decorateGeneric($$('#upsell-product-table'), ['odd','even','first','last'])</script>
|
74 |
+
*/ ?>
|
75 |
+
</div>
|
76 |
+
<?php endif ?>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Product_Back_Image_On_Hover</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSLv3.0</license>
|
7 |
<channel>community</channel>
|
@@ -21,11 +21,11 @@ With online shopping perfect showcase of your catalog is must necessarily outsta
|
|
21 |
<li>Follow Extension Development guideline</li>
|
22 |
<li>No Additional changes required for extension to work</li>
|
23 |
<li>Direct filter in Moreviews to load back button image rather than ugly looping concept</li></description>
|
24 |
-
<notes>
|
25 |
<authors><author><name>SetuBridge</name><user>Technolabs</user><email>support@setubridge.com</email></author></authors>
|
26 |
-
<date>2014-
|
27 |
-
<time>11:
|
28 |
-
<contents><target name="magelocal"><dir name="Sbridge"><dir name="Moreview"><dir name="Helper"><file name="Data.php" hash="77ad595320752f10a30b61bf5e723e19"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MoreviewController.php" hash="84754802778f1983da620879806206a4"/></dir><file name="IndexController.php" hash="062e025896b8de25acd2fd0d65d55cc0"/></dir><dir name="etc"><file name="adminhtml.xml" hash="728425db93a9a90d36c7651ae011fb4e"/><file name="config.xml" hash="1fa23d3c574ba50e6ddbc7ae8b310f34"/><file name="system.xml" hash="496459405b10355e23acd02d3f3878a1"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="moreview"><file name="crosssell.phtml" hash="7bc6d54dd7db3d2d271198d024caa0c8"/><file name="list.phtml" hash="b1b1d3a45f12bbe4089093d27a1cc575"/><file name="moreview.phtml" hash="a1722fdcb91f8cc555e54c8fb12ce6e6"/><file name="related.phtml" hash="e44796becd9dcae45f815f3915e4f5cc"/><file name="upsell.phtml" hash="e973ba07390da41b2756a4d914dd9c79"/></dir></dir><dir name="layout"><file name="moreview.xml" hash="7e31ba4d2594523f0c979968b601c214"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="moreview.xml" hash="1e81c54dc590a17f70063a4529383a98"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sbridge_Moreview.xml" hash="7a70ff4f71a279ab47f34b46de09ec16"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="moreview.css" hash="ecc5ddad78877b293b4cce18fada5c7f"/></dir></dir></dir></dir></target></contents>
|
29 |
<compatible/>
|
30 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
31 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Product_Back_Image_On_Hover</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSLv3.0</license>
|
7 |
<channel>community</channel>
|
21 |
<li>Follow Extension Development guideline</li>
|
22 |
<li>No Additional changes required for extension to work</li>
|
23 |
<li>Direct filter in Moreviews to load back button image rather than ugly looping concept</li></description>
|
24 |
+
<notes>Added support for Magento 1.9</notes>
|
25 |
<authors><author><name>SetuBridge</name><user>Technolabs</user><email>support@setubridge.com</email></author></authors>
|
26 |
+
<date>2014-08-07</date>
|
27 |
+
<time>13:11:19</time>
|
28 |
+
<contents><target name="magelocal"><dir name="Sbridge"><dir name="Moreview"><dir name="Helper"><file name="Data.php" hash="77ad595320752f10a30b61bf5e723e19"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MoreviewController.php" hash="84754802778f1983da620879806206a4"/></dir><file name="IndexController.php" hash="062e025896b8de25acd2fd0d65d55cc0"/></dir><dir name="etc"><file name="adminhtml.xml" hash="728425db93a9a90d36c7651ae011fb4e"/><file name="config.xml" hash="1fa23d3c574ba50e6ddbc7ae8b310f34"/><file name="system.xml" hash="496459405b10355e23acd02d3f3878a1"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="moreview"><file name="crosssell.phtml" hash="7bc6d54dd7db3d2d271198d024caa0c8"/><file name="list.phtml" hash="b1b1d3a45f12bbe4089093d27a1cc575"/><file name="moreview.phtml" hash="a1722fdcb91f8cc555e54c8fb12ce6e6"/><file name="related.phtml" hash="e44796becd9dcae45f815f3915e4f5cc"/><file name="upsell.phtml" hash="e973ba07390da41b2756a4d914dd9c79"/></dir></dir><dir name="layout"><file name="moreview.xml" hash="7e31ba4d2594523f0c979968b601c214"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="moreview"><file name="crosssell.phtml" hash="7bc6d54dd7db3d2d271198d024caa0c8"/><file name="list.phtml" hash="b1b1d3a45f12bbe4089093d27a1cc575"/><file name="moreview.phtml" hash="a1722fdcb91f8cc555e54c8fb12ce6e6"/><file name="related.phtml" hash="e44796becd9dcae45f815f3915e4f5cc"/><file name="upsell.phtml" hash="e973ba07390da41b2756a4d914dd9c79"/></dir></dir><dir name="layout"><file name="moreview.xml" hash="7e31ba4d2594523f0c979968b601c214"/></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="moreview"><file name="crosssell.phtml" hash="8a275f83213b584828de5bec45373fb7"/><file name="list.phtml" hash="9cf6a09e7cce890af44f8e1d91e8492a"/><file name="moreview.phtml" hash="a1722fdcb91f8cc555e54c8fb12ce6e6"/><file name="related.phtml" hash="5fe32bef8fdebb69f72a51320fbfe42f"/><file name="upsell.phtml" hash="ec650cc203e0c05dff6e110198d815b6"/></dir></dir><dir name="layout"><file name="moreview.xml" hash="7e31ba4d2594523f0c979968b601c214"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="moreview.xml" hash="1e81c54dc590a17f70063a4529383a98"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sbridge_Moreview.xml" hash="7a70ff4f71a279ab47f34b46de09ec16"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="moreview.css" hash="ecc5ddad78877b293b4cce18fada5c7f"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="css"><file name="moreview.css" hash="ecc5ddad78877b293b4cce18fada5c7f"/></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="css"><file name="moreview.css" hash="ecc5ddad78877b293b4cce18fada5c7f"/></dir></dir></dir></dir></target></contents>
|
29 |
<compatible/>
|
30 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
31 |
</package>
|
skin/frontend/base/default/css/moreview.css
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @category Sbridge
|
3 |
+
* @package Sbridge_Moreview
|
4 |
+
* @author ModuleCreator
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
*/
|
7 |
+
|
8 |
+
.sbmoreview
|
9 |
+
{
|
10 |
+
opacity:0;
|
11 |
+
position: absolute;
|
12 |
+
transition: all 1s ease;
|
13 |
+
-webkit-transition:all 1s ease;
|
14 |
+
-moz-transition:all 1s ease;
|
15 |
+
-o-transition:all 1s ease;
|
16 |
+
}
|
17 |
+
.product-image:hover .sbmoreview
|
18 |
+
{
|
19 |
+
opacity:1;
|
20 |
+
}
|
21 |
+
.product-image:hover .sbview
|
22 |
+
{
|
23 |
+
opacity:0;
|
24 |
+
}
|
skin/frontend/rwd/default/css/moreview.css
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @category Sbridge
|
3 |
+
* @package Sbridge_Moreview
|
4 |
+
* @author ModuleCreator
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
*/
|
7 |
+
|
8 |
+
.sbmoreview
|
9 |
+
{
|
10 |
+
opacity:0;
|
11 |
+
position: absolute;
|
12 |
+
transition: all 1s ease;
|
13 |
+
-webkit-transition:all 1s ease;
|
14 |
+
-moz-transition:all 1s ease;
|
15 |
+
-o-transition:all 1s ease;
|
16 |
+
}
|
17 |
+
.product-image:hover .sbmoreview
|
18 |
+
{
|
19 |
+
opacity:1;
|
20 |
+
}
|
21 |
+
.product-image:hover .sbview
|
22 |
+
{
|
23 |
+
opacity:0;
|
24 |
+
}
|