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
- This topic has 19 replies, 2 voices, and was last updated 5 years, 11 months ago by Artem Temos.
-
AuthorPosts
-
November 28, 2018 at 4:37 pm #92288
elokrfParticipantWhen 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.November 28, 2018 at 6:28 pm #92305
Artem TemosKeymasterHello,
Currently, your website is not working at all so we can’t check anything https://gyazo.com/c160928620d0bea640aeba2f63f06d7c
Regards
November 28, 2018 at 7:16 pm #92319
elokrfParticipanttried to fix the problem, site is now available)))
November 29, 2018 at 7:07 am #92352
Artem TemosKeymasterThe 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
November 29, 2018 at 5:20 pm #92559
elokrfParticipantNow the link is in the correct format but an errorŅ
Attachments:
You must be logged in to view attached files.November 29, 2018 at 7:11 pm #92570
Artem TemosKeymasterThe link should contain only latin symbols.
November 29, 2018 at 8:35 pm #92591
elokrfParticipantThx very match!
November 30, 2018 at 12:35 am #92623
elokrfParticipantI did as you said, but the 360 view is still unavailable
Attachments:
You must be logged in to view attached files.November 30, 2018 at 7:08 am #92643
Artem TemosKeymasterDon’t use the full URL for the 360 opener button https://gyazo.com/df1f810bd4a1f3518d9602a6b422c25b
Use the only id like this#popup-id
.Regards
November 30, 2018 at 6:18 pm #92900
elokrfParticipantI initially did as you say. In this case, the photos for different products are loaded the same. This was my initial problem. Thank
November 30, 2018 at 6:55 pm #92916
elokrfParticipantthe problem is that the button does not redefine the gallery for displaying 360 photos
November 30, 2018 at 8:22 pm #92937
Artem TemosKeymasterThe ID should be different for each popup like
#popup-id1
,#popup-id2
,#popup-id3
.November 30, 2018 at 8:58 pm #92943
elokrfParticipantMany thanks for the help in solving the problem.
November 30, 2018 at 9:01 pm #92944
elokrfParticipantjust on the product page the pop-up window has the same ID and still works perfectly for each product
December 1, 2018 at 7:53 am #92998
Artem TemosKeymasterGreat, you are welcome.
December 1, 2018 at 9:58 pm #93132
elokrfParticipantNice rofl, man
December 1, 2018 at 10:02 pm #93135
elokrfParticipantI changed the link for each item for popupmenu, popup menu does not work)
December 1, 2018 at 10:06 pm #93136
elokrfParticipantthis is joke, very thnx for help!!! you are god!
December 1, 2018 at 10:16 pm #93138
elokrfParticipantif 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!!!December 2, 2018 at 8:49 am #93162
Artem TemosKeymasterThank you for sharing your experiences here.
Kind Regards
-
AuthorPosts
Tagged: 360 View
- You must be logged in to create new topics. Login / Register