Passing magento product name in a web...

User 2511943 Photo


Registered User
21 posts

Hi,

We are trying to combine our Magento checkout with a web form, and we would like to get the product name to pass into the form, is this possible ?
if yes, how?
User 187934 Photo


Senior Advisor
20,271 posts

I would look at JQuery to handle this. If you know the id of the element that contains the value you want to pass you should be able to load it into the form field.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2511943 Photo


Registered User
21 posts

Hi Eric,

I know the id of the element that contains the value i want to pass through.
the code snippet i was currently looking at looks like this:

<?php $productId=$this->getRequest()->getParams();  
$model = Mage::getModel('catalog/product');  
$_product = $model->load($productId["id"]);  
echo $_product->getName(); ?>

But thats PHP, not Jquery... how can i use Jquery to load the value in my form field?
User 187934 Photo


Senior Advisor
20,271 posts

Where or how is the value in Magento?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2511943 Photo


Registered User
21 posts

The code i posted before is how Magento can copy it into it's own contact form.
( which i don't want because i am using a coffeecup form. )
The value is in the database,

`..._catalog_product_flat_6` WHERE 'Name' is

'catalog_product_flat_6' is the database Table
'Name' is the field
User 187934 Photo


Senior Advisor
20,271 posts

Are you up to altering the form manually?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2511943 Photo


Registered User
21 posts

Yea, that should not be a problem.
User 187934 Photo


Senior Advisor
20,271 posts

Let me do a proof of concept and I'll post back.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,271 posts

I forgot to ask what kind of field are you trying to fill in the form?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2511943 Photo


Registered User
21 posts

Hi eric,

The name of the product a.k.a the title of the item.
It doesn't really matter in what kind of field it is shown in the form as long as its visible.
A Plain Text field or a Title/Heading field would be recommended i guess so the client can't alter it.
If that isn't possible it could just aswell be a text field or Text Area or even a Magical HTML field.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.