Jump to content

2 different product template version


Recommended Posts

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


 

If you access the amp-template-product.html page, use product-amp.tpl


 

Is possible to do this?

Link to comment
Share on other sites

 

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
 
If you access the amp-template-product.html page, use product-amp.tpl
 
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

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 by rocky (see edit history)
  • Like 1
Link to comment
Share on other sites

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

  • 2 weeks later...

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

  • 2 weeks later...

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

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...