Skip to content

Instantly share code, notes, and snippets.

View fabiensebban's full-sized avatar

Fabien Sebban fabiensebban

View GitHub Profile
# This code can be used to decode the session token coming from the
# Customer UI extension: https://shopify.dev/docs/api/customer-account-ui-extensions/2024-10/apis/session-token
require 'jwt'
require 'json'
# Replace with your app's client secret from the Partner Dashboard
SHOPIFY_CLIENT_SECRET = "XXX"
# Token present in the Authorization header of the request
function applyCSS() {
const wishlistButtons = document.querySelectorAll('ooo-wl-product-card-button');
const cssStyles = `
svg {
fill: var(--ooo-wl-product-card-button-icon-color, #000);
}
`;
if (wishlistButtons) {
// Create style element
@fabiensebban
fabiensebban / move-and-style-wishlist-button-in-product-card.js
Created July 11, 2025 14:05
Move and style wishlist button in product card
// Note : this works great on Impact
function oooWishlistButtonMoveAndStyle(target) {
let wishlistButtonElement = document.querySelector("ooo-wl-access-button");
let variantPicker = document.querySelector(target);
if (wishlistButtonElement && variantPicker) {
let wishlistButtonElementDuplicate = wishlistButtonElement.cloneNode(true);
wishlistButtonElement.style.display = 'none';
@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 });
});