Home › Forums › Basel support forum › Problem Woocomerce Advanced Labels
Problem Woocomerce Advanced Labels
- This topic has 11 replies, 2 voices, and was last updated 5 years, 1 month ago by
Elise Noromit.
-
AuthorPosts
-
January 15, 2020 at 12:40 am #167983
indecentaParticipantHi,
Please help me with the following issue. I have product-image.php in basel child theme for “Woocomerce Advanced Labels” to show. Everyting works great with one issue:
– The ” Click to enlarge” button for the first Product image is not working, it gives an error: “The image could not be loaded”The following code for “product-image.php” is:
<?php
if ( ! defined( ‘ABSPATH’ ) ) {
exit;
}global $post, $product, $woocommerce_loop;
$is_quick_view = (isset($woocommerce_loop[‘view’]) && $woocommerce_loop[‘view’] == ‘quick-view’);
$attachment_ids = $product->get_gallery_image_ids();
$thums_position = basel_get_opt(‘thums_position’);
$product_design = basel_product_design();$image_action = basel_get_opt( ‘image_action’ );
$columns = apply_filters( ‘woocommerce_product_thumbnails_columns’, 4 );
$thumbnail_size = apply_filters( ‘woocommerce_product_thumbnails_large_size’, ‘full’ );
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$full_size_image = wp_get_attachment_image_src( $post_thumbnail_id, $thumbnail_size );
$placeholder = has_post_thumbnail() ? ‘with-images’ : ‘without-images’;
$wrapper_classes = apply_filters( ‘woocommerce_single_product_image_gallery_classes’, array(
‘woocommerce-product-gallery’,
‘woocommerce-product-gallery–‘ . $placeholder,
‘woocommerce-product-gallery–columns-‘ . absint( $columns ),
‘images’,
) );
if ( $product_design == ‘sticky’ ) $attachment_ids = false;
?>
<div class=”<?php echo esc_attr( implode( ‘ ‘, array_map( ‘sanitize_html_class’, $wrapper_classes ) ) ); ?> images row thumbs-position-<?php echo esc_attr( $thums_position ); ?> image-action-<?php echo esc_attr( $image_action ); ?>” style=”opacity: 0; transition: opacity .25s ease-in-out;”><div class=”<?php if ( $attachment_ids && $thums_position == ‘left’ && ! $is_quick_view ): ?>col-md-9 col-md-push-3<?php else: ?>col-sm-12<?php endif ?>”>
<?php do_action( ‘woocommerce_custom_labels’ ); ?>
<figure class=”woocommerce-product-gallery__wrapper <?php if( $product_design != ‘sticky’ ) echo ‘owl-carousel’; ?>”>
<?php
$attributes = array(
‘title’ => get_post_field( ‘post_title’, $post_thumbnail_id ),
‘data-caption’ => get_post_field( ‘post_excerpt’, $post_thumbnail_id ),
‘data-src’ => $full_size_image[0],
‘data-large_image’ => $full_size_image[1],
‘data-large_image_width’ => $full_size_image[1],
‘data-large_image_height’ => $full_size_image[2],
);if ( has_post_thumbnail() ) {
$html = ‘<figure data-thumb=”‘ . get_the_post_thumbnail_url( $post->ID, ‘shop_catalog’ ) . ‘” class=”woocommerce-product-gallery__image”>‘;
$html .= get_the_post_thumbnail( $post->ID, ‘shop_single’, $attributes );
$html .= ‘</figure>’;
} else {
$html = ‘<figure class=”woocommerce-product-gallery__image–placeholder”>’;
$html .= sprintf( ‘‘, esc_url( wc_placeholder_img_src() ), esc_html__( ‘Awaiting product image’, ‘woocommerce’ ) );
$html .= ‘</figure>’;
}echo apply_filters( ‘woocommerce_single_product_image_thumbnail_html’, $html, get_post_thumbnail_id( $post->ID ) );
do_action( ‘woocommerce_product_thumbnails’ );
?>
</figure>
<?php if ( $image_action != ‘popup’ && basel_get_opt(‘photoswipe_icon’)): ?>
<div class=”basel-show-product-gallery-wrap”><?php _e(‘Click pentru marire’, ‘basel’); ?></div>
<?php endif ?>
</div><?php if ( $attachment_ids ): ?>
<div class=”<?php if ( $thums_position == ‘left’ && ! $is_quick_view ): ?>col-md-3 col-md-pull-9<?php else: ?>col-sm-12<?php endif ?>”><div class=”thumbnails”></div></div>
<?php endif; ?>
</div>
————————————————————————
The second, third…etc product images, zoom is working. Only on the first product image is the problem.The code implemented is from your forum.
Thank you!
January 15, 2020 at 8:09 am #168016
Elise NoromitMemberHello,
Please deactivate all the plugins not related to the theme and provide the site admin access to the private area.
Best Regards
January 15, 2020 at 9:48 am #168043
indecentaParticipantI don’t need to deactivate any plugin because if i remove the product-image.php file from basel child…zoom is working. When i activate product-image.php from basel child…the zoom will not work. It is something wrong in the code. I’ll provide you the access.
January 15, 2020 at 1:23 pm #168104
Elise NoromitMemberHello,
Please remove the harmfull code and use the correct one. It would solve the issue. Our support scope does not cover theme customization. You will need to find a developer if you need help in code correction.
Best Regards
January 15, 2020 at 2:26 pm #168123
indecentaParticipantThe code is from you…please check your forum…it is a code developed by you. So please help me with this code. Thanks
January 15, 2020 at 2:52 pm #168133
Elise NoromitMemberHello,
Please provide FTP access as well.
Best Regards
January 15, 2020 at 2:59 pm #168139
indecentaParticipantI’ve sent the cpanel link. Thank you!
January 16, 2020 at 7:58 am #168267
Elise NoromitMemberHello,
We have tested and the image is shown not always. We have removed the code and the image do not appear sometimes. We suspect that one of your plugins conflict.
Please deactivate all the plugins not related to the theme and check the issue, then activate one by one checking which one causes the problem.
Best Regards
January 16, 2020 at 11:25 am #168325
indecentaParticipantI verified and everyting looks ok…images are shown. Maybe it was related with cache. Now Everyting works.
Thank you.
By the way, i want to activate “Load more products” button and it is an issue with the back button, it doesn’t return to the same position. Can you give me the piece of code for that? Or can you help me with this…because is useless if the customer can’t go back in the same position…i have hundreds of products.January 16, 2020 at 1:32 pm #168381
Elise NoromitMemberHello,
Load more products have been implemented by means of AJAX technology when you press the button the products just loads to the same page, so it is one and the same page, where the next portion of products are loaded. That is why the browser does not save the history of products loaded and when you go back you see no products. This is the way how it works and we do not have code to change it.
Best Regards
January 17, 2020 at 2:52 pm #168576
indecentaParticipantOk, Thank you. Can i have a different style in pagination, just Previous/Next and not to show all the numbers of pages?
January 17, 2020 at 3:24 pm #168591
Elise NoromitMemberHello,
Such customization is beyond our support. You can do it, please find a developer who would customize the code for you.
Best Regards
-
AuthorPosts
Tagged: Woocommerce Advanced Label
- You must be logged in to create new topics. Login / Register