Jump to content

How can I get this id_product_attribute in the product page ?


fred04

Recommended Posts

Hi,

 

I'm developing a module and I have hooked a javascript only in product pages :

	
	public function hookActionFrontControllerSetMedia($params)
	{
	    // Only on product page
	    if ('product' === $this->context->controller->php_self) {
		$this->context->controller->registerJavascript(...);
        }

this javascript contain jquery and I need to get the id_product_attribute, how can I do this ?

 

My first think was to add, with another hook (e.g displayFooterProduct) , a HTML hidden element with the id_product_attribute. It works when page load for the first time but it was not changed when user change an attribute value.

 

Is there a way with AJAX to get this information ?

 

Fred

Edited by fred04 (see edit history)
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...