Fixed the links to WooCommerce pages
authorLaury GvR <laury@gaslightmedia.com>
Tue, 1 Nov 2016 17:41:58 +0000 (13:41 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 1 Nov 2016 17:41:58 +0000 (13:41 -0400)
These links were using IDs, but should have been using the
woocommerce functions to get the appropriate URLs.

woocommerce.php

index 9145a2a..a7486b8 100644 (file)
                                 </div>
                                 <div id="woo-quick-checkout" class="small-4 columns right">
                                     <?php
+                                        $myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
                                         if (is_user_logged_in()) { 
-                                            echo '<a href="'. get_permalink($myaccount_page_id) . '?customer-logout=true" class="button login_toggle">log out</a>';
+                                            echo '<a href="'. get_permalink( $myaccount_page_id ) . '?customer-logout=true" class="button login_toggle">log out</a>';
                                         }
                                         elseif (!is_user_logged_in()) {
                                             echo '<a href="'. get_permalink( $myaccount_page_id ) . '" class="button login_toggle">log in</a>';
                                         }
                                     ?>
-                                    <?php
-                                    
-//                                        $myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
-//                                        if ( $myaccount_page_id ) {
-//                                            $myaccount_page_url = get_permalink( $myaccount_page_id );
-//                                        }
-//                                        if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) {
-//                                            $myaccount_page_url = str_replace( 'http:', 'https:', $myaccount_page_id );
-//                                        } else {
-//                                            $myaccount_page_url = str_replace( 'https:', 'http:', $myaccount_page_id );
-//                                        }
-//                                        
-// 
-//                                        if ( $myaccount_page_id ) {
-//
-//                                          $logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );
-//
-//                                          if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' )
-//                                            $logout_url = str_replace( 'http:', 'https:', $logout_url );
-//                                        }
-//                                        
-//                                        if (is_user_logged_in()) { 
-//                                            echo '<a href="'. $logout_url . '" class="button login_toggle">log out</a>';
-//                                        }
-//                                        elseif (!is_user_logged_in()) {
-//                                            echo '<a href="'. $myaccount_page_url . '" class="button login_toggle">log in</a>';
-//                                        }
-                                    ?>
                                     <a href="<?php echo $woocommerce->cart->get_checkout_url(); ?>" class="button">checkout</a>
                                 </div>
                             </div>