Skip to content

Instantly share code, notes, and snippets.

View ronipl's full-sized avatar
🏠
Working from home

roni ronipl

🏠
Working from home
View GitHub Profile
@ronipl
ronipl / cart-featured-items.liquid
Last active August 24, 2019 14:04
Display related product based on cart item
var product_id = {{product.id}};
var key = 'asdasdasdasd';
$.get('https://api.yotpo.com/v1/widget/'+key+'/products/'+product_id+'/reviews.json', function(data){
var reviews = data.response.reviews;
//console.log(reviews);
//console.log(reviews.length);
if(reviews.length != 0){
$('#where-to-append').append(
`<div class="container">
<p>${obj.content}</p>
</div>`
);
<section class="home-our-products hop">
<div class="container-fluid">
<div class="row">
{% if section.settings.title != blank %}
<div class="section-header text-center">
<h2>{{ section.settings.title | escape }}</h2>
</div>
{% endif %}
function loadmoreByButton(){
//var moreButon = $('#more').last();
var nextUrl = $('.more').attr("link");
$('body').on('click', '.more', function(){
$.ajax({
url: nextUrl,
@ronipl
ronipl / shopify-infinite-scroll-loadmore.js
Created May 30, 2019 13:46
Shopify infinite scroll load more
// Shortcircuit variable
let triggered = false;
function ScrollExecute() {
// Locate loadmore button
let moreButon = $('#more').last();
// Get URL from the loadmore button
let nextUrl = $(moreButon).find('a').attr("href");
console.log(nextUrl);
@ronipl
ronipl / Shopify section - Text and image side by side
Last active April 15, 2019 10:13
Shopify section - Text and image side by side *classes works on testament theme. just remove classes
<section id="text-and-image-side-by-side-{{ section.id }}" class="text-and-image-side-by-side index-section" data-section-id="{{ section.id }}" data-section-type="image-section">
<div class="row">
<div class="desktop-6 tablet-2 mobile-2">
<h2>{{section.settings.heading}}</h2>
<div class="h2-border"></div>
<p>{{section.settings.content}}</p>
<div class="cta">
<a href="{{section.settings.button_url_link}}">{{section.settings.button_text}}</a>
</div>
</div>
@ronipl
ronipl / Shopify section - Gallery Carousel section.txt
Last active April 15, 2019 10:13
Shopify section - Gallery Carousel section *classes works on testament theme. just remove classes
@mixin w1580 {
@media only screen and (max-width: 1580px) {
@content;
}
}
@mixin w1480 {
@media only screen and (max-width: 1480px) {
@content;
}
/*
* Load more post
*/
var ajaxurl = "<?php echo admin_url( 'admin-ajax.php' ); ?>";
var page = 2;
jQuery(function($) {
$('body').on('click', '.loadmore', function() {
var data = {
'action': 'load_posts_by_ajax',
'page': page,