Jump to content

How to display CMS content page in product page


Recommended Posts

Hi all,

 

anyone know I can i display the content of a CMS page in the product page (product.tpl)

 

I'v find how can i do but not for 1.4.x version.... only for older version

 

please help me

 

thank to all

Link to comment
Share on other sites

  • 3 months later...

Hello Jagger,

 

You can modify ProductController to display page what you want.

 

Go to controllers/ProductController.php and go to line #103, you can see method process() in this place.

 

Now scroll down to line #122 before:

self::$smarty->assign('virtual', ProductDownload::getIdFromIdProduct((int)$this->product->id));

 

and add this code:

 

/** my_page **/
$my_page = new CMS(YOUR_ID_OF_PAGE, self::$cookie->id_lang);
self::$smarty->assign('my_page',$my_page);

/** END my_page **/

 

YOUR_ID_OF_PAGE replace by your page id :P

 

Now you have access to object of your page. You can use for example {$my_page->meta_title} or {$my_page->content}

 

Happy selling!

  • Like 2
Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...

Add a widget to the cms page which allows you to specify a category if you need to as well as the template.

1 // all products (it is still paginated)

2 [spam-filter]block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"[spam-filter]

3

4 // products from one category (it is still paginated) 5 [spam-filter]block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="4" template="catalog/product/list.phtml"[spam-filter]

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...