Hi. How can we help?

Add Request a quote widget in The7 theme header

To add the YITH WooCommerce Request a Quote widget in The7 theme header, please, follow these steps:

First of all, you have to add this code into the functions.php file of The7 (better if it is a child):

//Add our custom widget
add_filter( 'presscore_get_header_elements_list-near_menu_right', 'add_raq_widget' );
if ( ! function_exists( 'add_raq_widget' ) ) {

function add_raq_widget( $elements ) {

$elements[] = 'raq_widget';

return $elements;
}
}

add_action( 'presscore_render_header_element-raq_widget', 'render_raq_widget' );
if ( ! function_exists( 'render_raq_widget' ) ) {

function render_raq_widget() {
echo do_shortcode( '[yith_ywraq_mini_widget_quote item_name="" item_plural_name=""]' );
}
}

Now, the new widget is visible in the header but you have to adjust its style. So, by adding the following snippet, you can make it look like the cart widget:

//customize style
add_action( 'wp_enqueue_scripts', 'my_yith_wraq_style', 25 );
if ( ! function_exists( 'my_yith_wraq_style' ) ) {
function my_yith_wraq_style() {

$css = '
.widget_ywraq_mini_list_quote {
margin: 0 !important;
}

.yith-ywraq-list-widget-wrapper .raq-info {
border: none;
margin: 0;
padding: 0;
}

a.raq_label {
color: #333333;
border: 0 none;
font-size: 13px;
text-decoration: none;
}

a.raq_label:hover{
color: rgba(51,51,51,0.7);
}

.raq-tip-counter {
position: relative;
padding: 0 0 0 25px;
}

.raq-tip-counter:before {
content: "\f0ca";
font-family: Fontawesome;
font-size: 14px;
left: 0;
position: absolute;
}

span.raq-items-number {
position: absolute;
line-height: 11px;
top: -10px;
left: 6px;
padding: 3px;
background-color: ' . of_get_option( 'general-accent_bg_color', '#000000' ) . ';
color: #333333;
border-radius: 50%;
font-size: 11px;
min-width: 17px;
display: block;
text-align: center;
box-sizing: border-box;
}

.yith-ywraq-list-wrapper {
right: 0;
line-height: normal;
}

.yith-ywraq-list-wrapper .button {
padding: 11px 23px;
line-height: 16px;
font-size: 13px;
font-weight: 700;
color: #ffffff;
background-color: ' . of_get_option( 'general-accent_bg_color', '#000000' ) . ';
text-transform: uppercase;
display: inline-block;
clear: both;
}

.yith-ywraq-list-wrapper ul li {
float: none
}

.yith-ywraq-list-wrapper ul li span.quantity {
display: inline;
border: 0;
}

a.yith-ywraq-item-remove.remove {
font-size: 16px;
}';
wp_add_inline_style( 'yith_ywraq_frontend', $css );


}
Was this article helpful?
0 out of 1 found this helpful

Back to Help Center >