Jump to content

Edit History

Toulousain

Toulousain


solved

Hello,
The code below allows to refresh the product reference if the customer changes the color or the size.

 

prestashop.on(
	'updatedProduct',
 	function (event) {
 		updateReference();
	}
);

function updateReference() {
    ref = $('#product-details').data("product").attributes;
    if(ref) {
    	for (var i in ref)
        	$('#reference_product').html(ref[i].reference);
  	}
}


Unfortunately the code below, which is placed in custom.js does not work on prestashop 1.7.8, we have the error :

Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')

image.png.84e09725eca0a0b3c3e0ea25675739e7.png

 

We use the following theme : http://ps.ariestheme.com/themes/sp_autostore/fr/

Would you have a solution for me ?

Could you help me to correct?

Sorry for my English and thank you in advance.

 

 

 

 

 

Toulousain

Toulousain

Hello,
The code below allows to refresh the product reference if the customer changes the color or the size.

 

prestashop.on(
	'updatedProduct',
 	function (event) {
 		updateReference();
	}
);

function updateReference() {
    ref = $('#product-details').data("product").attributes;
    if(ref) {
    	for (var i in ref)
        	$('#reference_product').html(ref[i].reference);
  	}
}


Unfortunately the code below, which is placed in custom.js does not work on prestashop 1.7.8, we have the error :

Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')

image.png.84e09725eca0a0b3c3e0ea25675739e7.png

 

We use the following theme : http://ps.ariestheme.com/themes/sp_autostore/fr/

Would you have a solution for me ?

Could you help me to correct?

Sorry for my English and thank you in advance.

 

 

 

 

 

×
×
  • Create New...