1- Open Sections/product-template.liquid and around line 198, below the variant selector, paste the following:
{% if product.options contains 'Size' %}
<a class="size-guide__link" data-action="open-size-guide" href="#size-guide">
Size guide
</a>
{% endif %}
<div id="size-guide" class="size-guide__modal mfp-hide">
{{ pages.size-guide.content }}
</div>
this._initShopifyXrLaunch();
(Should be around line 2829:)
And just below it paste the following line:
this._initProductSizeChart();
_initShopifyXrLaunch: function() {
$(document).on(
'shopify_xr_launch',
function() {
var $currentMedia = $(
this.selectors.productMediaWrapper +
':not(.' +
this.classes.hide +
')',
this.$container
);
$currentMedia.trigger('xrLaunch');
}.bind(this)
);
},
(around line 2912)
And just below paste this:
_initProductSizeChart: function() {
$('[data-action="open-size-guide"]').magnificPopup({
type:'inline',
midClick: true
});
},
.size-guide__modal {
background-color: #ffffff;
text-align: center;
padding: 20px;
max-width: 800px;
margin-left: auto;
margin-right: auto;
-webkit-box-shadow: 3px 3px 6px 0px rgba(0,0,0,0.41);
box-shadow: 3px 3px 6px 0px rgba(0,0,0,0.41);
}
.size-guide__link {
text-decoration: underline;
}