Hi. How can we help?

Add Request a quote widget in Porto header

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

First of all, you have to create a child theme and place this code into the functions.php:

<?php
if ( ! function_exists( 'print_raq_widget' ) ) {
function print_raq_widget() {
return do_shortcode( '[yith_ywraq_mini_widget_quote item_name="" item_plural_name=""]' );
}
}

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

$b = porto_check_theme_options();

$css = '
.widget_ywraq_mini_list_quote {
margin: 0 !important;
vertical-align: middle;
}

.header-12 .header-top .widget_ywraq_mini_list_quote,
.header-13 .header-top .widget_ywraq_mini_list_quote,
.header-14 .header-top .widget_ywraq_mini_list_quote,
.header-15 .header-top .widget_ywraq_mini_list_quote,
.header-16 .header-top .widget_ywraq_mini_list_quote{
display: none!important;}

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

.yith-ywraq-list-widget-wrapper .raq-info .handler-label {
display: none;
}

.raq-tip-counter {
position: relative;
}

.raq-tip-counter:before {
content: "\f022";
font-family: "Font Awesome 5 Free";
font-weight: 900;
font-size: 14px;
}

span.raq-items-number {
position: absolute;
line-height: 11px;
top: -10px;
right: -10px;
padding: 3px;
border-radius: 50%;
font-size: 11px;
min-width: 17px;
display: block;
text-align: center;
color: ' . $b['skin-color-inverse'] . ';
background-color: ' . $b['skin-color'] . ';
}

.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;
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 );


}
}

then you have to copy the header template file that you want to edit from wp-content/themes/porto/header/ to wp-content/themes/porto-child/header/

 

then search in the file for the function porto_minicart()

If you find it written in this way: echo porto_minicart();

then change that line into this: echo porto_minicart(); echo print_raq_widget();

 

if you find it in this way $minicart = porto_minicart();

then change it in this way: $minicart = porto_minicart(); $minicart.= print_raq_widget();

 

That’s it. You maybe need only to adjust some CSS rule as your particular needs.

Was this article helpful?
3 out of 4 found this helpful

Back to Help Center >