Skip to content

Instantly share code, notes, and snippets.

@melek
melek / Component Cards CSS.md
Last active March 16, 2023 01:12
WooCommerce Composite Products: Turn Stacked Components into 'Cards' with CSS

This CSS is a basic proof of concept to turn component options in Composite Products into 'Cards': image

To try this out on your site, be sure to set the 'Stacked' and 'Before tabs' layout options on your composite product: image

Once you've set up a Composite Product with those layout options, you can add the CSS to the Additional CSS area in your Customizer.

Note that this should be considered a proof of concept and a starting point, not production-ready CSS. For instance, this has no awareness of mobile device sizes.

@melek
melek / gist:4bf187bfb85faf3864069777ea6d9cc3
Created March 13, 2023 23:01
Change CTA URL for WooCommerce Gift Card Emails
<?php
add_filter('woocommerce_gc_email_received_action_button_url', 'custom_giftcard_cta_url', 10, 1);
function custom_giftcard_cta_url($url) {
return get_home_url();
}
@melek
melek / optional-force-sells.php
Last active August 26, 2022 00:06
An extension for WooCommerce Force Sells which lets a merchant make force sells optional on a product.
<?php
/**
* Plugin Name: Optional Force Sells
* Plugin URI: https://gist.github.com/melek/594d80882b4e0199a18a0c5df5baf3c7
* Description: Extends WooCommerce Force Sells by allowing force sells on a product to be optional on the single product page.
* Version: 0.1.5
* Author: Lionel Di Giacomo
* Author URI: https://github.com/melek
* License: GPL 2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@melek
melek / bacc-partial-indicators.css
Last active May 12, 2021 23:39
Bookings Accommodations Check-in Check-out CSS
/* Accommodation Booking - Check-in/Check-out indicators
https://github.com/woocommerce/woocommerce-accommodation-bookings/
This CSS is just an example. It fails in two situations:
- If the first two days of the week are booked together
- If there are adjacent 1-night bookings
This could be corrected with some clever JavaScript, but