Jump to content

[SOLVED] Product attachements in cart


orelrkm

Recommended Posts

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

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

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

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...