Cross-sell product is not showing in the product detail page

Multi tool use
In product detail page the following code is written to display the cross-sell product which are set from the admin side..<?php echo $this->getChildHtml('crosssell'); ?>
But it is not showing anything although there are cross sell products present in the admin side and the cross-sell products are instock.
I looked into its respective block i.e.
app/core/code/Mage/Catalog/Block/Product/List/Crosssell.php
and the function where the product collection is formed is as follows..
protected function _prepareData()
{
$product = Mage::registry('product');
/* @var $product Mage_Catalog_Model_Product */
$this->_itemCollection = $product->getCrossSellProductCollection()
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
->setPositionOrder()
->addStoreFilter();
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
$this->_itemCollection->load();
foreach ($this->_itemCollection as $product) {
$product->setDoNotUseCategoryId(true);
}
return $this;
}
I got nothing related to cross sell product while doing var_dump($product)
.
This is product detail layout file i.e. catalog.xml
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="head">
<action method="addJs"><script>varien/product.js</script></action>
<action method="addJs"><script>varien/configurable.js</script></action>
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
<action method="addCss"><stylesheet>css/basket.css</stylesheet></action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
<block type="page/html_pager" name="product_review_list.toolbar" />
<block type="core/template" name="product_review_list.count" template="review/product/view/count.phtml" />
<block type="review/product_view_list" name="product.info.product_additional_data" as="product_reviews" template="review/product/view/list.phtml" />
<block type="catalog/product_view" name="review_button" as="review_button" template="review/product/view/button.phtml"/>
<block type="catalog/product_view" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
<action method="setColumnCount"><columns>4</columns></action>
<action method="setItemLimit"><type>upsell</type><limit>6</limit></action>
</block>
<block type="catalog/product_list_crosssell" name="product.info.crosssell" as="crosssell" template="catalog/product/list/crosssell.phtml"/>
<block type="catalog/product_list_related" name="catalog.product.related" as="related" template="catalog/product/list/related.phtml"/>
<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
<block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
<label>Product View Extra Hint</label>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
<label>Info Column Options Wrapper</label>
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
</block>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
<label>Bottom Block Options Wrapper</label>
<action method="insert"><block>product.tierprices</block></action>
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
<action method="append"><block>product.info.addtocart</block></action>
<action method="append"><block>product.info.addto</block></action>
</block>
<block type="core/template_facade" name="product.info.container1" as="container1">
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<block type="core/template_facade" name="product.info.container2" as="container2">
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
</block>
</reference>
So how to check if there is something missing by which the crossell products are not coming ?
Is there any other method of getting crossell products ?
magento-1.7 product product-view cross-sells
add a comment |
In product detail page the following code is written to display the cross-sell product which are set from the admin side..<?php echo $this->getChildHtml('crosssell'); ?>
But it is not showing anything although there are cross sell products present in the admin side and the cross-sell products are instock.
I looked into its respective block i.e.
app/core/code/Mage/Catalog/Block/Product/List/Crosssell.php
and the function where the product collection is formed is as follows..
protected function _prepareData()
{
$product = Mage::registry('product');
/* @var $product Mage_Catalog_Model_Product */
$this->_itemCollection = $product->getCrossSellProductCollection()
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
->setPositionOrder()
->addStoreFilter();
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
$this->_itemCollection->load();
foreach ($this->_itemCollection as $product) {
$product->setDoNotUseCategoryId(true);
}
return $this;
}
I got nothing related to cross sell product while doing var_dump($product)
.
This is product detail layout file i.e. catalog.xml
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="head">
<action method="addJs"><script>varien/product.js</script></action>
<action method="addJs"><script>varien/configurable.js</script></action>
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
<action method="addCss"><stylesheet>css/basket.css</stylesheet></action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
<block type="page/html_pager" name="product_review_list.toolbar" />
<block type="core/template" name="product_review_list.count" template="review/product/view/count.phtml" />
<block type="review/product_view_list" name="product.info.product_additional_data" as="product_reviews" template="review/product/view/list.phtml" />
<block type="catalog/product_view" name="review_button" as="review_button" template="review/product/view/button.phtml"/>
<block type="catalog/product_view" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
<action method="setColumnCount"><columns>4</columns></action>
<action method="setItemLimit"><type>upsell</type><limit>6</limit></action>
</block>
<block type="catalog/product_list_crosssell" name="product.info.crosssell" as="crosssell" template="catalog/product/list/crosssell.phtml"/>
<block type="catalog/product_list_related" name="catalog.product.related" as="related" template="catalog/product/list/related.phtml"/>
<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
<block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
<label>Product View Extra Hint</label>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
<label>Info Column Options Wrapper</label>
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
</block>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
<label>Bottom Block Options Wrapper</label>
<action method="insert"><block>product.tierprices</block></action>
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
<action method="append"><block>product.info.addtocart</block></action>
<action method="append"><block>product.info.addto</block></action>
</block>
<block type="core/template_facade" name="product.info.container1" as="container1">
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<block type="core/template_facade" name="product.info.container2" as="container2">
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
</block>
</reference>
So how to check if there is something missing by which the crossell products are not coming ?
Is there any other method of getting crossell products ?
magento-1.7 product product-view cross-sells
As per as ,magento crossell product only show when your cart have items.
– Amit Bera♦
Jan 5 '16 at 8:31
@AmitBera can't it be shown in the product detail page ?
– Kishore Patra
Jan 5 '16 at 10:31
plz share layout code?
– Amit Bera♦
Jan 5 '16 at 10:33
@AmitBera I have added layout code for product detail page. Plz have a look.
– Kishore Patra
Jan 5 '16 at 10:45
add a comment |
In product detail page the following code is written to display the cross-sell product which are set from the admin side..<?php echo $this->getChildHtml('crosssell'); ?>
But it is not showing anything although there are cross sell products present in the admin side and the cross-sell products are instock.
I looked into its respective block i.e.
app/core/code/Mage/Catalog/Block/Product/List/Crosssell.php
and the function where the product collection is formed is as follows..
protected function _prepareData()
{
$product = Mage::registry('product');
/* @var $product Mage_Catalog_Model_Product */
$this->_itemCollection = $product->getCrossSellProductCollection()
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
->setPositionOrder()
->addStoreFilter();
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
$this->_itemCollection->load();
foreach ($this->_itemCollection as $product) {
$product->setDoNotUseCategoryId(true);
}
return $this;
}
I got nothing related to cross sell product while doing var_dump($product)
.
This is product detail layout file i.e. catalog.xml
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="head">
<action method="addJs"><script>varien/product.js</script></action>
<action method="addJs"><script>varien/configurable.js</script></action>
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
<action method="addCss"><stylesheet>css/basket.css</stylesheet></action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
<block type="page/html_pager" name="product_review_list.toolbar" />
<block type="core/template" name="product_review_list.count" template="review/product/view/count.phtml" />
<block type="review/product_view_list" name="product.info.product_additional_data" as="product_reviews" template="review/product/view/list.phtml" />
<block type="catalog/product_view" name="review_button" as="review_button" template="review/product/view/button.phtml"/>
<block type="catalog/product_view" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
<action method="setColumnCount"><columns>4</columns></action>
<action method="setItemLimit"><type>upsell</type><limit>6</limit></action>
</block>
<block type="catalog/product_list_crosssell" name="product.info.crosssell" as="crosssell" template="catalog/product/list/crosssell.phtml"/>
<block type="catalog/product_list_related" name="catalog.product.related" as="related" template="catalog/product/list/related.phtml"/>
<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
<block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
<label>Product View Extra Hint</label>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
<label>Info Column Options Wrapper</label>
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
</block>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
<label>Bottom Block Options Wrapper</label>
<action method="insert"><block>product.tierprices</block></action>
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
<action method="append"><block>product.info.addtocart</block></action>
<action method="append"><block>product.info.addto</block></action>
</block>
<block type="core/template_facade" name="product.info.container1" as="container1">
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<block type="core/template_facade" name="product.info.container2" as="container2">
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
</block>
</reference>
So how to check if there is something missing by which the crossell products are not coming ?
Is there any other method of getting crossell products ?
magento-1.7 product product-view cross-sells
In product detail page the following code is written to display the cross-sell product which are set from the admin side..<?php echo $this->getChildHtml('crosssell'); ?>
But it is not showing anything although there are cross sell products present in the admin side and the cross-sell products are instock.
I looked into its respective block i.e.
app/core/code/Mage/Catalog/Block/Product/List/Crosssell.php
and the function where the product collection is formed is as follows..
protected function _prepareData()
{
$product = Mage::registry('product');
/* @var $product Mage_Catalog_Model_Product */
$this->_itemCollection = $product->getCrossSellProductCollection()
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
->setPositionOrder()
->addStoreFilter();
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
$this->_itemCollection->load();
foreach ($this->_itemCollection as $product) {
$product->setDoNotUseCategoryId(true);
}
return $this;
}
I got nothing related to cross sell product while doing var_dump($product)
.
This is product detail layout file i.e. catalog.xml
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="head">
<action method="addJs"><script>varien/product.js</script></action>
<action method="addJs"><script>varien/configurable.js</script></action>
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
<action method="addCss"><stylesheet>css/basket.css</stylesheet></action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
<block type="page/html_pager" name="product_review_list.toolbar" />
<block type="core/template" name="product_review_list.count" template="review/product/view/count.phtml" />
<block type="review/product_view_list" name="product.info.product_additional_data" as="product_reviews" template="review/product/view/list.phtml" />
<block type="catalog/product_view" name="review_button" as="review_button" template="review/product/view/button.phtml"/>
<block type="catalog/product_view" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
<label>Alert Urls</label>
</block>
<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
<action method="setColumnCount"><columns>4</columns></action>
<action method="setItemLimit"><type>upsell</type><limit>6</limit></action>
</block>
<block type="catalog/product_list_crosssell" name="product.info.crosssell" as="crosssell" template="catalog/product/list/crosssell.phtml"/>
<block type="catalog/product_list_related" name="catalog.product.related" as="related" template="catalog/product/list/related.phtml"/>
<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
<block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
<block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
<label>Product View Extra Hint</label>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
<label>Info Column Options Wrapper</label>
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
</block>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</block>
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
<label>Bottom Block Options Wrapper</label>
<action method="insert"><block>product.tierprices</block></action>
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
<action method="append"><block>product.info.addtocart</block></action>
<action method="append"><block>product.info.addto</block></action>
</block>
<block type="core/template_facade" name="product.info.container1" as="container1">
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<block type="core/template_facade" name="product.info.container2" as="container2">
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
</block>
</reference>
So how to check if there is something missing by which the crossell products are not coming ?
Is there any other method of getting crossell products ?
magento-1.7 product product-view cross-sells
magento-1.7 product product-view cross-sells
edited Aug 21 '17 at 7:18


Teja Bhagavan Kollepara
2,94841847
2,94841847
asked Jan 5 '16 at 8:08


Kishore PatraKishore Patra
321621
321621
As per as ,magento crossell product only show when your cart have items.
– Amit Bera♦
Jan 5 '16 at 8:31
@AmitBera can't it be shown in the product detail page ?
– Kishore Patra
Jan 5 '16 at 10:31
plz share layout code?
– Amit Bera♦
Jan 5 '16 at 10:33
@AmitBera I have added layout code for product detail page. Plz have a look.
– Kishore Patra
Jan 5 '16 at 10:45
add a comment |
As per as ,magento crossell product only show when your cart have items.
– Amit Bera♦
Jan 5 '16 at 8:31
@AmitBera can't it be shown in the product detail page ?
– Kishore Patra
Jan 5 '16 at 10:31
plz share layout code?
– Amit Bera♦
Jan 5 '16 at 10:33
@AmitBera I have added layout code for product detail page. Plz have a look.
– Kishore Patra
Jan 5 '16 at 10:45
As per as ,magento crossell product only show when your cart have items.
– Amit Bera♦
Jan 5 '16 at 8:31
As per as ,magento crossell product only show when your cart have items.
– Amit Bera♦
Jan 5 '16 at 8:31
@AmitBera can't it be shown in the product detail page ?
– Kishore Patra
Jan 5 '16 at 10:31
@AmitBera can't it be shown in the product detail page ?
– Kishore Patra
Jan 5 '16 at 10:31
plz share layout code?
– Amit Bera♦
Jan 5 '16 at 10:33
plz share layout code?
– Amit Bera♦
Jan 5 '16 at 10:33
@AmitBera I have added layout code for product detail page. Plz have a look.
– Kishore Patra
Jan 5 '16 at 10:45
@AmitBera I have added layout code for product detail page. Plz have a look.
– Kishore Patra
Jan 5 '16 at 10:45
add a comment |
4 Answers
4
active
oldest
votes
Try this module:
File : appetcmodulesRkt_CrossSell.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Catalog />
</depends>
</Rkt_CrossSell>
</modules>
</config>
File : appcodecommunityRktCrossSelletcconfig.xml
<?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>
File : appcodecommunityRktCrossSellBlockCatalogProductViewCrosssell.php
<?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;
}
}
File : appcodecommunityRktCrossSellHelperData.php
<?php
class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
{
}
File : appdesignfrontendbasedefaultlayoutrkt_crossell.xml
<?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>
Now in your view.phtml add this code in the appropriate position
<?php echo $this->getChildHtml('crosssell') ?>
clear your cache and re-run product page.
Note: please check you have specify products cross sell for appropriate product.
I hope this will help you.
add a comment |
Have you set the cross sell products from admin?
If not then in admin panel Catalog > Manage Products > edit one product and under "Product Information > Cross-sells" section asign products as cross-sell.
After that do re-indexing and check.
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
add a comment |
if you want directly call cross-sell product then just paste below code in your view.phtml file and let me know its working or not
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
Just paste above code what ever place you want to display in view.phtml file
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
your magento version ??
– Murtuza Zabuawala
yesterday
Magento 1.9.3.0
– Black
18 hours ago
1
@Black try this code<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no templatecatalog/product/list/crosssell.phtml
– Black
16 hours ago
add a comment |
You have to add this block to your layout.xml:
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
...
Then you can render it in your template with this line:
<?php echo $this->getChildHtml('crosssell') ?>
There is also a faster way which works like this:
<?php
$_product = $this->getProduct();
echo $this->getLayout()
->createBlock('checkout/cart_crosssell')
->setProduct($_product)
->setTemplate('checkout/cart/crosssell.phtml')
->toHtml();
?>
But this is dirty and fast.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f95972%2fcross-sell-product-is-not-showing-in-the-product-detail-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this module:
File : appetcmodulesRkt_CrossSell.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Catalog />
</depends>
</Rkt_CrossSell>
</modules>
</config>
File : appcodecommunityRktCrossSelletcconfig.xml
<?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>
File : appcodecommunityRktCrossSellBlockCatalogProductViewCrosssell.php
<?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;
}
}
File : appcodecommunityRktCrossSellHelperData.php
<?php
class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
{
}
File : appdesignfrontendbasedefaultlayoutrkt_crossell.xml
<?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>
Now in your view.phtml add this code in the appropriate position
<?php echo $this->getChildHtml('crosssell') ?>
clear your cache and re-run product page.
Note: please check you have specify products cross sell for appropriate product.
I hope this will help you.
add a comment |
Try this module:
File : appetcmodulesRkt_CrossSell.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Catalog />
</depends>
</Rkt_CrossSell>
</modules>
</config>
File : appcodecommunityRktCrossSelletcconfig.xml
<?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>
File : appcodecommunityRktCrossSellBlockCatalogProductViewCrosssell.php
<?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;
}
}
File : appcodecommunityRktCrossSellHelperData.php
<?php
class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
{
}
File : appdesignfrontendbasedefaultlayoutrkt_crossell.xml
<?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>
Now in your view.phtml add this code in the appropriate position
<?php echo $this->getChildHtml('crosssell') ?>
clear your cache and re-run product page.
Note: please check you have specify products cross sell for appropriate product.
I hope this will help you.
add a comment |
Try this module:
File : appetcmodulesRkt_CrossSell.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Catalog />
</depends>
</Rkt_CrossSell>
</modules>
</config>
File : appcodecommunityRktCrossSelletcconfig.xml
<?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>
File : appcodecommunityRktCrossSellBlockCatalogProductViewCrosssell.php
<?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;
}
}
File : appcodecommunityRktCrossSellHelperData.php
<?php
class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
{
}
File : appdesignfrontendbasedefaultlayoutrkt_crossell.xml
<?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>
Now in your view.phtml add this code in the appropriate position
<?php echo $this->getChildHtml('crosssell') ?>
clear your cache and re-run product page.
Note: please check you have specify products cross sell for appropriate product.
I hope this will help you.
Try this module:
File : appetcmodulesRkt_CrossSell.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Catalog />
</depends>
</Rkt_CrossSell>
</modules>
</config>
File : appcodecommunityRktCrossSelletcconfig.xml
<?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>
File : appcodecommunityRktCrossSellBlockCatalogProductViewCrosssell.php
<?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;
}
}
File : appcodecommunityRktCrossSellHelperData.php
<?php
class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
{
}
File : appdesignfrontendbasedefaultlayoutrkt_crossell.xml
<?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>
Now in your view.phtml add this code in the appropriate position
<?php echo $this->getChildHtml('crosssell') ?>
clear your cache and re-run product page.
Note: please check you have specify products cross sell for appropriate product.
I hope this will help you.
answered Feb 17 '16 at 6:25


denish vachhanidenish vachhani
3,3151938
3,3151938
add a comment |
add a comment |
Have you set the cross sell products from admin?
If not then in admin panel Catalog > Manage Products > edit one product and under "Product Information > Cross-sells" section asign products as cross-sell.
After that do re-indexing and check.
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
add a comment |
Have you set the cross sell products from admin?
If not then in admin panel Catalog > Manage Products > edit one product and under "Product Information > Cross-sells" section asign products as cross-sell.
After that do re-indexing and check.
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
add a comment |
Have you set the cross sell products from admin?
If not then in admin panel Catalog > Manage Products > edit one product and under "Product Information > Cross-sells" section asign products as cross-sell.
After that do re-indexing and check.
Have you set the cross sell products from admin?
If not then in admin panel Catalog > Manage Products > edit one product and under "Product Information > Cross-sells" section asign products as cross-sell.
After that do re-indexing and check.
answered Jul 26 '16 at 12:57
Swapna TaruSwapna Taru
1612
1612
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
add a comment |
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
yes it is set in the admin panel and the re-indexing is also done..
– Kishore Patra
Jul 27 '16 at 7:48
add a comment |
if you want directly call cross-sell product then just paste below code in your view.phtml file and let me know its working or not
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
Just paste above code what ever place you want to display in view.phtml file
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
your magento version ??
– Murtuza Zabuawala
yesterday
Magento 1.9.3.0
– Black
18 hours ago
1
@Black try this code<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no templatecatalog/product/list/crosssell.phtml
– Black
16 hours ago
add a comment |
if you want directly call cross-sell product then just paste below code in your view.phtml file and let me know its working or not
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
Just paste above code what ever place you want to display in view.phtml file
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
your magento version ??
– Murtuza Zabuawala
yesterday
Magento 1.9.3.0
– Black
18 hours ago
1
@Black try this code<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no templatecatalog/product/list/crosssell.phtml
– Black
16 hours ago
add a comment |
if you want directly call cross-sell product then just paste below code in your view.phtml file and let me know its working or not
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
Just paste above code what ever place you want to display in view.phtml file
if you want directly call cross-sell product then just paste below code in your view.phtml file and let me know its working or not
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
Just paste above code what ever place you want to display in view.phtml file
edited Apr 19 '17 at 7:36
answered Sep 11 '16 at 2:37


Murtuza ZabuawalaMurtuza Zabuawala
12.5k73362
12.5k73362
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
your magento version ??
– Murtuza Zabuawala
yesterday
Magento 1.9.3.0
– Black
18 hours ago
1
@Black try this code<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no templatecatalog/product/list/crosssell.phtml
– Black
16 hours ago
add a comment |
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
your magento version ??
– Murtuza Zabuawala
yesterday
Magento 1.9.3.0
– Black
18 hours ago
1
@Black try this code<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no templatecatalog/product/list/crosssell.phtml
– Black
16 hours ago
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
Does not work, I tried it and nothing renders even though cross sell products are set.
– Black
Feb 15 at 17:45
your magento version ??
– Murtuza Zabuawala
yesterday
your magento version ??
– Murtuza Zabuawala
yesterday
Magento 1.9.3.0
– Black
18 hours ago
Magento 1.9.3.0
– Black
18 hours ago
1
1
@Black try this code
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
@Black try this code
<?php echo $this->getLayout()->createBlock('catalog/product_list_crosssell')->setProduct($someProductObject)->setTemplate('catalog/product/list/crosssell.phtml')->toHtml() ?>
– Murtuza Zabuawala
17 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no template
catalog/product/list/crosssell.phtml
– Black
16 hours ago
Your code cant work, I just downloaded a fresh Magento 1.9.4 and there is no template
catalog/product/list/crosssell.phtml
– Black
16 hours ago
add a comment |
You have to add this block to your layout.xml:
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
...
Then you can render it in your template with this line:
<?php echo $this->getChildHtml('crosssell') ?>
There is also a faster way which works like this:
<?php
$_product = $this->getProduct();
echo $this->getLayout()
->createBlock('checkout/cart_crosssell')
->setProduct($_product)
->setTemplate('checkout/cart/crosssell.phtml')
->toHtml();
?>
But this is dirty and fast.
add a comment |
You have to add this block to your layout.xml:
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
...
Then you can render it in your template with this line:
<?php echo $this->getChildHtml('crosssell') ?>
There is also a faster way which works like this:
<?php
$_product = $this->getProduct();
echo $this->getLayout()
->createBlock('checkout/cart_crosssell')
->setProduct($_product)
->setTemplate('checkout/cart/crosssell.phtml')
->toHtml();
?>
But this is dirty and fast.
add a comment |
You have to add this block to your layout.xml:
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
...
Then you can render it in your template with this line:
<?php echo $this->getChildHtml('crosssell') ?>
There is also a faster way which works like this:
<?php
$_product = $this->getProduct();
echo $this->getLayout()
->createBlock('checkout/cart_crosssell')
->setProduct($_product)
->setTemplate('checkout/cart/crosssell.phtml')
->toHtml();
?>
But this is dirty and fast.
You have to add this block to your layout.xml:
<catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
...
Then you can render it in your template with this line:
<?php echo $this->getChildHtml('crosssell') ?>
There is also a faster way which works like this:
<?php
$_product = $this->getProduct();
echo $this->getLayout()
->createBlock('checkout/cart_crosssell')
->setProduct($_product)
->setTemplate('checkout/cart/crosssell.phtml')
->toHtml();
?>
But this is dirty and fast.
edited 16 hours ago
answered 16 hours ago


BlackBlack
266119
266119
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f95972%2fcross-sell-product-is-not-showing-in-the-product-detail-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
kA,Mcu9PM5,mQf5D4cKPHT LUCmPZUd1ywW T,ZoF54 jB4LUE
As per as ,magento crossell product only show when your cart have items.
– Amit Bera♦
Jan 5 '16 at 8:31
@AmitBera can't it be shown in the product detail page ?
– Kishore Patra
Jan 5 '16 at 10:31
plz share layout code?
– Amit Bera♦
Jan 5 '16 at 10:33
@AmitBera I have added layout code for product detail page. Plz have a look.
– Kishore Patra
Jan 5 '16 at 10:45