Home › Forums › WoodMart support forum › Upgrade from 2.10.1 to 3.3 › Reply To: Upgrade from 2.10.1 to 3.3
leonidas
Perfect.
A long time ago you have given me a code on purpose to add an icon in the header.I wanted click on it to open a widget sidebar (check the video)
The code:
function woodmart_header_block_cart() {
$position = woodmart_get_opt(‘cart_position’);
$design = woodmart_get_opt(‘shopping_cart’);
$extra_class = ”;
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=”search-icon”><span class=”screen-reader-text”><?php esc_attr_e( ‘Search’, ‘woodmart’ ); ?></span>
<div class=”search-overlay”>
<div class=”search-inner”>
<?php
// Core WordPress function
echo do_shortcode(‘[isrc_ajax_search shortcode_id=1]’);
?></div>
</div>
</div>
<div class=”woodmart-shopping-cart woodmart-cart-design-<?php echo esc_attr( $design ); ?> <?php echo esc_attr( $extra_class ); ?>”>
“>
<span class=”woodmart-cart-wrapper”>
<span class=”woodmart-cart-icon”></span>
<span class=”woodmart-cart-totals”>
<?php woodmart_cart_count(); ?>
<span class=”subtotal-divider”>/</span>
<?php woodmart_cart_subtotal(); ?>
</span>
</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
}
You can find it inside the function.php file of child theme from line 1161 to 1212.
It is obvious that this code doesn’t work after the update.
Can you modify it so not to lose the previous function?
Regards Leonidas