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 | |
add_filter( 'wp_get_attachment_image', function( $html, $attachment_id, $size, $icon, $attr ) { | |
global $product; | |
static $doing_filter = false; | |
if ( $doing_filter ) return $html; | |
if ( ! isset( $_REQUEST[ 'load-preset' ] ) ) return $html; | |
$doing_filter = true; | |
$post = get_post( (int) $_REQUEST[ 'load-preset' ] ); |
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
.mkl_pc .mkl_pc_container .mkl_pc_viewer .mkl_pc_layers img.bezel:not(.active) { | |
transform: translateX(calc(-50% - 300px)) translateY(-50%); | |
} | |
.mkl_pc .mkl_pc_container .mkl_pc_viewer .mkl_pc_layers img.bezel.active ~ img.bezel:not(.active) { | |
transform: translateX(calc(-50% + 300px)) translateY(-50%); | |
} |
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 | |
// Add a filter to the price, adding 'From ' to the price of a configurable product | |
add_filter( 'woocommerce_get_price_html', 'mkl_add_price_prefix', 20, 2 ); | |
function mkl_add_price_prefix( $price, $product ) { | |
if ( ! function_exists( 'mkl_pc_is_configurable' ) || ! mkl_pc_is_configurable( $product->get_id() ) ) return $price; | |
return 'À partir de ' . $price; | |
} |
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
/* CREATE YOUR MAKI OR DONBURI */ | |
.donburi-builder .mkl_pc .mkl_pc_container .mkl_pc_viewer { | |
display: none; | |
} | |
.donburi-builder .mkl_pc { | |
--toolbar_width: 100%; | |
--mkl_pc_color-toolbar_bg: #fafbfc; | |
--mkl_pc_color-primary: rgb(175 78 43); | |
--mkl_pc_color-primary_rgb: 175, 78, 43; |
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
.theme-botiga .mkl_pc .mkl_pc_container .form.form-cart .quantity { | |
width: auto; | |
display: inline-flex; | |
} | |
@media (max-width: 660px) { | |
.theme-botiga .mkl_pc .mkl_pc_container .form.form-cart .quantity { | |
height: 46px; | |
margin: 0; | |
margin-right: 5px; |
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 | |
add_action( 'mkl_pc_is_loaded', function() { | |
remove_filter( 'woocommerce_get_item_data', array( mkl_pc( 'frontend' )->cart, 'wc_cart_get_item_data' ), 10 ); | |
}); | |
add_filter( 'mkl_pc_cart_item_choice', function( $cc ) { | |
return ''; | |
} ); |
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 | |
/** | |
* Filters the REST response for shop order object | |
*/ | |
add_filter( 'woocommerce_rest_prepare_shop_order_object', function( $response ) { | |
if ( ! function_exists( 'mkl_pc' ) ) return $response; | |
$configurator = null; | |
if ( ! isset( $response->data['line_items'] ) ) return $response; |
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_action( 'tmpl-pc-configurator-choice-item--after', 'hexatac_add_choice_out_of_stock_label' ); | |
function hexatac_add_choice_out_of_stock_label() { | |
echo ' <# if ( data.manage_stock && \'none\' !== data.manage_stock && 0 >= data.stock ) { #> | |
<# if ( data.wc_backorder && "yes" == data.wc_backorder ) { #> | |
<span class="out-of-stock backorder">Sur commande</span> | |
<# } #> | |
<# } else if ( data.manage_stock && \'none\' !== data.manage_stock && 0 < data.stock ) { #> | |
<span class="out-of-stock en-stock">En stock</span> | |
<# } #>'; | |
} |
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 | |
// Prevent the linked items to be removed automatically when removing the main product | |
add_filter( 'mkl_pc/remove_linked_items', '__return_false' ); | |
// Remove the configurable item from the cart, if the linked items were added to the cart. | |
add_action( 'mkl_pc/added_linked_product_to_the_cart', function( $cart_item_key, $product_id ) { | |
WC()->cart->remove_cart_item( $cart_item_key ); | |
// Add custom notice | |
wc_add_notice( '<a href="' . esc_url( wc_get_cart_url() ) . '" class="button wc-forward">' . esc_html__( 'View cart', 'woocommerce' ) . '</a>' . ' Din kjole design er blevet tilføjet til din kurv.' ); | |
// Prevent default notice |
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 | |
add_filter( 'woocommerce_get_item_data', 'wall_display_custom_item_data', 10, 2 ); | |
function wall_display_custom_item_data( $cart_item_data, $cart_item ) { | |
$product = $cart_item['data']; | |
$attributes = wall_format_attributes( $product ); | |
if ( ! $attributes ) { | |
return $cart_item_data; | |
} |
NewerOlder