0

I have integrated WordPress into the Magento for the Blog. Now, I want to display Magento products from the specific category on the blog page. How can I achieve this?

2

Assuming you're using the Fishpig extension, you should just be able to add them using shortcodes e.g.

[product id="4"]
[product ids="4,8,12,16"]
[product sku="your-product-sku"]
0

I have got the answer myself.

Step1: I created a php file on the root folder.

Step2: Get products from the specific category.

Step3: Call the file in the WordPress homepage.

<?php 
$theme_root = get_theme_root();
$theme_root;
$path = '/var/www/html/headsupfortails/blogrelatedproduct.php';
include($path);
?>

Step4: override mage/core/functions.php

change the code:

function __()
{
    return Mage::app()->getTranslator()->translate(func_get_args());
}

to

if(!function_exists('__'))
{
function __()
{
    return Mage::app()->getTranslator()->translate(func_get_args());
}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.