Skip to content

Instantly share code, notes, and snippets.

View fabiensebban's full-sized avatar

Fabien Sebban fabiensebban

View GitHub Profile
@fabiensebban
fabiensebban / footer.liquid
Created June 3, 2025 16:52
Wishlist Power on Impact - header icon with count bubble
@fabiensebban
fabiensebban / wishlist-power-share-button-style.js
Created May 12, 2025 09:20
Copie add to cart button style to share wishlist button
// Wishlist Power share button style
document.addEventListener('DOMContentLoaded', () => {
const callback = () => {
let wishlistPowerShareButtonButton = document.querySelector(".ooo-wl-share-button");
let wishlistPowerAddToCartButton = document.querySelector('ooo-wl-button-add-to-cart')?.querySelector('button');
if (wishlistPowerShareButtonButton && wishlistPowerAddToCartButton) {
wishlistPowerShareButtonButton.classList.remove('ooo-wl-share-button');
wishlistPowerShareButtonButton.classList.add('button', 'button-primary', 'ooo-wl-button');
@fabiensebban
fabiensebban / wishlist-power-move-wishlist-button-in-product-page.js
Created May 6, 2025 08:40
WISHLIST POWER - Move the wishlist button to another location in the product page
// Add this code in the <script> tag of the footer.liquid file
// Wishlist Power button in product card
let wishlistPowerButton = document.querySelector("ooo-wl-access-button");
if (wishlistPowerButton){
document.querySelector(".product-info__block-item[data-block-id=\"title\"]")?.appendChild(wishlistPowerButton)
}
class BulkOperationMutation < ApplicationService
STAGE_UPLOAD_MUTATION = <<~'QUERY'
mutation($input: [StagedUploadInput!]!) {
stagedUploadsCreate(input: $input) {
stagedTargets {
url
resourceUrl
parameters {
name
value
@fabiensebban
fabiensebban / en.json
Last active April 25, 2025 09:13
wishlist-power-fine-tune-language
"apps": {
"wishlist": {
"empty": {
"title": "Empty wishlist",
"description": "You have no products in your wishlist",
"link": "Start shopping"
},
"share": {
"title_without_name": "Shared wishlist",
// This snippet hides the add to cart and selector from the wishlist page
document.addEventListener('DOMContentLoaded', () => {
const callback = () => {
Array.from(document.querySelectorAll('ooo-wl-select-option')).forEach((item) => item.style.display = 'none');
Array.from(document.querySelectorAll('ooo-wl-button-add-to-cart')).forEach((item) => item.style.display = 'none');
}
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, { attributes: true, childList: true });
});
@api_version = "2024-07"
@store_url = "TODO"
@api_key = "TODO"
@password = "TODO"
def graphql_request(query, variables = {})
query = { query: query, variables: variables }.to_json unless variables.empty?
url = URI.parse("https://#{@store_url}/admin/api/#{@api_version}/graphql.json")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
@fabiensebban
fabiensebban / csv-to-json.php
Created August 28, 2023 14:37
CSV to JSON PHP
/*
File in mydata.csv is formatted as follow:
key1/key2,"value1"
key1/key2/key3,"value2"
key1/key2/key4,"value2"
*/
$file = fopen("mydata.csv", "r");
$data = fgetcsv($file);
@fabiensebban
fabiensebban / check_env_variable.rb
Created June 6, 2023 18:16
This script checks if SSM variables declared in the `template.yaml` file exist. If they do not exist, this script will create it for you.
require 'aws-sdk-ssm'
module Tasks::CheckEnvVariables
AVAILABLE_ENVS = %w[qa production].freeze
def self.perform
template = YAML.load_file('./template.yaml')
ssm_client = Aws::SSM::Client.new(
region: 'eu-west-3',
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])