New Landing How can we help? Atelier Add text to dropdown cart?

Viewing 15 posts - 1 through 15 (of 16 total)
  • Posted in: Atelier
  • #252056
    alexanderchristiansen
    Member
    Post count: 179

    Amazing theme!
    Is it possible to add some text below the “view checkout” in the dropdown add to cart? Like attached?

    Attachments:
    You must be logged in to view attached files.
    #252145
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

     function sf_woo_header_add_to_cart_fragment( $fragments ) {
                global $woocommerce, $sf_options;
    
                ob_start();
    
                $show_cart_count = false;
                if ( isset( $sf_options['show_cart_count'] ) ) {
                    $show_cart_count = $sf_options['show_cart_count'];
                }
    
    			if ( sf_theme_opts_name() == "sf_atelier_options" ) {
    				$cart_total = '<span class="menu-item-title">' . __( "Cart" , "swiftframework" ) . '</span>';
    			} else {
    				$cart_total = WC()->cart->get_cart_total();
    			}
                $cart_count          = $woocommerce->cart->cart_contents_count;
                $cart_count_text     = sf_product_items_text( $cart_count );
                $cart_count_text_alt = sf_product_items_text( $cart_count, true );
                $view_cart_icon 	 = apply_filters( 'sf_view_cart_icon', '<i class="ss-view"></i>' );
                $checkout_icon 	 	 = apply_filters( 'sf_checkout_icon', '<i class="ss-creditcard"></i>' );
                $go_to_shop_icon  	 = apply_filters( 'sf_go_to_shop_icon', '<i class="ss-cart"></i>' );
                $extra_class		 = "";
                
                if ( $cart_count != "0" ) {
                	$extra_class .= "cart-not-empty ";
                }
                
                ?>
    
                <li class="parent shopping-bag-item <?php echo $extra_class; ?>">
    
                    <?php if ( $show_cart_count ) { ?>
    
                        <a class="cart-contents" href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?>"
                           title="<?php _e( 'View your shopping cart', 'swiftframework' ); ?>">
                           <?php echo apply_filters( 'sf_header_cart_icon', '<i class="ss-cart"></i>' ); ?><?php echo $cart_total; ?><span class="num-items cart-count-enabled"><?php echo $cart_count_text_alt; ?></span></a>
    
                    <?php } else { ?>
    
                        <a class="cart-contents" href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?>"
                           title="<?php _e( 'View your shopping cart', 'swiftframework' ); ?>"><?php echo apply_filters( 'sf_header_cart_icon', '<i class="ss-cart"></i>' ); ?><?php echo $cart_total; ?><span class="num-items"><?php echo $cart_count_text_alt; ?></span></a>
    
                    <?php } ?>
    
                    <ul class="sub-menu">
                        <li>
    
                            <div class="shopping-bag" data-empty-bag-txt="<?php _e( 'Your cart is empty.', 'swiftframework' ); ?>" data-singular-item-txt="<?php _e( 'item in the cart', 'swiftframework' ); ?>" data-multiple-item-txt="<?php _e( 'items in the cart', 'swiftframework' ); ?>">
    
                              <div class="loading-overlay"><i class="sf-icon-loader"></i></div>
    
                                <?php if ( $cart_count != "0" ) { ?>
    
                                    <div
                                        class="bag-header"><?php echo $cart_count_text; ?> <?php _e( 'in the cart', 'swiftframework' ); ?></div>
    
                                    <div class="bag-contents">
    
                                        <?php foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { ?>
    
                                            <?php
                                            $_product     		 = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
                                            $product_title       = $_product->get_title();
                                            $price 				 = apply_filters( 'woocommerce_cart_item_price', $woocommerce->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
                                            ?>
    
                                            <?php  
    										
    										$variation_id_class = '';
    										
                                            if ( $cart_item['variation_id'] > 0 )
                                                 $variation_id_class = ' product-var-id-' .  $cart_item['variation_id']; 
    										 
                                            if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) { ?>
    
                                                	<div class="bag-product clearfix  product-id-<?php echo $cart_item['product_id']; ?><?php echo $variation_id_class; ?>">
    
                                                    <figure><a class="bag-product-img"
                                                               href="<?php echo get_permalink( $cart_item['product_id'] ); ?>"><?php echo $_product->get_image(); ?></a>
                                                    </figure>
    
                                                    <div class="bag-product-details">
                                                        <div class="bag-product-title">
                                                            <a href="<?php echo get_permalink( $cart_item['product_id'] ); ?>">
                                                                <?php echo apply_filters( 'woocommerce_cart_widget_product_title', $product_title, $_product ); ?></a>
                                                        </div>
                                                        <div
                                                            class="bag-product-price"><?php _e( "Unit Price:", "swiftframework" ); ?> <?php echo $price; ?></div>
                                                        <div
                                                            class="bag-product-quantity"><?php _e( 'Quantity:', 'swiftframework' ); ?> <?php echo $cart_item['quantity']; ?></div>
                                                    </div>
    
    												<a href="#" class="remove-product remove" data-ajaxurl="<?php echo admin_url( 'admin-ajax.php' ); ?>" data-product-id="<?php echo $cart_item['product_id'];?>"   data-variation-id="<?php echo $cart_item['variation_id'];?>"     data-product-qty="<?php echo $cart_item['quantity'];?>" title="<?php echo __( 'Remove this item', 'swiftframework' ); ?>">&times;</a>
     
                                                </div>
    
                                            <?php } ?>
    
                                        <?php } ?>
    
                                    </div>
    
                                    <?php if ( sf_theme_opts_name() == "sf_atelier_options" ) { ?>
    
    				                    <div class="bag-total">
    				                    	<?php if ( class_exists( 'Woocommerce_German_Market' ) ) { ?>
    					                    <span class="total-title"><?php _e( "Total incl. tax", "swiftframework" ); ?></span>
    					                    <?php } else { ?>
    					                    <span class="total-title"><?php _e( "Total", "swiftframework" ); ?></span>
    					                    <?php } ?>
    										<span class="total-amount"><?php echo WC()->cart->get_cart_total(); ?></span>
    				                    </div>
    
    			                    <?php } ?>
    
                                    <div class="bag-buttons">
    
                                        <a class="sf-button standard sf-icon-reveal bag-button" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>">
                                        	<?php echo $view_cart_icon; ?>
                                       		<span class="text"><?php _e( 'View cart', 'swiftframework' ); ?></span>
                                       	</a>
    
                                        <a class="sf-button standard sf-icon-reveal checkout-button" href="<?php echo esc_url( $woocommerce->cart->get_checkout_url() ); ?>">
                                        	<?php echo $checkout_icon; ?>
                                        	<span class="text"><?php _e( 'Proceed to checkout', 'swiftframework' ); ?></span>
                                        </a>
                                        <span> Add <?php $ship_cart = WC()->cart->get_cart_total(); $ship_cart = 50-$ship_cart; echo $ship_cart; ?> to your cart and get free shipping!</span>
    
                                    </div>
    
                                <?php } else { ?>
    
                                    <div class="bag-empty"><?php _e( 'Your cart is empty.', 'swiftframework' ); ?></div>
    
                                <?php } ?>
    
                            </div>
                        </li>
                    </ul>
                </li>
    
                <?php
    
                $fragments['.shopping-bag-item'] = ob_get_clean();
    
                return $fragments;
    
            }

    Thanks
    Mohammad

    #252428
    alexanderchristiansen
    Member
    Post count: 179

    Thanks for your quick reply Mohammed.
    Where will I have to incorporate my own text then? When I add this to child-theme (functions.php), nothing seems so change in my cart.

    #252531
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me login detail after installing WPIDE plugin.
    Thanks
    Mohammad

    #257010
    alexanderchristiansen
    Member
    Post count: 179
    This reply has been marked as private.
    #257015
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me website url to check and resolve the issue.
    Thanks
    Mohammad

    #257017
    alexanderchristiansen
    Member
    Post count: 179
    This reply has been marked as private.
    #257031
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I need also website url.
    Thanks
    Mohammad

    #257032
    alexanderchristiansen
    Member
    Post count: 179
    This reply has been marked as private.
    #257119
    alexanderchristiansen
    Member
    Post count: 179

    Let me know if you need anymore infomration 🙂

    #257387
    alexanderchristiansen
    Member
    Post count: 179
    This reply has been marked as private.
    #257421
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Yes, of course. I support from india.
    Thanks
    Mohammad

    #257422
    alexanderchristiansen
    Member
    Post count: 179

    Amazing! Looking forward to hear how it goes 🙂

    #257426
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I see that you need to activate the child theme and check it. Let me know feedback.
    Thanks
    Mohammad

    #257429
    alexanderchristiansen
    Member
    Post count: 179

    Thanks Mohammad,
    Are there any worries/issues I need to be aware of before activating?

Viewing 15 posts - 1 through 15 (of 16 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