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
a042788e508239644175e7d0ad51b8fcfc9da71f506e9c40401cd0f3d2fe68ac:{"__metadata":{"version":0.1},"root":{"steps":[{"step_id":"b2a99540-9272-11ef-92ca-3fbe2773e2e8","step_position":[900,1100],"config_field_values":[],"task_id":"shopify::admin::order_created","task_version":"0.1","task_type":"TRIGGER","description":null,"note":null,"name":null},{"step_id":"ff8d44b0-9272-11ef-92ca-3fbe2773e2e8","step_position":[1220,1280],"config_field_values":[{"config_field_id":"input","value":"query{\n order {\n lineItems {\n product {\n handle\n }\n variant {\n position\n }\n }\n }\n}"},{"config_field_id":"script","value":"export default function main(input) {\n // Function to check adjacent variant positions\n let hasAdjacentVariants = false;\n // Group line items by product handle\n const groupedItems = input.order.lineItems.reduce((acc, item) => {\n const handle = item.product.handle;\n if (!acc[handle]) {\n acc[handle] = [];\n }\n acc[handle].push(item.variant. |
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
//Add this file to /snippets | |
{% assign is_presale_product = false %} | |
{% if product.tags contains 'pre-release' %} | |
{% assign is_presale_product = true %} | |
{% endif %} | |
<script> | |
var is_prerelease_product = "{{is_presale_product | json}}"; | |
</script> |
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
add_filter( 'woocommerce_get_price_html', 'sale_ends_banner', 100, 2 ); | |
function sale_ends_banner( $price_html, $product ){ | |
$sales_price_to = get_post_meta( $product->id, '_sale_price_dates_to', true ); | |
if( $sales_price_to ){ | |
$date_less_day = date_sub( $date, date_interval_create_from_date_string( "1 day") ); | |
$formatted_date = date( 'l jS F', $date_less_day ); | |
return $price_html."<p>Hurry! Sale Ends ".$formatted_date."</p>" ; | |
} else { | |
return $price_html; |
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
<?php | |
function olivier_customer_bought_product( $customer_email, $user_id, $product_id ) { | |
global $wpdb; | |
$transient_name = 'wc_cbp_' . md5( $customer_email . $user_id . WC_Cache_Helper::get_transient_version( 'orders' ) ); | |
if ( false === ( $result = get_transient( $transient_name ) ) ) { | |
$customer_data = array( $user_id ); | |
if ( $user_id ) { |
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
<?php | |
/** | |
* @package WPSEO\Admin | |
*/ | |
/** | |
* This class generates the metabox on the edit post / page as well as contains all page analysis functionality. | |
*/ | |
class WPSEO_Metabox extends WPSEO_Meta { |
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
<?php | |
/* | |
Plugin Name: WooCommerce Delivery Time Frame. | |
Plugin URI: http://stevenhoney.com | |
Description: Proof of concept not tested beyond a single localhost install, copy at your own risk. | |
Version: 1.0 | |
Author: Steve Honey | |
Author URI: http://stevenhoney.com | |
*/ |
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
$args = array( | |
'post_type' => 'post', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'your_taxonomy_slug' | |
), | |
), | |
); | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { |
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
$args = array( | |
'post_type' => 'post', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'your_taxonomy_slug' | |
), | |
), | |
); | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { |
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
<?php | |
/** | |
* Email Addresses | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-addresses.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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
/* Make sure you have the following in your wp-config.php | |
* define('WP_DEBUG', true); | |
* define('WP_DEBUG_LOG', true); | |
* define('WP_DEBUG_DISPLAY', false); | |
* | |
*You can then see the available variables logged in http://www.example.com/wp-content/debug.log | |
*/ | |
add_filter( 'gform_post_data', 'post_data_debugging', 10, 3 ); | |
function post_data_debugging( $post_data, $form, $entry ) { |
NewerOlder