Skip to content

Instantly share code, notes, and snippets.

View andreibabor's full-sized avatar

Andrei Babor andreibabor

View GitHub Profile
@andreibabor
andreibabor / Shopify Nested sections
Created April 2, 2018 07:58
Shopify Nested sections
{% capture sidebar_content_1 %}{% section 'sidebar-1' %}{% endcapture %}
{% capture sidebar_content_2 %}{% section 'sidebar-2' %}{% endcapture %}
{% capture collection_template_content %}
{% section 'collection' %}
{% endcapture %}
{% assign collection_template_content = collection_template_content | replace: "%%SIDEBAR-1%%", sidebar_content_1 %}
{% assign collection_template_content = collection_template_content | replace: "%%SIDEBAR-2%%", sidebar_content_2 %}
@andreibabor
andreibabor / Shopify capture date from settings and display it if one value is correct
Created April 3, 2018 09:47
Shopify capture date from settings and display it if one value is correct
{% capture handles %}{{section.settings.handles}}{% endcapture %}
{% assign handles1 = handles | split: ',' %}
{% for tag in handles1 %}
{% if collection.handle contains tag %}
{% endif %}
{% break %}
@andreibabor
andreibabor / collection.multy.liquid
Created April 24, 2018 06:49
Shopify multipleCollections template
//info collection.multy.liquid = template
//product-loop-multiple.liquid = snippet
{% include "bl-constants" %}
{% include 'breadcrumbs' %}
<div class="row">
{% assign sidebar_on = false %}
{% if settings.sidebar_linklist_1 != blank %}
{% assign sidebar_on = true %}
@andreibabor
andreibabor / Shopify discounts display
Last active May 4, 2018 07:14
Shopify discounts display
css file
.compare-at-span{
display: inline-block !important;
float: left !important;
margin-left: 0 !important;
.money{
color: #ddd;
text-decoration: line-through;
font-size: 15px;
@andreibabor
andreibabor / WP acf loop repeater rows so 2 in a div and then next 2 more in a div
Created May 4, 2018 08:29
WP acf loop repeater rows so 2 in a div and then next 2 more in a div
<div class="homepage-image-grid reverse-hover">
<!-- check if the repeater field has rows of data -->
<?php if( have_rows('images-group','options') ): ?>
<!-- add a counter -->
<?php
$count = 0;
$group = 0;
?>
@andreibabor
andreibabor / App: SaFerVPN change VPN differenet locations
Created May 7, 2018 08:24
App: SaFerVPN change VPN diffrenet locations
https://www.safervpn.com/
function searchfilter($query) {
if ($query->is_search && !is_admin() ) {
if(isset($_GET['post_type'])) {
$type = $_GET['post_type'];
if($type == 'book') {
$query->set('post_type',array('book'));
}
}
}
return $query;
@andreibabor
andreibabor / Shopify Forcing redirect script to other website,page
Created May 29, 2018 07:36
Shopify Forcing redirect script to other website/page
{% if collection.handle == 'all' or product.handle == 'eagle-energy-1-pack' or product.handle == 'eagle-energy-3-pack' or product.handle == 'eagle-energy-10-pack' %}
<script type="text/javascript">
//Begin Get a customer's location
jQuery.ajax( {
url: '//freegeoip.net/json/',
type: 'POST',
dataType: 'jsonp',
success: function(location) {
// If the visitor is browsing from US.
if (location.country_code === 'JP') {
@andreibabor
andreibabor / Shopify Checkout page Info
Last active September 13, 2018 10:08
Shopify Checkout page Info
https://www.youtube.com/user/howtoshopify/videos?app=desktop = video despre shopify
https://onlygrowth.com/blogs/posts/customizing-your-checkout-page-with-shopify-plus = customize Checkout page
https://sufio.com/articles/shopify/taxes/vat-eu-shopify/vat-exempt-eu/checkout-page/ = Capture VAT numbers on Checkout page
https://outofthesandbox.com/blogs/shopify-theme-blog/customize-shopify-checkout-pages = Secrets to tweaking and customizing Shopify checkout pages
https://onlygrowth.com/blogs/posts/how-merchants-are-flexing-shopify-plus-to-create-fully-customized-checkout-experiences = Shopify Plus To Create Fully Customized Checkout Experiences
@andreibabor
andreibabor / Wordpress: Grab content from other page
Last active July 30, 2018 10:11
WP: Grab content from other page
<div id="top">
<?php
// query for the agents page
$your_query = new WP_Query( 'pagename=agents' );
// "loop" through query (even though it's just one page)
while ( $your_query->have_posts() ) : $your_query->the_post();
the_title('<h1>', '</h1>');
the_content();
endwhile;