orelrkm Posted February 13, 2020 Share Posted February 13, 2020 (edited) Hey, Is there a way in Prestashop 1.7.6.3 to display attachement files in the cart page ? I tried to use the same code as in product.tpl but it is not working. Attachements are null. There is surely something I don't understand. Edited February 14, 2020 by orelrkm (see edit history) Link to comment Share on other sites More sharing options...
orelrkm Posted February 13, 2020 Author Share Posted February 13, 2020 1 minute ago, ndiaga said: Hi, In that part the product don't call the attachement file. You have to call it by using the product id. I thought about that but how can I manage to do it ? Link to comment Share on other sites More sharing options...
orelrkm Posted February 13, 2020 Author Share Posted February 13, 2020 10 minutes ago, ndiaga said: Try this code: {assign var=attachment value=Product::getAttachmentsStatic((int)$id_lang, $product.id_product) } Of course you should have the $id_lang in the template already if not call it. Sorry but what do you mean by "in the template" Link to comment Share on other sites More sharing options...
orelrkm Posted February 13, 2020 Author Share Posted February 13, 2020 9 minutes ago, ndiaga said: The file you said here : "Attachements are null. There is surely something I don't understand." in that file you are editing . yes I mean how do I know if $id_lang is in the template ? I use classic/default theme. Is is by default in or have I something to do ? How can i call it ? Link to comment Share on other sites More sharing options...
orelrkm Posted February 14, 2020 Author Share Posted February 14, 2020 15 hours ago, ndiaga said: Learn by doing. I managed to do it by adding $id_lang to Smarty value in CartController.php in initContent() : $this->context->smarty->assign([ 'cart' => $presented_cart, 'static_token' => Tools::getToken(false), 'id_lang' => $this->context->language->id ]); Thank you very much ! 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