fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Pre-purchase – Video options Missing

This is a pre-purchase question.

I’m attempting to add self-hosted videos to my image gallery for variations and the entire option is missing on the right panel:

videoOptionMissing.JPG

From your video, I was expecting this:

videoOptionMissing2.JPG

Golam Kibria

Hi Michael,

Adding videos to your gallery images is a premium feature of our plugin.

Once you install and activate the premium version of the plugin, the option will show up.

Watch this video for more clarification.

If you have any confusion, please let us know.

Thank You

I appreciate the clarification that it’s a premium only feature.   We are planning on buying the premium as long as everything will work as intended.   Is it possible through the API on WooCommerce to add multiple images and videos to the variants?   Is that done through the meta data through the API, do they go directly into the WordPress media storage, and include all of the relevant alt / description / etc SEO tags that go with the media?

To elaborate a bit on the last question:   We use PHP to do direct communication with WooCommerce to manage the items / description and media, so we want to just ensure that something similiar to this would be compatible with the plugin for variant data, and if so, would the videos just be included within the ‘image’ block or elsewhere?

 $variationData = [
        ‘regular_price’ => $itemPrice,
        ‘sku’ => $itemSKU . “-” . $variationSKU,
        ‘weight’ => $variationWeight,
        ‘description’ => $textDescription,
        ‘image’ => $photoIDs,
        ‘attributes’ => [
            [
                ‘name’ => ‘Metal’,
                ‘option’ => $metalType,
            ],
        ],
    ];

I haven’t been able to get to the point of testing this yet.  I am having a different issue that I will create another ticket on, and then update this ticket when I get far enough to test this.

 

Thanks

Golam Kibria

Hi Michael,

You are always welcome.

Please let us know when you have an update for us.

Have a great day.

Thank You

Update:
I’ve purchased the full plugin and am able to see the video options on the images.   When manually adding a video to an image through the UI it works fine.  When trying to add the image through the metadata it does not apply.  This is the Array that I’m posting when creating a variation:

This is what I’m getting when I do an item get:

There seems to be a problem with your guys ticket system.   I’ve tried doing code blocks, which just add a background color but don’t maintain the formatting, and I’ve tried doing phote uploads, and the photos just disappear when I submit the reply.

^^ Even uploading just a photo in a reply and clicking reply results in an empty box.

Data when getting product details after it is created:

[woo_variation_gallery_images] => Array
(
[0] => Array
(
[id] => 19960
[date_created] => 2023-09-10T02:22:50
[date_created_gmt] => 2023-09-10T16:22:50
[date_modified] => 2023-09-10T02:23:00
[date_modified_gmt] => 2023-09-10T16:23:00
[src] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100001-000001-18kWG-2.webp
[name] => FCJ-100001-000001-18kWG-2.webp
[alt] => Oval Diamond Set In White Gold Engagement Ring Direct Front View
[has_video] =>
[video_src] =>
[embed_url] =>
)

[1] => Array
(
[id] => 19961
[date_created] => 2023-09-10T02:22:51
[date_created_gmt] => 2023-09-10T16:22:51
[date_modified] => 2023-09-10T02:23:00
[date_modified_gmt] => 2023-09-10T16:23:00
[src] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100001-000001-18kWG-3.webp
[name] => FCJ-100001-000001-18kWG-3.webp
[alt] =>
[has_video] =>
[video_src] =>
[embed_url] =>
)

[2] => Array
(
[id] => 19962
[date_created] => 2023-09-10T02:22:52
[date_created_gmt] => 2023-09-10T16:22:52
[date_modified] => 2023-09-10T02:23:00
[date_modified_gmt] => 2023-09-10T16:23:00
[src] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100001-000001-18kWG-4.webp
[name] => FCJ-100001-000001-18kWG-4.webp
[alt] =>
[has_video] =>
[video_src] =>
[embed_url] =>
)

[3] => Array
(
[id] => 19962
[date_created] => 2023-09-10T02:22:52
[date_created_gmt] => 2023-09-10T16:22:52
[date_modified] => 2023-09-10T02:23:00
[date_modified_gmt] => 2023-09-10T16:23:00
[src] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100001-000001-18kWG-4.webp
[name] => FCJ-100001-000001-18kWG-4.webp
[alt] =>
[has_video] =>
[video_src] =>
[embed_url] =>
)

)

Golam Kibria

Hi Michael,

I have forwarded this to our development team.

I will get back to you once I have an update.

Thank You

Golam Kibria

Hi Michael,

I have just got a feedback from my team. You need to follow the steps below:

=> You have to upload one image and one video file to the WordPress media. Please check this article to know more about how to post media using API: https://developer.wordpress.org/rest-api/reference/media/#definition-2
=> Get the both image and video media item IDs.
=> Using the video media item ID, get the media URL
=> Then update the meta (to insert the video media URL) of the image using this meta key woo_variation_gallery_media_video
=> Get the Image ID and add the IDs by following this article: https://getwooplugins.com/ticket/23572/

Thank You

Getting the Image ID, Video ID and Media URL (before upload and after) are not an issue at all.

The problem is updating the meta, which has been the problem from the start, which your reply doesn’t help at all with besides saying “Then update the meta (to insert the video media URL) of the image using this meta key woo_variation_gallery_media_video"

Even after manually adding the meta information in the user interface, doing a query of “/wp-json/wp/v2/media/$mediaID” using Curl doesn’t even list the meta data in it’s response.   When I’m actually connected to the server I can do a “local” call of add_post_meta in wordpress and that works, but not remotely using curl.  Can you elaborate?

Below is an example of the response pulling image data through curl.  You’ll notice no woo_variation_gallery_media_video meta information at all.    Also to confirm, there is no “->get” call for modifying this meta data through the wooCommerce API Rest interface?

Array
(
[id] => 18063
[date] => 2023-09-25T14:44:25
[date_gmt] => 2023-09-25T21:44:25
[guid] => Array
(
[rendered] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp
[raw] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp
)

[modified] => 2023-09-25T15:21:22
[modified_gmt] => 2023-09-25T22:21:22
[slug] => fcj-100002-000001-18kwg-2-thumb-1-webp
[status] => inherit
[type] => attachment
[link] => http://127.0.0.1/?attachment_id=18063
[title] => Array
(
[raw] => FCJ-100002-000001-18kWG-2-thumb-1.webp
[rendered] => FCJ-100002-000001-18kWG-2-thumb-1.webp
)

[author] => 1
[comment_status] => closed
[ping_status] => closed
[template] =>
[meta] => Array
(
[inline_featured_image] =>
)

[permalink_template] => http://127.0.0.1/?attachment_id=18063
[generated_slug] => fcj-100002-000001-18kwg-2-thumb-1-webp
[description] => Array
(
[raw] =>
[rendered] => <p class=”attachment”><a href=’http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp’><img loading=”lazy” width=”300″ height=”300″ src=”http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-300×300.webp” class=”attachment-medium size-medium” alt=”” decoding=”async” srcset=”http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-300×300.webp 300w, http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-150×150.webp 150w, http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-100×100.webp 100w, http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp 600w” sizes=”(max-width: 300px) 100vw, 300px” /></a></p>

)

[caption] => Array
(
[raw] =>
[rendered] =>
)

[alt_text] =>
[media_type] => image
[mime_type] => image/webp
[media_details] => Array
(
[width] => 600
[height] => 600
[file] => 2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp
[filesize] => 37362
[sizes] => Array
(
[medium] => Array
(
[file] => FCJ-100002-000001-18kWG-2-thumb-1-300×300.webp
[width] => 300
[height] => 300
[filesize] => 5358
[mime_type] => image/webp
[source_url] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-300×300.webp
)

[thumbnail] => Array
(
[file] => FCJ-100002-000001-18kWG-2-thumb-1-150×150.webp
[width] => 150
[height] => 150
[filesize] => 2320
[mime_type] => image/webp
[source_url] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-150×150.webp
)

[woocommerce_thumbnail] => Array
(
[file] => FCJ-100002-000001-18kWG-2-thumb-1-300×300.webp
[width] => 300
[height] => 300
[filesize] => 5358
[uncropped] =>
[mime_type] => image/webp
[source_url] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-300×300.webp
)

[woocommerce_gallery_thumbnail] => Array
(
[file] => FCJ-100002-000001-18kWG-2-thumb-1-100×100.webp
[width] => 100
[height] => 100
[filesize] => 1488
[mime_type] => image/webp
[source_url] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1-100×100.webp
)

[full] => Array
(
[file] => FCJ-100002-000001-18kWG-2-thumb-1.webp
[width] => 600
[height] => 600
[mime_type] => image/webp
[source_url] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp
)

)

[image_meta] => Array
(
[aperture] => 0
[credit] =>
[camera] =>
[caption] =>
[created_timestamp] => 0
[copyright] =>
[focal_length] => 0
[iso] => 0
[shutter_speed] => 0
[title] =>
[orientation] => 0
[keywords] => Array
(
)

)

)

[post] => 18053
[source_url] => http://127.0.0.1/wp-content/uploads/2023/09/FCJ-100002-000001-18kWG-2-thumb-1.webp
[missing_image_sizes] => Array
(
)

[_links] => Array
(
[self] => Array
(
[0] => Array
(
[href] => http://127.0.0.1/wp-json/wp/v2/media/18063
)

)

[collection] => Array
(
[0] => Array
(
[href] => http://127.0.0.1/wp-json/wp/v2/media
)

)

[about] => Array
(
[0] => Array
(
[href] => http://127.0.0.1/wp-json/wp/v2/types/attachment
)

)

[author] => Array
(
[0] => Array
(
[embeddable] => 1
[href] => http://127.0.0.1/wp-json/wp/v2/users/1
)

)

[replies] => Array
(
[0] => Array
(
[embeddable] => 1
[href] => http://127.0.0.1/wp-json/wp/v2/comments?post=18063
)

)

[wp:action-unfiltered-html] => Array
(
[0] => Array
(
[href] => http://127.0.0.1/wp-json/wp/v2/media/18063
)

)

[wp:action-assign-author] => Array
(
[0] => Array
(
[href] => http://127.0.0.1/wp-json/wp/v2/media/18063
)

)

[curies] => Array
(
[0] => Array
(
[name] => wp
[href] => https://api.w.org/{rel}
[templated] => 1
)

)

)

)

For the time being, I’ve created code to update the wp_postmeta database directly with success, but would prefer a way to use the API instead of doing calls to different databases for security reasons.

Golam Kibria

Hi Michael,

I am sorry for the inconvenience.

Unfortunately, that’s all I have got from our team.

I will request my team to create documentation on this.

Thank You