Home Forums Basel – Premium Template Problem Woocomerce Advanced Labels

This topic contains 11 replies, has 2 voices, and was last updated by Elise Noromit Elise Noromit 5 months, 2 weeks ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #167983

    indecenta
    Customer

    Hi,

    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( ‘%s‘, 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!

    Private Content Hidden
    #168016

    Hello,

    Please deactivate all the plugins not related to the theme and provide the site admin access to the private area.

    Best Regards

    #168043

    indecenta
    Customer

    I 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.

    Private Content Hidden
    #168104

    Hello,

    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

    #168123

    indecenta
    Customer

    The code is from you…please check your forum…it is a code developed by you. So please help me with this code. Thanks

    #168133

    Hello,

    Please provide FTP access as well.

    Best Regards

    #168139

    indecenta
    Customer

    I’ve sent the cpanel link. Thank you!

    Private Content Hidden
    #168267

    Hello,

    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

    #168325

    indecenta
    Customer

    I 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.

    #168381

    Hello,

    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

    #168576

    indecenta
    Customer

    Ok, Thank you. Can i have a different style in pagination, just Previous/Next and not to show all the numbers of pages?

    #168591

    Hello,

    Such customization is beyond our support. You can do it, please find a developer who would customize the code for you.

    Best Regards

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.