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
@media(min-width: 1000px) { | |
.mkl_pc { | |
/* Change this value to change the sidebar width */ | |
--toolbar_width: 500px; | |
} | |
} | |
.mkl_pc .mkl_pc_container .mkl_pc_toolbar section.choices .layers button { | |
white-space: normal; | |
word-break: break-word; |
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
@media(max-width: 660px) { | |
.mkl_pc .mkl_pc_container footer button.configurator-add-to-cart span { | |
display: block; | |
} | |
button.primary.button.btn.btn-primary.configurator-add-to-cart { | |
background-color: #3bb54a !important; | |
margin-right: 4px; | |
} |
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 *:not(.current_layer) { | |
opacity: 0; | |
} |
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
// Requires wp.hooks | |
// Make sure to set 'wp-hooks' and 'jquery' as dependencies when loading this script. | |
if ( ! wp || ! wp.hooks ) return; | |
( function( $ ) { | |
wp.hooks.addAction( 'PC.fe.choice.set_choice', 'Custom_domain', function( model, view ) { | |
// Do something here. | |
// view.$el will give you the jQuery object of the current choice. | |
} ); |
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 | |
/** | |
* Display the product thumbnail in order received page | |
*/ | |
function order_received_item_thumbnail_image( $item_name, $item, $is_visible ) { | |
// Targeting order received page only | |
if( ! is_wc_endpoint_url('order-received') ) return $item_name; |
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/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>' . __(' Your dress design has been added to your cart.', 'product-configurator-custom-theme') ); | |
// Prevent default notice | |
throw new Exception(); | |
}, 20, 2 ); |
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
wp.hooks.addAction( 'PC.fe.viewer.item.added', 'MKL/PC/Custom_JS', function( view, viewer ) { | |
// Set the class name | |
var layer_class = 'layer-' + view.model.get( 'layerId' ); | |
// Find the existing container. | |
var layer_container = viewer.$layers.find( '.' + layer_class ); | |
if ( ! layer_container.length ) { | |
// If the container doesn't exist, add it | |
view.$el.wrap( '<div class="' + layer_class + '" />' ); | |
} else { | |
layer_container.append( view.$el ); |
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
wp.hooks.addAction( 'PC.fe.start', 'Custom_script', function( configurator ) { | |
// Do something here. E.g.: | |
// Get the viewer | |
var viewer = configurator.viewer.$el; | |
// Get the layer container | |
var layers_container = configurator.viewer.$( '.mkl_pc_layers' ); | |
} ); |