Jump to content

Pass Manufacturer name to the ajax-cart.js on PS1.6


Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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>';

 

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More