Infinite Scroll On Custom Page Magento - magento

I have installed Strategery InfiniteScroll. Which is working great for category listing page. Now i have a custom product page. I want to apply Strategery InfiniteScroll on my custom product page. How to do.?
My Page
<?php
$_productCollection=$this->getLoadedProductCollection();
$_productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addFieldToFilter(array(array('attribute'=>'featured','eq'=>'1')));
$_productCollection->getSelect()->order('rand()');
$_productCollection->getSelect()->limit(20);
?>
//loop for products
</div>
</div>

Before you start, assure you have included .js file in your custom page.
if you see the ias.phtml template, it has some container defined.
You need to add the same code for your custom page.
For documentation of infinite ajax scroll, read this

Related

How to add custom text in front of price in the cart page?

I want to add some custom text in front of the price in the Magento cart page as shown in the image.
I found the following lines in the app\design\frontend\mydesign\default\template\checkout\cart.phtml
There is following code
<tbody>
<?php foreach($this->getItems() as $_item): ?>
<?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>
</tbody>
But how to edit this and in which file I am not getting.
Please help.
$this->getItemHtml($_item) actually loads the template file app\design\frontend\base\default\template\checkout\cart\item\default.phtml. So just copy it from base theme folder to your theme folder and modify it. The text "AUD" can be added to the <td> cell that displays the product price.
If you want to add "AUD" everywhere a price is displayed, you can go to admin and change currency symbols under System -> Manage Currency -> Symbols
when you are beginner of magento and active theme package is "rwd"
than you find product details of "<'tbody'>" on shopping cart page is below path:
C:\wamp\www\magento\app\design\frontend\rwd\default\template\checkout\cart\item\default.phtml

Joomla 3 template: php check category and show html

Joomla 3.2.1
I have a category with 26 subcategories.
In my template I want to add some code that shows 2 modules if the page is from one of the 27 categories.
I tried this code
<?php if (JRequest::getVar('view')=='categories' && JRequest::getVar('id')==30) { ?>
<div id="menu_abc">
<jdoc:include type="modules" name="menu_abc" />
</div><!-- end menu_abc -->
<?php } ?>
But that's only one category and it didn't work. The modules didn't show in that one category page (a category list page and an article in one of the subcategories).
I want the modules to show automatic only on all article pages, category list pages en category blog pages of this 27 categories.
Does someone know how to do this? It's only a small piece of code so I prefer not to use another template and cameleon or something if that's possible.

display module only on the front page of virtuemart joomla 2.5

hi i want to display module only on the front page of virtuemart and dont want that module on inner pages. i have search about this, but did not get anything.
I tried to used this code but it does not effect.
<?php if (JRequest::getVar('view')=='productdetails') { ?>
<div id="productmod"><jdoc:include type="modules" name="productdetails" /></div>
<?php } ?>
Can anyone help me to figureout this problem
Thanks In advance..
take a look on the answer, and var_dump the $menuList to get all the menus, then just get the specific menu and apply your condition..
// Get default menu - JMenu object, look at JMenu api docs
$menu = JFactory::getApplication()->getMenu();
// Get menu items - array with menu items
$menuList = $menu->getMenu();
// Look through the menu structure, once you understand it
// do a loop and find the link that you need.
var_dump($menuList);
take a look on the give link how to determine the front or default page

Magento - Display Individual Products

Is there an easy way in Magento to display individual products in a cms page without copying and pasting the code from the catalog pages?
I have a blog on my magento store and sometimes I'd like to drop the listing for individual products into the posts.
A code block in Magento is the best way to achieve this effect. If you look at your home page, that's how new products are generated dynamically:
{{block type="catalog/product_new" template="catalog/product/new.phtml"}}
If you created another block for a 'featured' item that took a product ID as a parameter, you could place that block on the static page and it would show that item. This page shows a brief example, but for the sake of being complete, I'll reproduce it here:
First create a new .phtml file with the following undercatalog/product/view/your_new_page.phtml
<?php
$productId = $this->getProduct_id();
$_product = Mage::getModel('catalog/product')->load($productId); //load the product
?>
<img src="<? echo Mage::helper('catalog/image')->init($_product, 'thumbnail')>resize(75, 75); ?>" alt="<?php echo $this->htmlEscape($_product['name']); ?>" border="0" width="75" />
Now simply add the following to your CMS Page or Block and adjust the product ID to the product Image you wish to view:
{{block type="catalog/product_new" product_id="1" template="catalog/product/view/your_new_page.phtml"}}
I'd probably tweak it a bit for readability if I used this on my store, but I'm also a bit overzealous in terms of using human-readable code. :)
If you are working on Magento 1.4, you should take a look at widgets which do exactly what you want.

Magento - showing review links & add-to-compare links on custom pages

I have a custom page as my magento homepage. It's content is hardcoded on the default CMS page (which shows if a CMS homepage isn't enabled in the CMS pages section of the admin).
I have a list of products showing there (pulled from best-selling/highest rated etc). However, the review links and the add-to-compare links don't show on this page. The list of products is displayed using the same code as the default template/catalog/product/list.phtml, and everything else works except for these 2 things.
It seems that both the following code snippets have no effect on pages other than the default category listing page:
<?php $_compareUrl=$this->getAddToCompareUrl($_product); ?>
&
<?php echo $this->getReviewsUrl() ?>
I'm guessing that there's something else that needs to be called in order for these to work, but can't figure out what it is. Everything else from the product collection is available.
I load my product collection using the following code:
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('visibility', $visibility)
$_productCollection->load();
Any ideas?
OK, so after a while digging around, I found that you can use the following to get the compare url working:
<?php $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product) ?>
<span class="addto">
<?php echo $this->__('Add to Compare') ?>
</span>
Still not sure about the review urls, but I've made an acceptable workaround for that so I'm gonna mark this as answered.
If anyone comes up with an answer though please do still post it!
I'm guessing it's because the Block that is serving up your product list may not be correct. I believe it should be Mage_Catalog_Block_Catalog_Product_List. How exactly are you loading in the list of products?

Resources