Home Forums WoodMart support forum How to add 360 view button to other woodmart buttons on main page

How to add 360 view button to other woodmart buttons on main page

Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #92288

    elokrf
    Participant

    When I add a browse 360 view to the template content-product-icons.php on main page, the function “woodmart_product_360_view()” does not load different photos for each item.

    Attachments:
    You must be logged in to view attached files.
    #92305

    Artem Temos
    Keymaster

    Hello,

    Currently, your website is not working at all so we can’t check anything https://gyazo.com/c160928620d0bea640aeba2f63f06d7c

    Regards

    #92319

    elokrf
    Participant

    tried to fix the problem, site is now available)))

    #92352

    Artem Temos
    Keymaster

    The problem is that each button has the same ID. You need to customize that function and specify different IDs per product https://gyazo.com/e2f38fc09914b5b77d3787062993a315

    #92559

    elokrf
    Participant

    Now the link is in the correct format but an errorŅŽ

    Attachments:
    You must be logged in to view attached files.
    #92570

    Artem Temos
    Keymaster

    The link should contain only latin symbols.

    #92591

    elokrf
    Participant

    Thx very match!

    #92623

    elokrf
    Participant

    I did as you said, but the 360 view is still unavailable

    Attachments:
    You must be logged in to view attached files.
    #92643

    Artem Temos
    Keymaster

    Don’t use the full URL for the 360 opener button https://gyazo.com/df1f810bd4a1f3518d9602a6b422c25b
    Use the only id like this #popup-id.

    Regards

    #92900

    elokrf
    Participant

    I initially did as you say. In this case, the photos for different products are loaded the same. This was my initial problem. Thank

    #92916

    elokrf
    Participant

    the problem is that the button does not redefine the gallery for displaying 360 photos

    #92937

    Artem Temos
    Keymaster

    The ID should be different for each popup like #popup-id1, #popup-id2, #popup-id3.

    #92943

    elokrf
    Participant

    Many thanks for the help in solving the problem.

    #92944

    elokrf
    Participant

    just on the product page the pop-up window has the same ID and still works perfectly for each product

    #92998

    Artem Temos
    Keymaster

    Great, you are welcome.

    #93132

    elokrf
    Participant

    Nice rofl, man

    #93135

    elokrf
    Participant

    I changed the link for each item for popupmenu, popup menu does not work)

    #93136

    elokrf
    Participant

    this is joke, very thnx for help!!! you are god!

    #93138

    elokrf
    Participant

    if someone encounters a problem like mine (add a button 360 on the main page to the woodmart-buttons group), you need:
    1. Add an individual button to “woodmart-child/woocomerce/(you-template-product_hover)”
    2. Add the following code to ”
    function “individual button.php”() {

    $images = woodmart_get_360_gallery_attachment_ids();
    if( empty( $images ) ) return;
    global $post;
    $id = rand(100,999);

    $title = ”;

    $frames_count = count( $images );

    $images_js_string = ”;

    ?>
    <div class=”product-360-button”>
    ID)?>”><span><?php esc_html_e(‘360 product view’, ‘woodmart’); ?></span>
    </div>
    <div id=”product-360-view-<?php echo($post->ID)?>” class=”product-360-view-wrapper mfp-hide”>
    <div class=”woodmart-threed-view threed-id-<?php echo esc_attr( $id ); ?>”>
    <?php if ( ! empty( $title ) ): ?>
    <h3 class=”threed-title”><span><?php echo ($title); ?></span></h3>
    <?php endif ?>
    <ul class=”threed-view-images”>
    <?php if ( count($images) > 0 ): ?>
    <?php $i=0; foreach ($images as $img_id): $i++; ?>
    <?php
    $img = wp_get_attachment_image_src( $img_id, ‘full’ );
    $width = $img[1];
    $height = $img[2];
    $images_js_string .= “‘” . $img[0] . “‘”;
    if( $i < $frames_count ) {
    $images_js_string .= “,”;
    }
    ?>
    <?php endforeach ?>
    <?php endif ?>

    <div class=”spinner”>
    <span>0%</span>
    </div>
    </div>
    </div>
    <?php
    woodmart_enqueue_script( ‘woodmart-threesixty’ );

    wp_add_inline_script(‘woodmart-theme’, ‘jQuery(document).ready(function( $ ) {
    $(“.threed-id-‘ . esc_js( $id ) . ‘”).ThreeSixty({
    totalFrames: ‘ . esc_js( $frames_count ) . ‘,
    endFrame: ‘ . esc_js( $frames_count ) . ‘,
    currentFrame: 1,
    imgList: “.threed-view-images”,
    progress: “.spinner”,
    imgArray: ‘ . “[“.$images_js_string.”]” . ‘,
    height: ‘ . esc_js( $height ) . ‘,
    width: ‘ . esc_js( $width ) . ‘,
    responsive: true,
    navigation: true
    });
    });’, ‘after’);
    }”
    Thx WOODMART STAFF!!!

    #93162

    Artem Temos
    Keymaster

    Thank you for sharing your experiences here.

    Kind Regards

Tagged: 

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