mkbond777 Posted January 31, 2015 Share Posted January 31, 2015 Hi, Is there a way to change product name (a little bit) whenever a customer selects an attribute of that product? Example: Product name : Salt Attributes: 200gm, 500gm, 1kg Attribute selected Product Name displayed 200gm Salt, pouch 500gm Salt, Jar 1kg Salt, Bootle please help if this is possible in Prestashop Thanks Link to comment Share on other sites More sharing options...
PascalVG Posted January 31, 2015 Share Posted January 31, 2015 Hi mk, This is not possible by PrestaShop by default. It needs some programming. Should the name be changed permanently, or only temporarily, on that page only? If only temporarily on that page (i.e. for informational purpose only), you probably could use some Javascript/jquery function to change the name dynamically. - You could maybe use the attribute-value metatitle field to store the addition you want to use for that attribute value. (You may have to add this metatitle to the SQL query where the attribute values are retrieved and sent to the product page, as I expect this not to be there by default) - Then add some onchange event to the attribute value select fields (radio buttons, check box or drop down boxes etc) where you call the javascript function to add/change the name. Haven't tried it, but expect something like this should work. If you want to change names permanently, I expect problems when re-using the product for other times/customers etc. as the name is then changed already... My 2 cents, pascal. Link to comment Share on other sites More sharing options...
mkbond777 Posted January 31, 2015 Author Share Posted January 31, 2015 Hi Pascal, Thanks for your suggestions and yes I want reflect these name changes temporarily on that page only. If possible, could you please let me know in which all file I need to make these changes? Thanks again Link to comment Share on other sites More sharing options...
PascalVG Posted January 31, 2015 Share Posted January 31, 2015 Javascript in themes/<your theme folder>/product.tpl. Adjustments for adding the metatitle in the attributevalues array I expect in classes/Attribute.php and maybe controllers/ProductController.php. Not sure if I forget any though... If I have time, I will give it a quick try, but please try yourself as well. Pascal. 1 Link to comment Share on other sites More sharing options...
mkbond777 Posted January 31, 2015 Author Share Posted January 31, 2015 Thanks Pascal, I will definitely try this and let you know the results. Link to comment Share on other sites More sharing options...
Pragati P Posted December 30, 2022 Share Posted December 30, 2022 On 1/31/2015 at 3:26 PM, PascalVG said: Javascript in themes/<your theme folder>/product.tpl. Adjustments for adding the metatitle in the attributevalues array I expect in classes/Attribute.php and maybe controllers/ProductController.php. Not sure if I forget any though... If I have time, I will give it a quick try, but please try yourself as well. Pascal. Hello @PascalVG I have same issue i had done some changes in displayAjaxRefresh() function and trying to display the titltle but it show blank can it possible to display the combination details which are displaying at the admin page can we show it in .tpl file below is attached screenshot. Can we show same details in front of product title in product.tpl file 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