I have made this through, it’s quite challenging.
Add Order Sample on product page using Related products
Go to admin, create a free sample product, make sure:
1. no category selected
2. name is different from the original product
3. Visibility set to Not Visisble individually
4. Price is 0 or could be any, quantity to 100 or any, Stock availability to In Stock
5. Maximum Qty Allowed in Shopping Cart so user cant order more than 1
Now go to the original product and make the free sample as related products, make sure only 1 is selected.
/app/code/core/Mage/Catalog/Block/Product/List/Related.php line 55 comment it out like below
this is because of #3 above, we dont want users to visit the detail page when added to the cart
create a template file in your theme folder
<?php if($this->getItems()->getSize()): ?>
<?php foreach($this->getItems() as $_item): ?>
<a href="<?php echo $this->getAddToCartUrl($_item) ?>"><?php echo $this->__('Order a Sample') ?></a>
<?php endforeach ?>
<?php endif ?>
open in your theme folder ..../layout/catalog.xml
put code under product view inside <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="catalog/product_list_related" name="catalog.product.related" as="sample" template="catalog/product/list/sample.phtml"/>
open in your theme folder ...../template/catalog/product/view.phtml
put this code anywhere you want:
<?php echo $this->getChildHtml('sample') ?>
If you are lost, give me a buzz, i may able to help you.