Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • I have rolled back to version 1.1 and it seems to resolve it. Issue has arised since version 1.1.1 – hope that helps.

    I am getting the same issue. Only just updated the plugin so suspect an issue with this version? It seemed to work fine before this.

    Hello, we are getting the same issue but are not using that plugin mentioned (Sky Login Redirect). I guess I have to disable all plugins and then re-enable individually?

    Trouble is it doesn’t seem to do it every time for some reason.

    Anyone able to advise on this? I can’t figure out why it has changed?

    I have this same problem, http://www.topgear-tuning.com/dealer-network/topgear-bridport-limited/

    Am not aware of changing any settings to cause this? Running the latest version of the plugin (v 2.2.7)

    Thread Starter md2885

    (@md2885)

    Great, that works perfect, many thanks.

    Thread Starter md2885

    (@md2885)

    That works ok for me. So conflicting plugin maybe?

    Thread Starter md2885

    (@md2885)

    Hi Tijmen, I have created a custom store template (which you helped with customising in a previous post). This is an example of how I am calling and presenting the address:

    if ( $store_address = get_post_meta( $queried_object->ID, ‘wpsl_address’, true ) ) {
    $content .= ‘<p>’ . esc_html( $store_address ) . ‘
    ‘;
    }

    … is there a way I can call the phone number in this format rather than via the shortcode wpsl_address shortcode as above? I tried wpsl_phone but it didn’t appear to work.

    Thread Starter md2885

    (@md2885)

    Fixed it. Error caused by [] around second reference of $address_part on line 58 of your example. Removed those and it worked.

    Thanks for your help Tijmen. Really pleased with this plugin 🙂

    Thread Starter md2885

    (@md2885)

    That is still breaking the page for some reason? Without it, the pages works fine. Existing code (minus your suggestion above) shown below:

    <?php
    /**
     * Example of a single WPSL store template for the Twenty Fifteen theme.
     *
     * @package Twenty_Fifteen
     */
    get_header(); ?>
    
       	<div class="main_bg">
    
    	<div id="content" class="row main">
    	<div class="twelve columns">
            <main id="main" class="site-main" role="main">
                <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                   <header class="entry-header">
                        <h1 class="entry-title"><?php single_post_title(); ?></h1>
                    </header>
    				                <?php
                        global $post;
                        $queried_object = get_queried_object();
    
                        // Add the map shortcode
                        echo do_shortcode( '[wpsl_map]' );
                    ?>
    				</div>
                    <div class="four columns">
    				<h3>Address</h3>
    
    				<?php // Added wpsl-custom-address.php code here ?>
    
    				<h3>Opening Hours</h3>
    				                <?php
                        global $post;
                        $queried_object = get_queried_object();
    
    					// Add the address shortcode
                        echo do_shortcode( '[wpsl_hours]' );
    
                    ?>
                    </div>
    				<div class="eight columns">
    				                <?php
                        global $post;
                        $queried_object = get_queried_object();
    
                        // Add the content
                        $post = get_post( $queried_object->ID );
                        setup_postdata( $post );
                        the_content();
                        wp_reset_postdata( $post );
    
                    ?>
    				<h3>Contact Dealer</h3>
    				<?php echo do_shortcode('[contact-form-7 id="66" title="Dealer Page Contact Form"]');?>
    				</div>
                </article>
            </main><!-- #main -->
    		</div>
        </div><!-- #primary -->
    
    <?php get_footer(); ?>'

    Thread Starter md2885

    (@md2885)

    Ok, not sure I have got the code quite right. This is what I have pasted into single-wpsl_stores.php but when I go to navigate the page, it is broken and returning a 500 error.

    <?php
    
    				            if ( get_post_type() == 'wpsl_stores' ) {
    	                if ( empty( $queried_object->ID ) ) {
                        if ( isset( $post->ID ) ) {
    	                        $queried_object->ID = $post->ID;
                        } else {
                            return;
                        }
    	                }
    	            } else if ( empty( $queried_object->ID ) ) {
                    return __( 'If you use the [wpsl_address] shortcode outside a store page you need to set the ID attribute.', 'wpsl' );
                }
    
    				$content = '<div class="wpsl-locations-details">';
    
    if ( ['name'] && $store_name = get_the_title( $queried_object->ID ) ) {
    $content .= '<span><strong>' . esc_html( $store_name ) . '</strong></span>';
    }
    
    $content .= '<div class="wpsl-location-address">';
    
    if ( ['address'] && $store_address = get_post_meta( $queried_object->ID, 'wpsl_address', true ) ) {
         $content .= '<span>' . esc_html( $store_address ) . '</span><br/>';
    }
    
    if ( ['address2'] && $store_address2 = get_post_meta( $queried_object->ID, 'wpsl_address2', true ) ) {
                   $content .= '<span>' . esc_html( $store_address2 ) . '</span><br/>';
    }
    
    $address_format = explode( '_', $wpsl_settings['address_format'] );
    $count = count( $address_format );
    $i = 1;
    
    // Loop over the address parts to make sure they are shown in the right order.
    foreach ( $address_format as $address_part ) {
    
      // Make sure the shortcode attribute is set to true for the $address_part, and it's not the 'comma' part.
               if ( $address_part != 'comma' && [$address_part] ) {
                   $post_meta = get_post_meta( $queried_object->ID, 'wpsl_' . $address_part, true );
    
                    if ( $post_meta ) {
    
                        /*
                          * Check if the next part of the address is set to 'comma'.
                          * If so add the, after the current address part, otherwise just show a space
                          */
                          if ( isset( $address_format[$i] ) && ( $address_format[$i] == 'comma' ) ) {
                              $punctuation = ', ';
                           } else {
                             $punctuation = ' ';
                        }
    
                         // If we have reached the last item add a <br /> behind it.
                           $br = ( $count == $i ) ? '<br />' : '';
    
                         $content .= '<span>' . esc_html( $post_meta ) . $punctuation . '</span>' . $br;
                       }
                   }
    
                   $i++;
               }
    
             if ( ['country'] && $store_country = get_post_meta( $queried_object->ID, 'wpsl_country', true ) ) {
                 $content .= '<span>' . esc_html( $store_country ) . '</span>';
            }
    
                $content .= '</div>';
    
    				?>
    Thread Starter md2885

    (@md2885)

    FYI, I have already enabled the single-wpsl_stores.php template page.

    From this, I can only alter the order of the map, address and hours data via the shortcodes and can’t actually edit the formatting of the text produced by it, like I can with the wpsl_listing_template filter for the listing frontend.

    Thread Starter md2885

    (@md2885)

    It would be nice to allow people to complete the form there and then without having to go to another page to complete it. Its frustrating because I can call the specific email address dynamically, by shortcode if needed. I would have thought that there would be a way of passing this to the form as you can with elements such as the page/post title etc, but it isn’t looking as simple as that…?

    Thread Starter md2885

    (@md2885)

    Unfortunately we have over 100 dealer pages, therefore it is not feasible nor future proof to setup individual forms for each dealer.

    Still looking for a solution to solve this, I’m stumped!?

    Thread Starter md2885

    (@md2885)

    Yes, it was via one of the filters that you had listed.

    Thank you

Viewing 15 replies - 1 through 15 (of 15 total)