• Dear Tijmen,

    We experience a critical site error when we try to customize the store markers on the map. This happens for category markers as well as a single stores.

    This happens on a client site and on a clean installation.

    Copied code block below from your documentation and inserted into functions.php. Other customizations seem to be working fine.

    add_filter( 'wpsl_store_meta', 'custom_store_meta', 10, 2 );
    
    function custom_store_meta( $store_meta, $store_id ) {
    
        if ( function_exists( 'z_taxonomy_image_url' ) ) {
            $terms = wp_get_post_terms( $store_id, 'wpsl_store_category' );
    
            if ( $terms ) {
                if ( !is_wp_error( $terms ) ) {
                    if ( isset( $_GET['filter'] ) && $_GET['filter'] ) {
                        $filter_ids = explode( ',', $_GET['filter'] );
    
                        foreach ( $terms as $term ) {
                            if ( in_array( $term->term_id, $filter_ids ) ) {
                                $cat_marker = z_taxonomy_image_url( $term->term_id );
    
                                if ( $cat_marker ) {
                                    $store_meta['categoryMarkerUrl'] = $cat_marker;
                                }
                            }
                        }
                    } else {
                        $store_meta['categoryMarkerUrl'] = z_taxonomy_image_url( $terms[0]->term_id );
                    }
                }
            }
        }
    
        return $store_meta;
    }

    I am dutch speaking perhaps contact via e-mail would speed things up?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi there, thanks for reaching out.

    It would be very useful for us to know the contents of the server error log file when this happens.

    Sometimes it is enough to have these settings inside of your wp-config.php file to have your WordPress write the contents of the errors into a log file:

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );

    With these settings, the error should be looged in /wp-content/debug.log

    Alternatively, you can ask your hosting provider for a server error log, and we can also take a look at that to see what is causing this error.

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Critical error when customizing markers’ is closed to new replies.