This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddType x-httpd-php54 .php | |
Options +FollowSymLinks | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^olddomain.com [NC] | |
RewriteRule ^(.*)$ http://www.olddomain.com/$1 [L,R=301,NC] | |
RedirectMatch 301 ^(.*)$ http://newdomain.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- here we're going to add a blog loop to the homepage of a shopfy store --> | |
<!-- quite simple - this is raw output --> | |
<!-- here i'm setting limit to 2 posts and it's from the default "news" blog --> | |
<!-- if there's a featured image we'll use that - else we'll use the first image of the post --> | |
<!-- you'll need to add additional markup for display based on your theme. --> | |
{% for article in blogs.news.articles limit:2 %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- here we're going to add a % discount which is a calculation of the sale and product price --> | |
<!-- quite simple - capture the value and then display it --> | |
<!-- see newer version at end --> | |
<!-- capture the % discount --> | |
{% capture discount %} | |
{{ product.compare_at_price_max | minus:product.price | times:100 | divided_by:product.compare_at_price_max }}% <!-- percentage maths --> | |
{% endcapture %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- here there's a simple example wwith a radio with field id features_website - 2 options --> | |
<?php $var = get_field('features_website'); ?> | |
<?php if( $var == 'web' ){ ?> | |
<p>It's a website...</p> | |
<?php } else if( $var == 'ecommerce' ){ ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %}Here we send a user straight to the checkout after adding a product to the cart - bypassing the cart - useful where we don't want to set up ajax or streamline the experience{% endcomment %} | |
<form action="/cart/add" method="post" enctype="multipart/form-data" id="add-to-cart-form"> | |
{% comment %} nest this within the form{% endcomment %} | |
<input type="hidden" name="return_to" value="/checkout" /> | |
// product form fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ADD CLASS .flexbox-container TO PARENT - JOB DONE */ | |
.flexbox-container { | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-ms-flex-align: center; | |
-webkit-align-items: center; | |
-webkit-box-align: center; |