bedigital Posted August 16, 2016 Share Posted August 16, 2016 Hello, I would like to create two versions of the product page, a canonical version and AMP (Accelerated Mobile Page). If you access the normal-template-product.html page, use product.tpl <Link rel = "canonical" href = "https://www.example.com/normal-template-product.html"> If you access the amp-template-product.html page, use product-amp.tpl <Link rel = "amphtml" href = "https://www.example.com/amp-template-product.html"> Is possible to do this? Link to comment Share on other sites More sharing options...
Daniel Patilea Posted August 16, 2016 Share Posted August 16, 2016 Hello, I would like to create two versions of the product page, a canonical version and AMP (Accelerated Mobile Page). If you access the normal-template-product.html page, use product.tpl <Link rel = "canonical" href = "https://www.example.com/normal-template-product.html"> If you access the amp-template-product.html page, use product-amp.tpl <Link rel = "amphtml" href = "https://www.example.com/amp-template-product.html"> Is possible to do this? My first solution would be cookies. Make an override for initContent() function from ProductController.php. There you set different product templates according to the value of the cookies. Link to comment Share on other sites More sharing options...
bedigital Posted August 16, 2016 Author Share Posted August 16, 2016 (edited) Hi, Why not using a responsive theme instead ? AMP page is not just a responsive version for mobile devices. I intend to do something really simplified to have more relevance in SEO, if the customer is interested in buying the product, the button to buy will be a link to canonical version. My first solution would be cookies. Make an override for initContent() function from ProductController.php. There you set different product templates according to the value of the cookies. I can differentiate through URL? I did not understand very well your solution. Thanks useful coding ideas.. Useful for my website Thanks.. Welcome Edited August 17, 2016 by rocky (see edit history) 1 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted August 16, 2016 Share Posted August 16, 2016 My solution had nothing to do with urls, the urls are the same. Let's say you have a button on the bottom on the page called "Switch to mobile version" and if you press it it will create a cookie named "mobile" with the value "on". In the initContent() function you check if the cookie is set and use the template is required. I home this makes sense to you. You can also differentiate through url, you can simply set a variable and according to it you can play with the tpl file. Link to comment Share on other sites More sharing options...
pedepot Posted August 28, 2016 Share Posted August 28, 2016 Few content management systems are already proposing extensions to generate an AMP version of their pages. I believe that it is the best thing to do for Prestashop as well. The module could generate a new link like https://www.example.com/normal-template-product.html?amp=true. Then the module will serve the AMP content rather than the normal page using a template file product-amp.tpl. I did a similar thing for a Wordpress and Woocommerce store for a customer. However I still don't know how to notify Google and if there is a way to publish a sitemap specifically for the AMP pages. We added all the new AMP pages manually to Google Console. If you find a solution, please let me know. Best regards, Link to comment Share on other sites More sharing options...
bedigital Posted September 5, 2016 Author Share Posted September 5, 2016 Few content management systems are already proposing extensions to generate an AMP version of their pages. I believe that it is the best thing to do for Prestashop as well. The module could generate a new link like https://www.example.com/normal-template-product.html?amp=true. Then the module will serve the AMP content rather than the normal page using a template file product-amp.tpl. I did a similar thing for a Wordpress and Woocommerce store for a customer. However I still don't know how to notify Google and if there is a way to publish a sitemap specifically for the AMP pages. We added all the new AMP pages manually to Google Console. If you find a solution, please let me know. Best regards, You do not need to create a specific sitemap for AMP pages, you only need to specify within the <head> What are the canonical and amphtml links. Google will identify the versions and direct the customer to them. You did this module you mentioned? It could release it? 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