Home / Forums / WoodMart support forum / Contact with a plugin developer
Home › Forums › WoodMart support forum › Contact with a plugin developer
Contact with a plugin developer
- This topic has 9 replies, 2 voices, and was last updated 8 years, 7 months ago by
leonidas.
-
AuthorPosts
-
December 5, 2017 at 9:25 am #27185
leonidasParticipantHi,
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
December 5, 2017 at 9:47 am #27191Hi,
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
December 5, 2017 at 2:04 pm #27242
leonidasParticipantHi,
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?December 5, 2017 at 2:05 pm #27243
leonidasParticipantSorry 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
}December 5, 2017 at 2:10 pm #27245Try to remove lines 671-673.
December 5, 2017 at 5:04 pm #27290
leonidasParticipantRemoving 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 supportDecember 5, 2017 at 6:00 pm #27293
leonidasParticipantAlso, do you know every time I touch the icon it sends me back to top?
December 6, 2017 at 7:31 am #27357
leonidasParticipantDo you think it’s better to talk with the plugin developer or we can find a solution together?
December 6, 2017 at 8:06 am #27376Yes, these questions a more related to the plugin and not connected with our theme.
December 6, 2017 at 11:29 am #27447
leonidasParticipantyou can close the ticket
-
AuthorPosts
The topic ‘Contact with a plugin developer’ is closed to new replies.
- You must be logged in to create new topics. Login / Register