This file contains hidden or 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 | |
// This code should be added to the functions.php file of the child theme | |
// Add custom info to Additional Information product tab | |
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
global $product; | |
$tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below | |
return $tabs; | |
} |
This file contains hidden or 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 ( $, window, document, undefined ) { | |
$( '.composite_data' ) | |
.on( 'wc-composite-initializing', function( event, composite ) { | |
var l = composite.api; | |
var step_objects = l.get_steps(); | |
var review_step = l.get_step_by( 'id', 'review' ); | |
var result = $.grep(l, function(e){ return e.id == id; }); | |
//console.log(step_objects); |
This file contains hidden or 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
"use strict"; | |
(function ($) { | |
/** | |
* Detects all component attributes that have only a single value option and adds the '.single-choice' class | |
* to the respective table row. Additionally, a <span> with the class '.single-choice-label' is added, containing | |
* the options name. | |
* | |
* If executed twice, the previous changes are reverted first (in order to account for possible scenario changes). | |
* Default values or previous selections are saved and restored if the option becomes available again. |
This file contains hidden or 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 | |
// Change the description tab title to product name | |
add_filter( 'woocommerce_product_tabs', 'wc_change_product_description_tab_title', 10, 1 ); | |
function wc_change_product_description_tab_title( $tabs ) { | |
global $post; | |
if ( isset( $tabs['description']['title'] ) ) | |
$tabs['description']['title'] = $post->post_title; | |
return $tabs; | |
} |
This file contains hidden or 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
require 'mini_magick' | |
class ImageResizer | |
attr_accessor :height, :width, :padding, :stretch, :grayscale | |
def initialize(path) | |
@image = MiniMagick::Image.open(path) | |
end |