New Landing How can we help? Themeforest Theme Support Dante adjust go to shop button

Viewing 15 posts - 1 through 15 (of 48 total)
  • Posted in: Dante
  • #151094
    Gizan86
    Member
    Post count: 252

    Hi, I’m trying to change the “go to shop” button in the header to an icon reveal button to a urlpage but do not seem to be succesful. I located the code that I should change but would it be possible to let me know how I should adjust this code exactly?

    Also it looks like the header.php is not applying to my site. I copied the whole file header.php and moved it to the dante-child/includes/ folder as you can see in the code I pasted the word testing in the titles but on my site they do not appear.

    thanks

     } else {
    
    	           		$cart_output .= '<div class="bag-header">'.__("testing 0 items in the shopping bag", "swiftframework").'</div>';
    
    	           		$cart_output .= '<div class="bag-empty">'.__('testing Unfortunately, your shopping bag is empty.','swiftframework').'</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="bag-buttons">';
    
    	            	$cart_output .= '<a class="sf-button standard sf-icon-reveal shop-button" href="'.esc_url( $shop_page_url ).'"><i class="ss-cart"></i><span class="text">'.__('Go to the shop', 'swiftframework').'</span></a>';
    
    	            	$cart_output .= '</div>';
    
    Attachments:
    You must be logged in to view attached files.
    #151125
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    You see the part:

    $cart_output .= '<a class="sf-button standard sf-icon-reveal shop-button" href="'.esc_url( $shop_page_url ).'"><i class="ss-cart"></i><span class="text">'.__('Go to the shop', 'swiftframework').'</span></a>';

    Change to:

    $cart_output .= '<a class="sf-button standard sf-icon-reveal shop-button" href="YOURURLHERE"><i class="ss-cart"></i><span class="text">'.__('Go to the shop', 'swiftframework').'</span></a>';

    Are you referring to the header.php file or the sf-header.php file?

    – Kyle

    #151147
    Gizan86
    Member
    Post count: 252

    Thanks Kyle,

    I applied the url change in the code but just like the text, also this url change does not appear on my site. It seems as thought the child sf-header.php is not catching on. Is my set up correct? I thought I needed to change sf-header.php in order to make this change work but please correct me if I’m wrong..

    #151150
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    With framework files you an’t override the parent file. Instead you need to copy the function and add to your functions.php file

    – Kyle

    #151171
    Gizan86
    Member
    Post count: 252

    Ah ok 🙂

    I copied the file functions.php to my child theme and added the whole function there:

    /* CART DROPDOWN
    	================================================== */
    	if (!function_exists('sf_get_cart')) {
    		function sf_get_cart() {
    
    			$cart_output = "";
    
    			// Check if WooCommerce is active
    			if (sf_woocommerce_activated()) {
    
    				global $woocommerce;
    
    				$options = get_option('sf_dante_options');
    				$show_cart_count = false;
    				if (isset($options['show_cart_count'])) {
    					$show_cart_count = $options['show_cart_count'];
    				}
    
    				$cart_total = $woocommerce->cart->get_cart_total();
    				$cart_count = $woocommerce->cart->cart_contents_count;
    				$cart_count_text = sf_product_items_text($cart_count);
    
    				if ($show_cart_count) {
    					$cart_output .= '<li class="parent shopping-bag-item"><a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="'.__("View your shopping cart", "swiftframework").'"><i class="ss-cart"></i>'.$cart_total.' ('.$cart_count.')</a>';
    				} else {
    					$cart_output .= '<li class="parent shopping-bag-item"><a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="'.__("View your shopping cart", "swiftframework").'"><i class="ss-cart"></i>'.$cart_total.'</a>';
    				}
    
    	            $cart_output .= '<ul class="sub-menu">';
    	            $cart_output .= '<li>';
    				$cart_output .= '<div class="shopping-bag">';
    
    	            if ( $cart_count != "0" ) {
    
    	            	$cart_output .= '<div class="bag-header">'.$cart_count_text.' '.__('in the shopping bag', 'swiftframework').'</div>';
    
    	            	$cart_output .= '<div class="bag-contents">';
    
    	            	foreach ($woocommerce->cart->cart_contents as $cart_item_key => $cart_item) {
    
    	                    $bag_product = $cart_item['data'];
    	                    $product_title = $bag_product->get_title();
    	                    $product_short_title = (strlen($product_title) > 25) ? substr($product_title, 0, 22) . '...' : $product_title;
    
    	                    if ($bag_product->exists() && $cart_item['quantity']>0) {
    	                        $cart_output .= '<div class="bag-product clearfix">';
    	                      	$cart_output .= '<figure><a class="bag-product-img" href="'.get_permalink($cart_item['product_id']).'">'.$bag_product->get_image().'</a></figure>';
    	                        $cart_output .= '<div class="bag-product-details">';
    	                        $cart_output .= '<div class="bag-product-title"><a href="'.get_permalink($cart_item['product_id']).'">' . apply_filters('woocommerce_cart_widget_product_title', $product_short_title, $bag_product) . '</a></div>';
    	                        $cart_output .= '<div class="bag-product-price">'.__("Unit Price:", "swiftframework").'
    	                        '.woocommerce_price($bag_product->get_price()).'</div>';
    	                        $cart_output .= '<div class="bag-product-quantity">'.__('Quantity:', 'swiftframework').' '.$cart_item['quantity'].'</div>';
    	                        $cart_output .= '</div>';
    	                        $cart_output .= apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" class="remove" title="%s">&times;</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="bag-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 class="sf-button standard sf-icon-reveal bag-button" href="'.esc_url( $cart_url ).'"><i class="ss-view"></i><span class="text">'. __('View shopping bag', 'swiftframework').'</span></a>';
    	               	$cart_output .= '<a class="sf-button standard sf-icon-reveal checkout-button" href="'.esc_url( $checkout_url ).'"><i class="ss-creditcard"></i><span class="text">'.__('Proceed to checkout', 'swiftframework').'</span></a>';
    
    	               	} else {
    
    	               	$cart_output .= '<a class="sf-button standard sf-icon-reveal bag-button" href="'.esc_url( $woocommerce->cart->get_cart_url() ).'"><i class="ss-view"></i><span class="text">'. __('View shopping bag', 'swiftframework').'</span></a>';
    	               		$cart_output .= '<a class="sf-button standard sf-icon-reveal checkout-button" href="'. esc_url( $woocommerce->cart->get_checkout_url() ).'"><i class="ss-creditcard"></i><span class="text">'.__('Proceed to checkout', 'swiftframework').'</span></a>';
    
    	               	}
    
    	               	$cart_output .= '</div>';
    
    	            } else {
    
    	           		$cart_output .= '<div class="bag-header">'.__("testing 0 items in the shopping bag", "swiftframework").'</div>';
    
    	           		$cart_output .= '<div class="bag-empty">'.__('testing Unfortunately, your shopping bag is empty.','swiftframework').'</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="bag-buttons">';
    
    	            	$cart_output .= '<a class="sf-button standard sf-icon-reveal shop-button" href="http://test.freshfolds.nl/start/"><i class="ss-cart"></i><span class="text">'.__('test Go to the shop', 'swiftframework').'</span></a>';
    
    	            	$cart_output .= '</div>';
    
    	            }
    
    			    $cart_output .= '</div>';
    	            $cart_output .= '</li>';
    	            $cart_output .= '</ul>';
    	            $cart_output .= '</li>';
    
    	        }
    
    			return $cart_output;
    		}

    However, after doing that my whole site gets blank. What am i doing wrong?

    #151172
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    I’m getting a 403 forbidden on your site, can you check

    – Kyle

    #151192
    Gizan86
    Member
    Post count: 252
    This reply has been marked as private.
    #151199
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ahh it’s because you’re using a different language, in that case you will need to use POEdit to edit the .po file. Find the ‘go to shop’ string and translate it to what you want to use.

    You don’t need the code in the functions.php file

    – Kyle

    #151281
    Gizan86
    Member
    Post count: 252
    This reply has been marked as private.
    #151303
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    The best way to check that is first make the change to the parent theme, if it works, transfer it to your child theme’s functions.php file and test again. It’s more likely that you’ve just not edited the right part

    – Kyle

    #151380
    Gizan86
    Member
    Post count: 252
    This reply has been marked as private.
    #151426
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Can you provide us ftp access so we can give it a try?
    Use the private reply option.

    -Rui

    #151433
    Gizan86
    Member
    Post count: 252
    This reply has been marked as private.
    #151435
    Gizan86
    Member
    Post count: 252
    This reply has been marked as private.
    #151526
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Was missing a closing bracket in the code. I created you a functions.php file inside the child theme.

    Test if it’s ok.

    -Rui

Viewing 15 posts - 1 through 15 (of 48 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register