Skip to content

Commit

Permalink
update readme and assets
Browse files Browse the repository at this point in the history
  • Loading branch information
devsabbirhossain committed Jan 15, 2025
1 parent c66c64c commit 0659d63
Show file tree
Hide file tree
Showing 20 changed files with 143 additions and 72 deletions.
Binary file modified .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-3.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ jQuery(document).ready(function ($) {
upload_images: function (e) {
e.preventDefault();
var variationID = $(this).data('wc_variation_images_variation_id');
if ($.wc_variation_images.is_cross_upload_limit(variationID)) {
alert('Upload limit 3 images in free version');
return false;
if( "1" !== WC_VARIATION_IMAGES.is_pro_active ) {
if ($.wc_variation_images.is_cross_upload_limit(variationID)) {
alert(WC_VARIATION_IMAGES.media_upload_limit_text);
return false;
}
}
var self = $(this);

Expand All @@ -54,9 +56,11 @@ jQuery(document).ready(function ($) {
var images = file_frame.state().get('selection').toJSON();
var image_limit = $('#wc-variation-images-image-list-' + variationID + ' li').length;
var total_image = image_limit + images.length;
if (total_image > 8) {
alert('Upload limit 3 images in free version');
return false;
if( "1" !== WC_VARIATION_IMAGES.is_pro_active ) {
if (total_image > 3) {
alert(WC_VARIATION_IMAGES.media_upload_limit_text);
return false;
}
}
var html = images.map(function (image) {
var imageID = image.id;
Expand Down Expand Up @@ -88,7 +92,7 @@ jQuery(document).ready(function ($) {
is_cross_upload_limit: function (variationId) {
var selector = $('#wc-variation-images-image-list-' + variationId + ' li');
var length = selector.length;
return (length >= 8);
return (length >= 3);
}
};
$.wc_variation_images.init();
Expand Down
12 changes: 4 additions & 8 deletions assets/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,22 @@

function load_slider() {
var slider_settings = JSON.parse( WC_VARIATION_IMAGES.i18n.slider_data );
var enable_slider = "no" === slider_settings.enable_slider ? false : { delay: slider_settings.slider_delay, disableOnInteraction: false }
var enable_slider = "yes" === slider_settings.enable_slider ? { delay: slider_settings.slider_delay, disableOnInteraction: false } : "false";
var navigation = "no" === slider_settings.hide_navigation ? false : {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
}
};
var swiper = new Swiper(".mySwiper", {
loop: slider_settings.loop ? slider_settings.loop : false,
loop: "no" === slider_settings.slider_loop ? false : true,
spaceBetween: slider_settings.items_space ? slider_settings.items_space : 4,
slidesPerView: slider_settings.items_per_page ? slider_settings.items_per_page : 4,
freeMode: true,
watchSlidesProgress: true,
});
var swiper2 = new Swiper(".mySwiper2", {
loop: slider_settings.loop ? slider_settings.loop : false,
loop: "no" === slider_settings.slider_loop ? false : true,
navigation: navigation,
autoplay: enable_slider,
effect: 'fade',
fadeEffect: {
crossFade: true
},
thumbs: {
swiper: swiper,
},
Expand Down
2 changes: 2 additions & 0 deletions includes/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ public function enqueue_scripts( $hook ) {
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'wc_variation_images' ),
'is_pro_active' => is_plugin_active( 'wc-variation-images-pro/wc-variation-images-pro.php' ),
'variation_image_title' => __( 'Variation Images', 'wc-variation-images' ),
'add_variation_image_text' => __( 'Add Additional Images', 'wc-variation-images' ),
'admin_media_title' => __( 'Variation Images', 'wc-variation-images' ),
'admin_media_add_image_text' => __( 'Add to Variation', 'wc-variation-images' ),
'media_upload_limit_text' => __( 'Upload limit 3 images in free version', 'wc-variation-images' ),
'admin_tip_message' => __( 'Click on link below to add additional images. Click on image itself to remove the image. Click and drag image to re-order the image position.', 'wc-variation-images' ),
)
);
Expand Down
46 changes: 23 additions & 23 deletions includes/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,46 @@ public function get_settings( $tab ) {
'id' => 'general_options',
),
array(
'id' => 'wc_variation_images_hide_image_zoom',
'title' => __( 'Hide Image Zoom', 'wc-variation-images' ),
'desc' => __( 'Hide image zoom for variable product', 'wc-variation-images' ),
'class' => 'ever-field-inline',
'type' => 'select',
'options' => array(
'id' => 'wc_variation_images_hide_image_zoom',
'title' => __( 'Hide Image Zoom', 'wc-variation-images' ),
'desc' => __( 'Hide image zoom for variable product.', 'wc-variation-images' ),
'desc_tip' => __( 'Check this box to disable the image zoom effect on hover for this product.', 'wc-variation-images' ),
'type' => 'select',
'options' => array(
'no' => __( 'No', 'wc-variation-images' ),
'yes' => __( 'Yes', 'wc-variation-images' ),
),
'default' => 'no',
'default' => 'no',
),
array(
'id' => 'wc_variation_images_hide_image_lightbox',
'title' => __( 'Hide Lightbox', 'wc-variation-images' ),
'desc' => __( 'Hide image lightbox for variable product', 'wc-variation-images' ),
'class' => 'ever-field-inline',
'type' => 'select',
'options' => array(
'id' => 'wc_variation_images_hide_image_lightbox',
'title' => __( 'Hide Lightbox', 'wc-variation-images' ),
'desc' => __( 'Hide image lightbox for variable product.', 'wc-variation-images' ),
'desc_tip' => __( 'Enable this option to hide the lightbox on the product page.', 'wc-variation-images' ),
'type' => 'select',
'options' => array(
'no' => __( 'No', 'wc-variation-images' ),
'yes' => __( 'Yes', 'wc-variation-images' ),
),
'default' => 'no',
'default' => 'no',
),
array(
'id' => 'wc_variation_images_hide_image_slider',
'title' => __( 'Hide Image Slider', 'wc-variation-images' ),
'desc' => __( 'Hide image slider for variable product', 'wc-variation-images' ),
'class' => 'ever-field-inline',
'type' => 'select',
'options' => array(
'id' => 'wc_variation_images_hide_image_slider',
'title' => __( 'Hide Image Slider', 'wc-variation-images' ),
'desc' => __( 'Hide image slider for variable product.', 'wc-variation-images' ),
'desc_tip' => __( 'Enable this option to hide the image slider for this specific variation on the frontend.', 'wc-variation-images' ),
'type' => 'select',
'options' => array(
'no' => __( 'No', 'wc-variation-images' ),
'yes' => __( 'Yes', 'wc-variation-images' ),
),
'default' => 'no',
'default' => 'no',
),
array(
'id' => 'wcvi_gallery_position',
'title' => __( 'Gallery Position', 'wc-variation-images' ),
'desc' => __( 'Set Gallery image position', 'wc-variation-images' ),
'desc_tip' => __( 'Set Gallery image position', 'wc-variation-images' ),
'desc' => __( 'Set product image position.', 'wc-variation-images' ),
'desc_tip' => __( 'Select the position of the product gallery on the product page.', 'wc-variation-images' ),
'type' => 'select',
'options' => Helpers::gallery_position_list(),
'default' => 'bottom',
Expand Down
2 changes: 1 addition & 1 deletion includes/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function gallery_template_override( $template, $template_name ) {
}

$product = wc_get_product();
if ( 'variable' === $product->get_type() ) {
if ( is_product() && 'variable' === $product->get_type() ) {
if ( 'single-product/product-image.php' === $template_name ) {
if ( 'no' === get_option( 'wc_variation_images_hide_image_slider', 'no' ) ) {
$template = WC_VARIATION_IMAGES_TEMPLATES_DIR . '/product-image-slider.php';
Expand Down
54 changes: 38 additions & 16 deletions languages/wc-variation-images.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WC Variation Images 1.2.0\n"
"Report-Msgid-Bugs-To: https://pluginever.com/support/\n"
"POT-Creation-Date: 2025-01-12 04:34:21+00:00\n"
"POT-Creation-Date: 2025-01-15 10:52:21+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -24,38 +24,42 @@ msgstr ""
"X-Textdomain-Support: yes\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"

#: includes/Admin/Admin.php:78 includes/Admin/Admin.php:80
#: includes/Admin/Admin.php:111 includes/Admin/Admin.php:112
#: includes/Admin/Admin.php:79 includes/Admin/Admin.php:81
#: includes/Admin/Admin.php:113 includes/Admin/Admin.php:114
#: includes/Products.php:147
msgid "Variation Images"
msgstr ""

#: includes/Admin/Admin.php:79
#: includes/Admin/Admin.php:80
msgid "Add Additional Images"
msgstr ""

#: includes/Admin/Admin.php:81
#: includes/Admin/Admin.php:82
msgid "Add to Variation"
msgstr ""

#: includes/Admin/Admin.php:82
#: includes/Admin/Admin.php:83
msgid "Upload limit 3 images in free version"
msgstr ""

#: includes/Admin/Admin.php:84
msgid ""
"Click on link below to add additional images. Click on image itself to "
"remove the image. Click and drag image to re-order the image position."
msgstr ""

#: includes/Admin/Admin.php:131
#: includes/Admin/Admin.php:133
#. translators: 1: Plugin name 2: WordPress
msgid ""
"Thank you for using %1$s. If you like it, please leave us a %2$s rating. A "
"huge thank you from PluginEver in advance!"
msgstr ""

#: includes/Admin/Admin.php:133
#: includes/Admin/Admin.php:135
msgid "Thanks :)"
msgstr ""

#: includes/Admin/Admin.php:151
#: includes/Admin/Admin.php:153
#. translators: 1: Plugin version
msgid "Version %s"
msgstr ""
Expand All @@ -77,7 +81,11 @@ msgid "Hide Image Zoom"
msgstr ""

#: includes/Admin/Settings.php:52
msgid "Hide image zoom for variable product"
msgid "Hide image zoom for variable product."
msgstr ""

#: includes/Admin/Settings.php:53
msgid "Check this box to disable the image zoom effect on hover for this product."
msgstr ""

#: includes/Admin/Settings.php:56 includes/Admin/Settings.php:68
Expand All @@ -95,23 +103,37 @@ msgid "Hide Lightbox"
msgstr ""

#: includes/Admin/Settings.php:64
msgid "Hide image lightbox for variable product"
msgid "Hide image lightbox for variable product."
msgstr ""

#: includes/Admin/Settings.php:65
msgid "Enable this option to hide the lightbox on the product page."
msgstr ""

#: includes/Admin/Settings.php:75
msgid "Hide Image Slider"
msgstr ""

#: includes/Admin/Settings.php:76
msgid "Hide image slider for variable product"
msgid "Hide image slider for variable product."
msgstr ""

#: includes/Admin/Settings.php:77
msgid ""
"Enable this option to hide the image slider for this specific variation on "
"the frontend."
msgstr ""

#: includes/Admin/Settings.php:87
msgid "Gallery Position"
msgstr ""

#: includes/Admin/Settings.php:88 includes/Admin/Settings.php:89
msgid "Set Gallery image position"
#: includes/Admin/Settings.php:88
msgid "Set product image position."
msgstr ""

#: includes/Admin/Settings.php:89
msgid "Select the position of the product gallery on the product page."
msgstr ""

#: includes/Admin/Settings.php:134
Expand Down Expand Up @@ -195,12 +217,12 @@ msgstr ""
msgid "Bottom"
msgstr ""

#: includes/Plugin.php:106
#: includes/Plugin.php:108
#. translators: 1: plugin name 2: WooCommerce
msgid "%1$s requires %2$s to be installed and active."
msgstr ""

#: includes/Plugin.php:108
#: includes/Plugin.php:110
msgid "WooCommerce"
msgstr ""

Expand Down
Loading

0 comments on commit 0659d63

Please sign in to comment.