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_toolbar section.choices .layer_choices li.layer-choices-title > span a.close::before, | |
.mkl_pc .mkl_pc_container .mkl_pc_toolbar section.choices .layer_choices li.layer-choices-title > span a.close::after { | |
width: 15px; | |
transform-origin: 100%; | |
} | |
.mkl_pc .mkl_pc_container .mkl_pc_toolbar section.choices .layer_choices li.layer-choices-title > span a.close::after { | |
transform: translateX(8px) rotate(35deg); | |
} |
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( 'mkl_pc_get_configurator_data_js_output', function( $js, $id, $data ) { | |
if ( class_exists( 'GTranslate' ) && is_user_logged_in() && current_user_can( 'edit_posts' ) ) { | |
$output = 'var PC = PC || {};'."\n"; | |
$output .= 'PC.productData = PC.productData || {};'."\n"; | |
// Add compatibility with GTranslate premium, enabling users to manually update translations. | |
$output .= "fetch('/wp-admin/admin-ajax.php?action=pc_get_data&data=init&fe=".$_REQUEST['fe']."&id={$id}&ver=".time()."').then(r => r.json()).then(data => {PC.productData.prod_$id = data;});"; | |
return $output; | |
} |
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_toolbar section.choices ul.layer_choices:not(.display-mode-dropdown) { | |
display: block !important; | |
} | |
.mkl_pc .mkl_pc_container .mkl_pc_toolbar section.choices .layers button.layer-item::after{ | |
display: none; | |
} | |
.mkl_pc .mkl_pc_container .mkl_pc_toolbar section.choices .layers button.layer-item::before{ | |
width: calc( 100% - 1em); |
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( "woe_fetch_order_products", function ($products, $order, $labels, $format, $static_vals) { | |
foreach( $order->get_items('line_item') as $pos => $item) { | |
if ( $config_data = $item->get_meta( '_configurator_data' ) ) { | |
foreach( $config_data as $selection ) { | |
// Get the item name. E.g. Farve, or Vaelg overdel | |
$layer_name = $selection->get_layer( 'name' ); | |
// Get the item's selected choice. E.g. Lady top loose | |
$choice_name = $selection->get_choice( '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 | |
// Filter the data in the cart / checkout | |
add_filter( 'mkl_pc/wc_cart_get_item_data/choice', function( $choice_data, $layer ) { | |
$parent_id = $layer->get_choice( 'parent' ); | |
if ( $parent_id && is_callable( [ $layer, 'get_choice_by_id' ] ) ) { | |
$parent = $layer->get_choice_by_id( $parent_id ); | |
if ( $parent && isset( $parent[ 'name' ] ) ) { | |
$choice_data['value'] = $parent[ 'name' ] . ', ' . $choice_data['value']; | |
} | |
} |
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( 'woocommerce_before_cart', function() { | |
WC()->cart->calculate_totals(); | |
} ); |
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 | |
/** | |
* Get the hex colors from a product's configurator data | |
* | |
* @param int $product_id | |
* @return array | |
*/ | |
function get_product_colors_from_configuration( $product_id ) { | |
$colors = []; |
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 .mkl-pc-show-form { | |
display: none; | |
} | |
.mkl_pc .mkl_pc_container footer .form.form-cart { | |
position: relative; | |
padding: 0; | |
background: transparent; | |
box-shadow: none; | |
border-radius: 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
@media (max-width: 660px) { | |
.mkl_pc .mkl_pc_container .mkl-pc-show-form { | |
display: none; | |
} | |
.mkl_pc .mkl_pc_container footer .form.form-cart { | |
position: relative; | |
padding: 0; | |
background: transparent; | |
box-shadow: none; | |
border-radius: 0; |