Home › Forums › WoodMart support forum › Quick view HTML BLOCK issue
Quick view HTML BLOCK issue
- This topic has 12 replies, 3 voices, and was last updated 6 years ago by Elise Noromit.
-
AuthorPosts
-
October 29, 2018 at 11:51 am #85884
xjablaParticipantHi,
I have add a custom code to the single product page, in general just a html block as mentioned below:
add_action(‘woocommerce_single_product_summary’, ‘justwood_enhance’, 18);
function justwood_enhance(){
if (get_field(‘product-from’)==’eu’){
echo do_shortcode(‘[html_block id="13939"]‘);
}
}It is working nicely for single product but when I click on quickview button, there is a visual composer code still visible, it seems that shortcode is not performed sucesfully.
Can you check it please and help us to solve this issue somehow?
Thanks a lot
With regards
Petr
Attachments:
You must be logged in to view attached files.October 29, 2018 at 12:40 pm #85902
Artem TemosKeymasterHi,
Try to replace this line
echo do_shortcode(‘[html_block id="13939"]‘);
with this code
echo woodmart_get_html_block(13939);
Regards
October 29, 2018 at 1:09 pm #85919
xjablaParticipantThank for your help. I have tried to use your syntax and unfortunately it is the same. Working nicely in normal single page but issue is still there when QuickView is used.
Thanks for your understanding
October 29, 2018 at 1:31 pm #85923
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file
function woodmart_html_block_shortcode($atts) { if( class_exists('WPBMap') ) WPBMap::addAllMappedShortcodes(); extract(shortcode_atts(array( 'id' => 0 ), $atts)); return woodmart_get_html_block($id); } add_shortcode( 'html_block', 'woodmart_html_block_shortcode' );
October 29, 2018 at 1:50 pm #85927
xjablaParticipantThanks for your snippet.
Did it work in your end? Because in our end the issue is still persisting.. 🙁
Thanks
October 29, 2018 at 1:53 pm #85929
Artem TemosKeymasterPlease, send us your FTP access so we can check what is wrong.
October 29, 2018 at 2:06 pm #85932
xjablaParticipantHere are the FTP credentials
October 29, 2018 at 2:12 pm #85935
Artem TemosKeymasterAdd the following code as well
function woodmart_quick_view($id = false) { if( class_exists('WPBMap') ) WPBMap::addAllMappedShortcodes(); if( isset($_GET['id']) ) { $id = (int) $_GET['id']; } if( ! $id || ! woodmart_woocommerce_installed() ) { return; } global $post, $product; $args = array( 'post__in' => array($id), 'post_type' => 'product' ); $quick_posts = get_posts( $args ); $quick_view_variable = woodmart_get_opt( 'quick_view_variable' ); $quick_view_layout = ( woodmart_get_opt( 'quick_view_layout' ) ) ? woodmart_get_opt( 'quick_view_layout' ) : 'horizontal'; foreach( $quick_posts as $post ) : setup_postdata($post); $product = wc_get_product($post); remove_action( 'woocommerce_single_product_summary', 'woodmart_before_compare_button', 33 ); remove_action( 'woocommerce_single_product_summary', 'woodmart_after_compare_button', 37 ); //Remove before and after add to cart button text remove_action( 'woocommerce_single_product_summary', 'woodmart_before_add_to_cart_area', 25 ); remove_action( 'woocommerce_single_product_summary', 'woodmart_after_add_to_cart_area', 31 ); remove_action( 'woocommerce_before_single_product', 'wc_print_notices', 10 ); // Add brand image add_action( 'woocommerce_single_product_summary', 'woodmart_product_brand', 8 ); // Disable add to cart button for catalog mode if( woodmart_get_opt( 'catalog_mode' ) ) { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); } elseif( ! $quick_view_variable ) { // If no needs to show variations remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_loop_add_to_cart', 30 ); } if( woodmart_get_opt( 'product_share' ) ) add_action( 'woocommerce_single_product_summary', 'woodmart_product_share_buttons', 45 ); get_template_part('woocommerce/content', 'quick-view-' . $quick_view_layout ); endforeach; wp_reset_postdata(); die(); } add_action( 'wp_ajax_woodmart_quick_view', 'woodmart_quick_view' ); add_action( 'wp_ajax_nopriv_woodmart_quick_view', 'woodmart_quick_view' );
October 29, 2018 at 2:25 pm #85940
xjablaParticipantThank you very much, this solution is working now.
Have a nice day!
October 29, 2018 at 2:30 pm #85943
xjablaParticipantSorry I have forgotten to ask how to remove SOLD BY xxx (comes from YITH MULTIVENDOR PLUGIN) from woodmart quick view? because in the single shop page there it is deactivated but if I check the product via QuickView the SOLD BY info is there:
Thanks
October 29, 2018 at 2:56 pm #85951
Artem TemosKeymasterTry to add the following code snippet to the Custom CSS area in Theme Settings
.popup-quick-view .by-vendor-name { display: none; }
October 29, 2018 at 6:44 pm #85975
xjablaParticipantThank for help, I totally forget to use CSS which is pretty easy 😀 Now you can close this topic.
Thanks
October 29, 2018 at 7:26 pm #85982
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
Tagged: quick view, visual composer
The topic ‘Quick view HTML BLOCK issue’ is closed to new replies.
- You must be logged in to create new topics. Login / Register