Home Forums WoodMart support forum Contact with a plugin developer

Contact with a plugin developer

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #27185

    leonidas
    Participant

    Hi,
    I am forwarding a query from a plugin author (it works under 1024res.):
    ————
    Dear Author, I want to add an icon with link next to the cart icon in header. I am using design style 2 (Base). Is there any action hook or filter in which I can append my custom icon and link. If so please provide the basic code.
    ————
    His email account is: “Saurabh Sharma” <xconsau@gmail.com>

    Waiting for your reply

    #27191

    Artem Temos
    Keymaster

    Hi,

    You can customize it in the shopping cart widget code. Place this snippet to the functions.php file in the child theme and then add your icon there

    	function woodmart_header_block_cart() {
    		$position = woodmart_get_opt('cart_position');
    		$design = woodmart_get_opt('shopping_cart');
    		$extra_class = 'woodmart-cart-icon';
    
    		if(  woodmart_get_opt('shopping_icon_alt') ) {
    			$extra_class .= ' woodmart-cart-alt';
    		}
    
    		if( $position == 'side' ) {
    			$extra_class .= ' cart-widget-opener';
    		}
    		
    		if ( woodmart_woocommerce_installed() && $design != 'disable' ): ?>
    
    			<div class="woodmart-shopping-cart woodmart-cart-design-<?php echo esc_attr( $design ); ?> <?php echo esc_attr( $extra_class ); ?>">
    				<a href="<?php echo esc_url(WC()->cart->get_cart_url()); ?>">
    					<span class="woodmart-cart-totals">
    						<?php woodmart_cart_count(); ?>
    						<span class="subtotal-divider">/</span> 
    						<?php woodmart_cart_subtotal(); ?>
    					</span>
    				</a>
    				<?php if ( $position != 'side'): ?>
    					<div class="dropdown-cart">
    						 <?php 
    
    							// Insert cart widget placeholder - code in woocommerce.js will update this on page load
    							echo '<div class="widget woocommerce widget_shopping_cart"><div class="widget_shopping_cart_content"></div></div>';
    
    						  ?> 
    					</div>
    				<?php endif ?>
    			</div>
    		<?php endif;
    	}

    Regards

    #27242

    leonidas
    Participant

    Hi,
    we used the code you gave me.He did the necessary modifications but every time try I place the snippet I see the error message below.What do you think?

    #27243

    leonidas
    Participant

    Sorry forget to send you the code

    function woodmart_header_block_cart() {
    $position = woodmart_get_opt(‘cart_position’);
    $design = woodmart_get_opt(‘shopping_cart’);
    $extra_class = ‘woodmart-cart-icon’;

    if(  woodmart_get_opt(‘shopping_icon_alt’) ) {
    $extra_class .= ‘ woodmart-cart-alt’;
    }

    if( $position == ‘side’ ) {
    $extra_class .= ‘ cart-widget-opener’;
    }

    if ( woodmart_woocommerce_installed() && $design != ‘disable’ ): ?>

    <div class=”woodmart-shopping-cart woodmart-cart-design-<?php echo esc_attr( $design ); ?> <?php echo esc_attr( $extra_class ); ?>”>
    “>
    <span class=”woodmart-cart-totals”>
    <?php woodmart_cart_count(); ?>
    <span class=”subtotal-divider”>/</span> 
    <?php woodmart_cart_subtotal(); ?>
    </span>

    <?php if ( $position != ‘side’): ?>
    <div class=”dropdown-cart”>
    <?php 

    // Insert cart widget placeholder – code in woocommerce.js will update this on page load
    echo ‘<div class=”widget woocommerce widget_shopping_cart”><div class=”widget_shopping_cart_content”></div></div>’;

      ?> 
    </div>
    <?php endif ?>
    </div>
    <?php endif;
    ?>

    <div class=”panel-icon”><i class=”fa fa-ellipsis-v”></i></div>
            <?php
    }

    #27245

    Artem Temos
    Keymaster

    Try to remove lines 671-673.

    #27290

    leonidas
    Participant

    Removing the two lines of code did the trick

    I have two problems:
    1. I want to make the two vertical lines identical (full height)
    2. Remove the space on the right side of the new icon.
    Thank you for your support

    #27293

    leonidas
    Participant

    Also, do you know every time I touch the icon it sends me back to top?

    #27357

    leonidas
    Participant

    Do you think it’s better to talk with the plugin developer or we can find a solution together?

    #27376

    Artem Temos
    Keymaster

    Yes, these questions a more related to the plugin and not connected with our theme.

    #27447

    leonidas
    Participant

    you can close the ticket

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

The topic ‘Contact with a plugin developer’ is closed to new replies.