Jan_A.
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Piwik integration] Declaration of WC_PiwikI got he same problem:
Array ( [type] => 2 [message] => Declaration of WC_Piwik::validate_checkbox_field($key) should be compatible with WC_Settings_API::validate_checkbox_field($key, $value) [file] => */wp-content/plugins/woocommerce-piwik-integration/includes/class-wc-piwik.php [line] => 0Cheers
- This reply was modified 8 years, 3 months ago by Jan_A..
There is nothing stored in my apache log but the developer of WP-Lister found the issue. The problem is caused by the piwik woocommerce integration plugin I use so it has nothing to do with your plugin. Sorry for disturbing you.
Regards,
Jan AlthoetmarHere is the answere from wp-labs:
Hello Jan.
We have found the error which is:
last error was: Array ( [type] => 2 [message] => Declaration of WC_Piwik::validate_checkbox_field($key) should be compatible with WC_Settings_API::validate_checkbox_field($key, $value) [file] => /pages/f9/81/d0011749/home/htdocs/brune/wp-content/plugins/woocommerce-piwik-integration/includes/class-wc-piwik.php [line] => 0
The author of WC_Piwik should be able to fix that fairly quickly – just simply send that to support and they should be able to fix that no problem.
Kind regards
Forum: Plugins
In reply to: [WooCommerce Product Variations Description] function exampleHeres the code how I did it. Maybe it will help some of you.
In functions.php:function additional_information_tab_content() {
// get the product
global $product;// Get the post IDs of all the product variations
$variation_ids = $product->children;// check if we have variations
if ( empty( $variation_ids ) )
return;// walk the variations
foreach( $variation_ids as $variation_id ) {
$description = wcpvd_get_variation_description( $variation_id );
$model_name = ‘-‘.get_post_meta($variation_id, ‘attribute_pa_zustand’, true);
// echo ‘<div id=”variation-‘ . $variation_id . ‘” style=”display: none;”>’;
echo ‘<div class=”custom_variation” id=”model’ . $model_name . ‘” style=”display: none;”>’ . ‘<p>’ . $description . ‘</p>’ . ‘</div>’;
// echo ‘</div>’;
// echo $description;
}
}function additional_information_tab($tabs) {
$tabs[‘additional_information_tab’] = array(
‘title’ => __(‘Zustand’, ‘woocommerce’), // Titel des Tabs
‘priority’ => 30, // Priority
‘callback’ => ‘additional_information_tab_content’ // Funktion, die den Inhalt des Tabs anzeigt
);return $tabs;
}
add_filter(‘woocommerce_product_tabs’, ‘additional_information_tab’);function remove_tab_reviews($tabs) {
// Hide variantdescription if not exist
global $product;
$variation_ids = $product->children;
if ( empty( $variation_ids ) ){
unset($tabs[‘additional_information_tab’]);
}
return $tabs;
}
add_filter(‘woocommerce_product_tabs’, ‘remove_tab_reviews’);// Register Script
function load_scripts() {
wp_register_script( ‘additionalvariation’, get_stylesheet_directory_uri() . ‘/js/additionalvariation.js’, array( ‘jquery’ ) );
wp_enqueue_script( ‘additionalvariation’ );
}add_action(‘wp_enqueue_scripts’, ‘load_scripts’);
And the jquery code saved in ../yourtheme/js
jQuery(window).load(function(){
// get the specific select element by id #model
jQuery(‘select#pa_zustand’).change(function() {
var value = “”;// get the option that has been selected
jQuery( “select#pa_zustand option:selected” ).each(function() {
// get the value data-attribute, prepend it with “model”
value += “model-” + jQuery( this ).val();
// the variable value will now be identical to the id of one of the wrapping custom_variation divs
});// Hide all custom_variation divs
jQuery( ‘.custom_variation’).css( ‘display’, ‘none’ );
// Display only the custom_variation div witht the specific id
jQuery( ‘.custom_variation#’ + value ).css( ‘display’, ‘block’ );});
});
`I dont think its really well scripted. If someone knows something to add I’m open for ideas ??