Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #318259

    Hi,

    I have some questions about the WooCommerce plugin that I could not find in their user guide.

    First is it possible to fix the chart icon in the header or put it in the secondary header? As it is now the icon hide every time and do not show the number of items there are in the cart.

    Second I created some product variations but when I select the variation e.g. colour red in the product front page the button that appear to add the item to the cart says “Buy” instead of e.g. “Add to the cart”. How could I change the tittle of the button?

    Also WooCommerce is not very flexible in term of layout as their default product page does not allow to do any advance editor layout. Do you know any more flexible e-commerce plugging that works with the enfold theme?

    Thank you in advance for the support!

    #320499

    Hi MeryVi!

    There are plugins that will add the cart into your menu or if you want a more customized approach you could have a freelance developer customize it.

    The variation button should stay the same as far as I know. Can we see an example?

    The individual product page templates are unfortunately not open to any kind of customized layout from our end. WooCommerce is also the only ecommerce option the theme supports.

    Regards,
    Devin

    #323374

    Hi Devin,

    Thank you very much for your help. What plugin do you suggest that will enable to add the cart in the menu or even better in the Small bar above Main Menu?

    Regarding the botton’s title is for example you select a variation here http://www.hi-funroma.com/prodotto/hi-bomb2/ the button that appear says in italian “Buy” but I would like to change its title with “Add to cart”. Perhaps the automatic translation of WooCommerce changed the original meaning. Is it possible to change the title with code?

    Thank you,

    MeryVi

    #323476

    Hey!

    Maybe this plugin will help: https://wordpress.org/plugins/woocommerce-menu-bar-cart/

    Regarding the button text, you can use this on functions.php:

    add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' );                                // < 2.1
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );    // 2.1 +
     
    function woo_custom_cart_button_text() {
     
            return __( 'My Button Text', 'woocommerce' );
     
    }

    Regards,
    Ismael

    #323640

    Hi Ismael,

    thank you very much for the code to personalise the button, it worked perfectly.

    Regarding the cart in the menu, I added the plugin you suggest but now I have 2 cart icon on the menu: the one of the pluging and the default one e.g. http://www.hi-funroma.com/prodotto/hi-bomb2/
    Also is there any way that the cart icon be displayed in the small bar above the main mean instead that in the main menu?

    In alternative to the plugin I tried to insert the following code in functions.php but it doesn’t seem to make any differences.

    //* Make Font Awesome available
    add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
    function enqueue_font_awesome() {
     
    	wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' );
     
    }
     
    /**
     * Place a cart icon with number of items and total cost in the menu bar.
     *
     * Source: http://wordpress.org/plugins/woocommerce-menu-bar-cart/
     */
    add_filter('wp_nav_menu_items','sk_wcmenucart', 10, 2);
    function sk_wcmenucart($menu, $args) {
     
    	// Check if WooCommerce is active and add a new item to a menu assigned to Primary Navigation Menu location
    	if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || 'primary' !== $args->theme_location )
    		return $menu;
     
    	ob_start();
    		global $woocommerce;
    		$viewing_cart = __('View your shopping cart', 'your-theme-slug');
    		$start_shopping = __('Start shopping', 'your-theme-slug');
    		$cart_url = $woocommerce->cart->get_cart_url();
    		$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
    		$cart_contents_count = $woocommerce->cart->cart_contents_count;
    		$cart_contents = sprintf(_n('%d item', '%d items', $cart_contents_count, 'your-theme-slug'), $cart_contents_count);
    		$cart_total = $woocommerce->cart->get_cart_total();
    		// Uncomment the line below to hide nav menu cart item when there are no items in the cart
    		// if ( $cart_contents_count > 0 ) {
    			if ($cart_contents_count == 0) {
    				$menu_item = '<li class="right"><a class="wcmenucart-contents" href="'. $shop_page_url .'" title="'. $start_shopping .'">';
    			} else {
    				$menu_item = '<li class="right"><a class="wcmenucart-contents" href="'. $cart_url .'" title="'. $viewing_cart .'">';
    			}
     
    			$menu_item .= '<i class="fa fa-shopping-cart"></i> ';
     
    			$menu_item .= $cart_contents.' - '. $cart_total;
    			$menu_item .= '</a></li>';
    		// Uncomment the line below to hide nav menu cart item when there are no items in the cart
    		// }
    		echo $menu_item;
    	$social = ob_get_clean();
    	return $menu . $social;
     
    }
    #324094

    Hi!

    Thank you for the update.

    You can hide the default cart button with this on Quick CSS or custom.css:

    .cart_dropdown.visible_cart {
    display: none !important;
    }

    Move the cart position with this:

    li#wpmenucartli {
    position: absolute;
    top: -40px;
    }
    
    #header_meta {
    z-index: 1;
    }

    Regards,
    Ismael

    #324165

    Thank you Ismael worked perfectly!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘WooCommerce cart’ is closed to new replies.