Learning AMP: Adding WooCommerce Templates to AMP Website — AMPire.city

Originally published at https://ampire.city

What Will I Learn?

Requirements:

Creating AMP-Friendly WooCommerce Website

Adding WooCommerce Templates Files to Theme

1. Getting WooCommerce Template Files

Just copy paste templates folder from WooCommerce to theme’s root directory.

2. Uploading WooCommerce Template Files to Theme

Editing custom WooCommerce template files on your theme, won’t break the website, but will require a manual update from time to time.

3. Activating WooCommerce on Theme’s Functions.php

// Add Woocommerce Support function ampirecity_add_woocommerce_support() { 
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', ampirecity_add_woocommerce_support' );

Editing WooCommerce Templates

Filtering WooCommerce Pages on Global Templates

<?php if (is_woocommerce()) {
// Do this
} else {
// Do that
}; ?>

Boosing WooCommerce with AMP

Travel Blogger, Web Designer & AMP Developer | Travel & History Journal: https://www.ctdots.eu | AMP Development & Web Design Tutorials: https://ampire.city

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store