futurewebs Posted October 24, 2013 Share Posted October 24, 2013 Hello, I need to add the content of one of my CMS pages into my Product Description pages (product.tpl). Can anyone give me an advice how can I do this? I think I need to edit ProductController.php but I am not sure what code I have to add and where? Any help is much appreciated. Link to comment Share on other sites More sharing options...
vekia Posted October 24, 2013 Share Posted October 24, 2013 hello you need to display this content for all product pages? and where you want to display it? Link to comment Share on other sites More sharing options...
futurewebs Posted October 24, 2013 Author Share Posted October 24, 2013 Hi Vekia, Thanks for your response. Yes it needs to be on all of the product pages, I am going to create an accordion menu and have delivery information listed in there as well as the product description. Link to comment Share on other sites More sharing options...
vekia Posted October 24, 2013 Share Posted October 24, 2013 in this case you need to modify productController.php file located in controllers/front/ directory there is a code: $this->context->smarty->assign(array( 'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'), 'customizationFields' => ($this->product->customizable) ? $this->product->getCustomizationFields($this->context->language->id) : false, 'accessories' => $this->product->getAccessories($this->context->language->id), 'return_link' => $return_link, ... ... ... ... use this: $cmspage = new CMS(4); $this->context->smarty->assign(array( 'cmspage' => $cmspage, 'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'), 'customizationFields' => ($this->product->customizable) ? $this->product->getCustomizationFields($this->context->language->id) : false, 'accessories' => $this->product->getAccessories($this->context->language->id), 'return_link' => $return_link, ... ... ... then in product.tpl page you can use $cmspage object $cmspage = new CMS(4); - you can define own page id, here you can see 4, you can use any other you want Link to comment Share on other sites More sharing options...
futurewebs Posted October 28, 2013 Author Share Posted October 28, 2013 Hi Vekia, Thanks for your help! I ended up using something very similar to what you mentioned, I added: $cmspage = new CMS(15, $this->context->language->id); And used the following in my product.tpl file: {$cmspage->content} Really appreciated your help with this! Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2013 Share Posted October 28, 2013 brilliant, your code looks very well, thank you for posting own solution i marked this topic as [solved] if you will need any additional assistance, feel free to continue this topic here with regards, Milos Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now