This topic has 2 replies, 3 voices, and was last updated 9 years by Karol.

  • Author
  • #51764
     labdesignbrasil
    Participant

    Hello!

    Want to change the current the go to shop menu button link to open stylishcommerce page.
    How do i do this…found under woocommerce system status the current link, but nowhere to change this conf.

    Thanks!

    C

    #51943
     sharmstr
    Moderator

    You can copy the function into your childs functions.php file and edit the button url

    COPY CODE
    
    function kleo_woo_get_mini_cart( $just_inner = false ) {
    
    		global $woocommerce;
    		
    		$cart_output = "";
    		$cart_total = $woocommerce->cart->get_cart_total();
    		$cart_count = $woocommerce->cart->cart_contents_count;
    		$cart_count_text = kleo_product_items_text($cart_count);
    		
    		$cart_has_items = '';
    		if ($cart_count != "0") {
    			$cart_has_items = ' has-products';
    		}
    		
    		if ( ! $just_inner ) {
    		$cart_output .= '<li class="menu-item kleo-toggle-menu shop-drop">'
    						. '<a>cart->get_cart_url().'" title="'.__("View Cart", "woocommerce").'" style="line-height: normal;">'
    							. '<span class="cart-items' . $cart_has_items . '"><i class="icon icon-basket-full-alt"></i> ';
    
                                 if ( $cart_count != "0" ) {
                                    $cart_output .= "<span class='kleo-notifications new-alert'>" . $cart_count . "</span>";
                                 }
    
                                $cart_output .= '</span> <span class="caret"></span>'
    						. '</a>'
    						. '<ul class="kleo-toggle-submenu">';
    		}
    		
    		$cart_output .=  '<li>'                                
    			. '<div class="kleo-minicart">';
    		
    		if ( $cart_count != "0" ) {
    
    			$cart_output .= '<div class="minicart-header">'.$cart_count_text.' '.__('in the shopping cart', 'kleo_framework').'</div>';
    
    			$cart_output .= '<div class="minicart-contents">';
    
    			foreach ($woocommerce->cart->cart_contents as $cart_item_key => $cart_item) {
    
    				$cart_product = $cart_item['data']; 
    				$product_title = $cart_product->get_title();
    				$product_short_title = (strlen($product_title) > 25) ? substr($product_title, 0, 22) . '...' : $product_title;
    
    				if ($cart_product->exists() && $cart_item['quantity']>0) {
    					$cart_output .= '<div class="cart-product clearfix">';
    					$cart_output .= '<figure><a href="'.get_permalink($cart_item['product_id']).'">'.$cart_product->get_image().'</a></figure>';                      
    					$cart_output .= '<div class="cart-product-details">';
    					$cart_output .= '<div class="cart-product-title"><a href="'.get_permalink($cart_item['product_id']).'">' . apply_filters('woocommerce_cart_widget_product_title', $product_short_title, $cart_product) . '</a></div>';
    					$cart_output .= '<div class="cart-product-price">' . __("Price", "woocommerce") . ' ' . woocommerce_price($cart_product->get_price()) . '</div>';
    					$cart_output .= '<div class="cart-product-quantity">' . __('Quantity', 'woocommerce') . ' ' . $cart_item['quantity'] . '</div>';
    					$cart_output .= '</div>';
    					$cart_output .= kleo_woo_get_quickview_button( $cart_item['product_id'], false );
    					$cart_output .= apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" title="%s">×</a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __('Remove this item', 'woocommerce') ), $cart_item_key );
    					$cart_output .= '</div>';
    				}
    			}
    
    			$cart_output .= '</div>';
    			
    			$cart_output .= '<div class="minicart-total-checkout">' . __( 'Cart Subtotal', 'woocommerce' ) . ' ' . $cart_total . '</div>';
    
    			$cart_output .= '<div class="minicart-buttons">';
    
    			if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) {
    
    				$cart_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->get_cart_url() );
    				$checkout_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->get_checkout_url() );
    
    				$cart_output .= '<a href="'.esc_url( $cart_url ).'"><span class="text">'. __('View Cart', 'woocommerce').'</span></a>';
    				$cart_output .= '<a href="'.esc_url( $checkout_url ).'"><span class="text">'.__('Proceed to Checkout', 'woocommerce').'</span></a>';
    
    			} else {
    
    				$cart_output .= '<a>cart->get_cart_url() ).'"><span class="text">'. __('View Cart', 'woocommerce').'</span></a>';
    				$cart_output .= '<a>cart->get_checkout_url() ).'"><span class="text">'.__( 'Proceed to Checkout', 'woocommerce' ).'</span></a>';
    
    			}
    
    			$cart_output .= '</div>';
    
    		} else {
    
    			$cart_output .= '<div class="minicart-header">' . __('Your shopping bag is empty.','kleo_framework') . '</div>';                                 
    
    			$shop_page_url = "";
    			if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) {
    				$shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
    			} else {
    				$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
    			}
    
    			$cart_output .= '<div class="minicart-buttons">';
    
    			$cart_output .= '<a href="'.esc_url( $shop_page_url ).'"><span class="text">'.__('Go to the shop', 'kleo_framework').'</span></a>';
    
    			$cart_output .= '</div>';
    
    		}
    
    		$cart_output .= '</div>'
    							. '</li>';
    		
    		if ( ! $just_inner ) {
    			$cart_output .= '</ul>'
    							. '</li>';
    		}
    
    		return $cart_output;
    
    

    But, if it were me, I’d copy the stylish woo page code into the shop page so that my shops home page was the stylish woo page.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #60241
     Karol
    Participant

    I try edit this code second hour and nothing happens, even when deleted part of the code. Maybe I do something wrong. I will be grateful for any help.

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?