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
// Always check that jQuery is available before executing the script | |
$(document).ready(function() { | |
// Execute only if the listing form exists in the page | |
if($('#listingForm').length > 0) { | |
var checkMinimumListingPrice = function() { | |
// Check if the price is equal or greater than 1 | |
if($('#ListingPrice').val() < 1) { | |
alert('Price should be equal or greater than 1'); |
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
$(document).ready(function() { | |
// Calcul price dynamically | |
if($('#listingForm').length > 0) { | |
var foreignRates = $.get('https://api.exchangeratesapi.io/latest?base=USD'); | |
var foreignExchangeFunction = function() { | |
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
$(function() { | |
if($('select#category-id').length > 0) { | |
$('select#category-id').each(function() { | |
var select = $(this), | |
groupName = 'Choose a category', | |
optgroups = select.find('optgroup'), | |
options = select.find('optgroup option'), | |
groupSelect = $('<select>'), | |
emptyGroupOption = makeOption(groupName); | |
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
// Hide the div | |
document.getElementById('bank_account_bank_account_type_div').style.display = "none"; | |
// Select the "GB" value and trigger a change to update the fields to display | |
var bank_account_bank_account_type_input = document.getElementById('bank-account-type'); | |
bank_account_bank_account_type_input.value = 'GB'; | |
bank_account_bank_account_type_input.dispatchEvent(new Event('change')); |
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
$(document).on('change', 'form#signupForm #userTypeID', function(e) { | |
var elem = $(this); | |
if(elem.val() === "group_id_1") { | |
tos_label = 'TOS group 1'; | |
} else { | |
tos_label = 'TOS group 2'; | |
} | |
$('#tosLabelMessage').empty().text(tos_label); | |
}); |
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
$(document).ready(function() { | |
// Set default location to Paris | |
if($('.homepage-body').length > 0 && $('#gmap-input-area').length > 0) { | |
$('#gmap-input-area').val('Paris'); | |
if($('#lat_search').length > 0) { | |
$('#lat_search').val('48.8485765'); | |
} | |
if($('#lng_search').length > 0) { | |
$('#lng_search').val('2.3421943'); | |
} |
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
1. Configure your homepage to load enough listings on your homepage. Let's say 100. | |
2. Update the homepage-listings snippets in the theme editor: | |
2.1. Add {% assign shuffled_listings = listings-section.listings | shuffle %} at the beginning of the snippet | |
2.2. Update the for loop to iterate on shuffled_listings instead of listings-section.listings. You can also limit the number of listing to display with the limit parameter: | |
{% for listing in shuffled_listings limit:8 %} |
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
$(document).ready(function() { | |
// Apply only on product page | |
// If the user is not logged in, we hide the price and the purchase btn, and we display a login btn | |
if($('.listing-show').length > 0 && Kr.AuthenticatedUser === null) { | |
$('.listing_details_list .price').remove(); | |
$('.add-to-cart-panel').empty(); | |
// Create a login Button | |
var loginBtn = document.createElement('a'); | |
loginBtn.href = '/login'; |
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
$(document).ready(function() { | |
// Hide the prive range filter if exists | |
if($('.price_filter_side').length > 0) { | |
$('.price_filter_side').remove(); | |
} | |
}); |
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
$(document).ready(function() { | |
// Keep only France as authorized Shipping countries | |
if($('#shipping-country').length > 0) { | |
$('#shipping-country') | |
.empty() | |
.append('<option selected="selected" value="FR">France</option>'); | |
} | |
}); |
OlderNewer