Home › Forums › WoodMart support forum › Hotspot – problem
Hotspot – problem
- This topic has 7 replies, 4 voices, and was last updated 5 years, 4 months ago by Elise Noromit.
-
AuthorPosts
-
June 22, 2019 at 10:44 am #129654
apodisParticipantHello. I have a problem with hotspot. Using hotspots with products there is a problem with displaying short description. If short description is a text – everything is ok (products with text description: https://nowa.iwalk.pl/portfolio/kolekcja-iwalk-2018/). But when short description is a table (using table, td, tr, th), everything brakes down (4th product is with table short description: https://nowa.iwalk.pl/portfolio/kolekcja-iwalk-2019/). Please help us. Thank you.
June 22, 2019 at 1:27 pm #129662
Bogdan DonovanKeymasterHi,
Seems that this issue is caused by unclosed HTML tag in one of your product description. Please check it.
Regards
June 24, 2019 at 9:00 am #129778
apodisParticipantHello,
according to Your messages from emails and forum:1.„Seems that this issue is caused by unclosed HTML tag in one of your
product description. Please check it.”All HTML tags in product descriptions are closed. Here is table short description, which is not working in hotspot:
<table>
<tbody>
<tr>
<th>Pojemność</th>
<td>2.400 mAh</td>
</tr>
<tr>
<th>Wbudowane złącza</th>
<td>Lightning</td>
</tr>
<tr>
<th>Wbudowane porty</th>
<td>micro USB</td>
</tr>
<tr>
<th>Dodatkowe funkcje</th>
<td>Doskonała ochrona dla iPhone 6s/6</td>
</tr>
<tr>
<th>Certyfikaty</th>
<td>Apple MFi, MIL-STD 810G-516.6, CE, KC, FCC, RoHS</td>
</tr>
</tbody>
</table>The issue happens only with short description which is table like this, in every product with table description. Products with text description works fine.
2. “Please deactivate all the plugins not related to the theme provide the
site admin access to the private area.”There are only few plugins not related to the theme like:
– WooCommerce
– Yoast
– Advanced Custom Fields PRO
– All-in-One WP Migration
– Loco Translate
– W3 Total Cache3. “You have provided one and the same URL twice please check and provide
the product URL and URL with the image hotspot.”
https://nowa.iwalk.pl/portfolio/kolekcja-iwalk-2018/ – all hotspots with text description are working good
https://nowa.iwalk.pl/portfolio/kolekcja-iwalk-2019/ – 3 hotspots with text description and 1 with table description. The page is not working. If You will switch on develop mode in Your browser and switch opacity from 0 to 1 in .vc_row[data-vc-full-width].vc_hidden class, You will see what happens.
https://nowa.iwalk.pl/produkt/obudowa-chameleon-immortal-i6-2400mah-czarny/ – this product is added to hotspot and is not working. We have tried to add different products with short description as a table and every one are not working.June 24, 2019 at 11:12 am #129811
Elise NoromitMemberHello,
Please provide your site admin access to the private area we shall check
Best Regards
June 24, 2019 at 11:35 am #129817
apodisParticipantI’m sending the necessary informations.
June 24, 2019 at 2:31 pm #129852
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file
function woodmart_hotspot_shortcode( $atts, $content ) { $output = $classes = $content_classes = $product = $image = ''; extract( shortcode_atts( array( 'hotspot' => '', 'hotspot_type' => 'product', 'hotspot_dropdown_side' => 'left', 'product_id' => '', 'title' => '', 'link_text' => '', 'link' => '', 'img' => '', 'img_size' => 'full', 'el_class' => '', ), $atts) ); $classes .= ' hotspot-type-' . $hotspot_type; $classes .= ( $el_class ) ? ' ' . $el_class : ''; $content_classes .= ' hotspot-dropdown-' . $hotspot_dropdown_side; $position = explode( '||', $hotspot ); $left = ( isset( $position[0] ) && $position[0] ) ? $position[0] : '50'; $top = ( isset( $position[1] ) && $position[1] ) ? $position[1] : '50'; if ( $product_id && woodmart_woocommerce_installed() ) $product = wc_get_product( $product_id ); if ( $hotspot_type == 'product' && $product ) { $rating_count = $product->get_rating_count(); $average = $product->get_average_rating(); $args = array( 'class' => implode( ' ', array_filter( array( 'button', 'product_type_' . $product->get_type(), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '', $product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '', ) ) ), 'attributes' => wc_implode_html_attributes( array( 'data-product_id' => $product->get_id(), 'rel' => 'nofollow', ) ), 'url' => $product->add_to_cart_url(), 'text' => $product->add_to_cart_text(), ); $output = '<div class="hotspot-product hotspot-content' . esc_attr( $content_classes ) . '">'; $output .= '<div class="hotspot-content-image"><a href="' . esc_url( get_permalink( $product->get_ID() ) ) . '">' . $product->get_image() . '</a></div>'; $output .= '<h4 class="hotspot-content-title"><a href="' . esc_url( get_permalink( $product->get_ID() ) ) . '">' . esc_html( $product->get_title() ) . '</a></h4>'; $output .= wc_get_rating_html( $average, $rating_count ); $output .= '<div class="price">' . $product->get_price_html() . '</div>'; $output .= '<div class="hotspot-content-text reset-mb-10">' . do_shortcode( $product->get_short_description() ) . '</div>'; $output .= '<a href="' . esc_url( $args['url'] ) . '" class="' . esc_attr( $args['class'] ) . '" ' . $args['attributes'] . '>' . esc_html( $args['text'] ) . '</a>'; $output .= '</div>'; } if ( $hotspot_type == 'text' && ( $title || $content || $link_text || isset( $image['thumbnail'] ) ) ) { if ( $link ) $attributes = woodmart_get_link_attributes( $link ); if ( function_exists( 'wpb_getImageBySize' ) ) { $image = wpb_getImageBySize( array( 'attach_id' => $img, 'thumb_size' => $img_size, 'class' => 'woodmart-image-hotspot-img' ) ); } $image_allowed_tags = array( 'img' => array( 'width' => true, 'height' => true, 'src' => true, 'alt' => true, 'data-wood-src' => true, 'data-srcset' => true, 'class' => true ) ); $output = '<div class="hotspot-text hotspot-content' . esc_attr( $content_classes ) . '">'; if ( isset( $image['thumbnail'] ) ) $output .= '<div class="hotspot-content-image">' . wp_kses( $image['thumbnail'], $image_allowed_tags ). '</div>'; if ( $title ) $output .= '<h4 class="hotspot-content-title">' . esc_html( $title ) . '</h4>'; if ( $content ) $output .= '<div class="hotspot-content-text reset-mb-10">' . $content . '</div>'; if ( $link_text && $link ) $output .= '<a class="btn btn-color-primary btn-size-small" ' . $attributes . '>' . esc_html( $link_text ) . '</a>'; $output .= '</div>'; } if ( ! $output ) return; echo '<div class="woodmart-image-hotspot' . esc_attr( $classes ) . '" style="left: ' . esc_attr( $left ) . '%; top: ' . esc_attr( $top ) . '%;">'; echo '<span class="hotspot-sonar"></span>'; echo '<div class="hotspot-btn"></div>'; echo apply_filters( 'woodmart_hotspot_content', $output ); echo '</div>'; }
Regards
June 24, 2019 at 5:48 pm #129876
apodisParticipantThank you very much! Everything is works fine 🙂
June 24, 2019 at 8:27 pm #129895
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
The topic ‘Hotspot – problem’ is closed to new replies.
- You must be logged in to create new topics. Login / Register