Skip to content

Instantly share code, notes, and snippets.

@andreibabor
andreibabor / index
Created November 23, 2022 12:49
Shopify: IP detect and redirects to other domains
<script>
//begin my custom ip redirect
//Let's check if we have the value in localstorage
if (localStorage.getItem('country')) {
//Already have the value in localStorage, no need to make a call to IPinfo
// window.location.href = '/welcome?country=' + localStorage.getItem('country')
console.log(data.country);
} else {
// No cached data, let's get it from IPinfo
@andreibabor
andreibabor / Yotpo Shopify Don't show reviews when a product doesn't have any
Last active March 3, 2022 09:00
Shopify - Yotpo Don't show reviews when a product doesn't have any
<div class="yotpo bottomLine"
data-product-id="{{ product.id }}"
data-name="{{ product.title }}">
</div>
<style>
@keyframes nodeInserted {
from {
outline-color: #fff;
}
@andreibabor
andreibabor / css-limit-words.txt
Last active September 14, 2021 09:45
Css limit words
display: -webkit-box;
font-size: 14px;
line-height: 1.4em;
overflow: hidden;
text-align: center;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
margin: 0 0 10px 0;
.snize-description{
overflow: hidden;
text-overflow: ellipsis;
white-space: initial;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
height: 38px;
}
@andreibabor
andreibabor / Wordpress Update Database from shell comand promp
Last active October 11, 2021 16:22
Wordpress Update Database from shell comand promp
Open Putty
Insert Shared IP Address take it from Cpanel Ex:67.225.255.208
login with FTP credentials
Insert db to the public_html folder
add this command
mysql -u otechcheckmatepr_staging -h localhost -p otechcheckmatepr_staging < public_html/staging/otechcheckmatepr_staging.sql
You just have to replace SQL_FILE_PATH with the file name along with the relative or absolute path
or
Try replacing localhost with 127.0.0.1
the password to login is this one /** MySQL database password */ take it from wp-config and not FTP password
@andreibabor
andreibabor / alphabet-navigation.liquid
Last active April 12, 2021 08:22
Shopify: Alphabet Navigation
<section class="section">
<div class="container">
<div class="one-whole column">
<div class="navcover">
{% for block in section.blocks %}
<div class="cmsnav gri{{forloop.index}}">
{% if block.settings.menu != blank %}
<h6>{{ linklists[block.settings.menu].title }}</h6>
@andreibabor
andreibabor / Shopiy: Create A new template for Account Customers
Last active June 4, 2020 14:45
Shopiy: Create A new template for Account Customers
1. Save account.liquid in account.virtual-show-room.liquid
2. Update account.virtual-show-room.liquid
3. Access account?view=virtual-show-room
@andreibabor
andreibabor / BigCommerce Stencil developing locally - ?debug=context
Last active June 2, 2020 14:05
BigCommerce Stencil developing locally - ?debug=context
If you are developing locally, you can append ?debug=context to the end of your URL (for example: localhost:3000?debug=context) to see all the properties you have access to.
?debug=context and ?debug=bar
@andreibabor
andreibabor / BigCommerce - OR conditional logic Stencil
Last active May 11, 2020 08:10
BigCommerce - OR conditional logic Stencil
{{#or (if customer.customer_group_name '===' 'Dealer') (if customer.customer_group_name '===' 'Wholesale')}}
<<YOUR CODE - This code only show if any of above condition return TRUE >>
<div>You get an awesome discount!</div>
{{/or}}
@andreibabor
andreibabor / BigCommerce Stencil: show first 3 products and then a new section using the last products
Created November 14, 2019 12:26
BigCommerce Stencil: show first 3 products and then a new section using the last products
<ul class="productGrid">
{{#each products }}
{{#if @index '<=' 2 }}
<li class="product">
{{>components/products/card show_compare=../show_compare show_rating=../settings.show_product_rating theme_settings=../theme_settings customer=../customer setting_show = ../settings}}
</li>
{{/if}}
{{/each}}
</ul>