jose_ugs Posted January 11, 2021 Share Posted January 11, 2021 I am trying to figure out a way and show the manufacturer name right next to the product name inside ajax-cart.js like so "manufacturer name - product name". So far i managed to get a hold of the manufacturer id via blockcart-json.tpl like so: "manufacturer_id": {$product.id_manufacturer}, But since there's no way to process the manufacturer_id inside ajax-cart.js and get the name out of it using Manufacturer::getnamebyid() i started looking for a way to pass the name itself, and not the id. It seems though this is not possible inside the blockcart-json.tpl. I tried doing it like this: "manufacturer_name": {Manufacturer::getnamebyid($product.id_manufacturer)}, This resulted in an error and i am out of ideas. Is there no way to use Manufacturer::getnamebyid inside blockcart-json.tpl? Link to comment Share on other sites More sharing options...
Prestachamps Posted January 11, 2021 Share Posted January 11, 2021 Hi, the correct name for that function is getNameById so you should try it this way: "manufacturer_name": {Manufacturer::getNameById($product.id_manufacturer)}, Kind regards, Leo Link to comment Share on other sites More sharing options...
jose_ugs Posted January 11, 2021 Author Share Posted January 11, 2021 Hi Leo, I did that too and this is the error: Link to comment Share on other sites More sharing options...
jose_ugs Posted January 11, 2021 Author Share Posted January 11, 2021 Some more details, here's he line in blockcart-json.tpl: "manufacturer_name": {Manufacturer::getNameById($product.id_manufacturer)}, And here's how i'm using it inside ajax-cart.js: content += '<div class="cart-img"><a class="cart-images" href="' + this.link + '" title="' + this.manufacturer_name + '"><img src="' + this.image_cart + '" alt="' + this.name +'"></a></div>'; 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