Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php echo $this->getChildHtml('crosssell') ?>
- <block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
- <?xml version="1.0"?>
- <config>
- <modules>
- <Rkt_CrossSell>
- <active>true</active>
- <codePool>community</codePool>
- <depends>
- <Mage_Catalog />
- </depends>
- </Rkt_CrossSell>
- </modules>
- </config>
- <?xml version="1.0"?>
- <config>
- <modules>
- <Rkt_CrossSell>
- <version>1.0.0</version>
- </Rkt_CrossSell>
- </modules>
- <global>
- <helpers>
- <rkt_crossell>
- <class>Rkt_CrossSell_Helper</class>
- </rkt_crossell>
- </helpers>
- <blocks>
- <rkt_crossell>
- <class>Rkt_CrossSell_Block</class>
- </rkt_crossell>
- </blocks>
- </global>
- <frontend>
- <layout>
- <updates>
- <rkt_crossell>
- <file>rkt_crossell.xml</file>
- </rkt_crossell>
- </updates>
- </layout>
- </frontend>
- </config>
- <?php
- class Rkt_CrossSell_Block_Catalog_Product_View_Crosssell extends Mage_Checkout_Block_Cart_Crosssell
- {
- /**
- * Get crosssell items
- *
- * @return array
- */
- public function getItems()
- {
- $items = $this->getData('items');
- if (is_null($items)) {
- $items = $this->getProduct()->getCrossSellProducts();
- $this->setData('items', $items);
- }
- return $items;
- }
- }
- <?php
- class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
- {
- }
- <?xml version="1.0"?>
- <layout>
- <catalog_product_view>
- <reference name="product.info">
- <block type="rkt_crossell/catalog_product_view_crosssell" name="product.view.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml" />
- </reference>
- </catalog_product_view>
- </layout>
- <?php echo $this->getChildHtml('crosssell') ?>
- <?php if($_crossSellProducts = $_product->getCrossSellProducts()): ?>
- <div class="topproducts_containter">
- <div class="topsellerTitle">TOP <?php echo strtoupper(Mage::getModel('catalog/layer')->getCurrentCategory()->getName()); ?> PRODUCTS</div>
- <?php foreach ($_crossSellProducts as $_item): ?>
- <?php $_item = Mage::getModel('catalog/product')->load($_item->getId()); ?>
- <div class="col-sx-12 col-sm-2 items">
- <div class="img">
- <a class="product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>">
- <img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(100, 150); ?>" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
- </a>
- </div>
- <div class="name">
- <a href="<?php echo $_item->getProductUrl() ?>">
- <?php echo $this->htmlEscape($_item->getName()) ?>
- </a>
- </div>
- <div class="price">
- <?php echo $this->getPriceHtml($_item, true) ?>
- </div>
- </div>
- <?php endforeach; ?>
- <div class="clearer"></div>
- </div>
- <?php endif; ?>
- <catalog_product_view>
- <reference name="root">
- <block type="checkout/cart_crosssell" name="product.page.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
- </reference>
- </catalog_product_view>
- <?php echo $this->getBlockHtml('product.page.crosssell') ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement