Skip to content

Commit

Permalink
v3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kousikmukherjee committed May 28, 2024
1 parent 247751e commit 5430ae9
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 87 deletions.
41 changes: 15 additions & 26 deletions includes/class-alg-wc-wish-list-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Wish List for WooCommerce - Core Class.
*
* @version 3.0.1
* @version 3.0.2
* @since 1.0.0
* @author WPFactory.
*/
Expand All @@ -21,7 +21,7 @@ final class Alg_WC_Wish_List_Core {
* @var string
* @since 1.0.0
*/
public $version = '3.0.1';
public $version = '3.0.2';

/**
* @var Alg_WC_Wish_List_Core The single instance of the class
Expand Down Expand Up @@ -293,7 +293,7 @@ function __construct() {
*/
function declare_compatibility_with_hpos(){
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', ALG_WC_WL_PRO_FILEPATH, true );
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', ALG_WC_WL_FILEPATH, true );
}
}

Expand Down Expand Up @@ -578,18 +578,7 @@ public function add_description_wish_list( $params, $final_file, $path ) {
*/
public function handle_localization() {
$domain = 'wish-list-for-woocommerce';
load_plugin_textdomain( $domain, false, dirname( ALG_WC_WL_BASENAME ) . '/languages/' );

$locale = apply_filters( 'plugin_locale', is_admin() ? get_user_locale() : get_locale(), $domain );
if ( function_exists( 'pll_current_language' ) ) {
$locale = pll_current_language( 'locale' );
}

$loaded = load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $domain . '-' . $locale . '.mo' );
if ( ! $loaded ) {
$path = WP_PLUGIN_DIR . '/' . trim( dirname( ALG_WC_WL_PRO_BASENAME ) . '/languages/', '/' );
load_textdomain( $domain, $path . '/' . $domain . '-' . $locale . '.mo' );
}
load_plugin_textdomain( $domain, false, dirname( ALG_WC_WL_BASENAME ) . '/langs/' );
}

/**
Expand Down Expand Up @@ -620,7 +609,7 @@ public function woocommerce_locate_template( $template, $template_name, $templat
if ( strpos( $template_name, 'alg_wcwl' ) !== false ) {

$template_path = 'woocommerce';
$default_path = ALG_WC_WL_PRO_DIR . 'templates' . DIRECTORY_SEPARATOR;
$default_path = ALG_WC_WL_DIR . 'templates' . DIRECTORY_SEPARATOR;
$template = locate_template(
array(
trailingslashit( $template_path ) . $template_name,
Expand Down Expand Up @@ -699,9 +688,9 @@ private function handle_ajax() {
*/
public function locate_template( $final_file, $params, $path ) {
$located = locate_template( array(
ALG_WC_WL_PRO_FOLDER_NAME . DIRECTORY_SEPARATOR . $path,
ALG_WC_WL_FOLDER_NAME . DIRECTORY_SEPARATOR . $path,
) );
$plugin_path = ALG_WC_WL_PRO_DIR . 'templates' . DIRECTORY_SEPARATOR . $path;
$plugin_path = ALG_WC_WL_DIR . 'templates' . DIRECTORY_SEPARATOR . $path;
if ( ! $located && file_exists( $plugin_path ) ) {
$final_file = $plugin_path;
} elseif ( $located ) {
Expand Down Expand Up @@ -801,28 +790,28 @@ function enqueue_admin_scripts($hook){

// Fontawesome icon picker
$css_file = 'assets/vendor/fontawesome-iconpicker/css/fontawesome-iconpicker.min.css';
$css_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_PRO_DIR. $css_file ) );
wp_register_style( 'alg-wc-wl-fa-iconpicker', ALG_WC_WL_PRO_URL . $css_file, array(), $css_ver );
$css_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_DIR. $css_file ) );
wp_register_style( 'alg-wc-wl-fa-iconpicker', ALG_WC_WL_URL . $css_file, array(), $css_ver );
wp_enqueue_style( 'alg-wc-wl-fa-iconpicker' );
$js_file = 'assets/vendor/fontawesome-iconpicker/js/fontawesome-iconpicker.min.js';
$js_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_PRO_DIR . $js_file ) );
wp_register_script( 'alg-wc-wl-fa-iconpicker', ALG_WC_WL_PRO_URL . $js_file, array( 'jquery' ), $js_ver, true );
$js_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_DIR . $js_file ) );
wp_register_script( 'alg-wc-wl-fa-iconpicker', ALG_WC_WL_URL . $js_file, array( 'jquery' ), $js_ver, true );
wp_enqueue_script( 'alg-wc-wl-fa-iconpicker' );

// Color picker Alpha
$js_file = 'assets/vendor/color-picker-alpha/wp-color-picker-alpha.min.js';
$js_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_PRO_DIR . $js_file ) );
$js_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_DIR . $js_file ) );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker-alpha', ALG_WC_WL_PRO_URL . $js_file, array( 'wp-color-picker' ), $js_ver, true );
wp_enqueue_script( 'wp-color-picker-alpha', ALG_WC_WL_URL . $js_file, array( 'wp-color-picker' ), $js_ver, true );
wp_add_inline_script(
'wp-color-picker-alpha',
'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );'
);

// Main js file for admin
$js_file = 'assets/js/admin/alg-wc-wl-pro-admin.js';
$js_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_PRO_DIR . $js_file ) );
wp_register_script( 'alg-wc-wl-pro-admin', ALG_WC_WL_PRO_URL . $js_file, array( 'jquery','alg-wc-wl-fa-iconpicker' ), $js_ver, true );
$js_ver = date( "ymd-Gis", filemtime( ALG_WC_WL_DIR . $js_file ) );
wp_register_script( 'alg-wc-wl-pro-admin', ALG_WC_WL_URL . $js_file, array( 'jquery','alg-wc-wl-fa-iconpicker' ), $js_ver, true );
wp_enqueue_script( 'alg-wc-wl-pro-admin' );

?>
Expand Down
68 changes: 34 additions & 34 deletions langs/wish-list-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# This file is distributed under the GNU General Public License v3.0.
msgid ""
msgstr ""
"Project-Id-Version: wish-list-for-woocommerce 3.0.1\n"
"Project-Id-Version: wish-list-for-woocommerce 3.0.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wish-list-for-woocommerce\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-05-21T22:09:28+02:00\n"
"POT-Creation-Date: 2024-05-28T12:06:33+02:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Generator: WP-CLI 2.9.0\n"
"X-Domain: wish-list-for-woocommerce\n"

#. Plugin Name of the plugin
Expand Down Expand Up @@ -210,7 +210,7 @@ msgstr ""

#: includes/admin/class-alg-wc-wish-list-settings-admin.php:233
#: includes/admin/class-alg-wc-wish-list-settings-list.php:155
#: templates/wish-list.php:350
#: templates/wish-list.php:367
msgid "SKU"
msgstr ""

Expand Down Expand Up @@ -718,8 +718,8 @@ msgid "Show product stock"
msgstr ""

#: includes/admin/class-alg-wc-wish-list-settings-list.php:141
#: templates/wish-list.php:202
#: templates/wish-list.php:314
#: templates/wish-list.php:219
#: templates/wish-list.php:331
msgid "Price"
msgstr ""

Expand All @@ -740,7 +740,7 @@ msgid "Show product SKU"
msgstr ""

#: includes/admin/class-alg-wc-wish-list-settings-list.php:162
#: templates/wish-list.php:357
#: templates/wish-list.php:374
msgid "Quantity"
msgstr ""

Expand All @@ -749,7 +749,7 @@ msgid "Show product quantity"
msgstr ""

#: includes/admin/class-alg-wc-wish-list-settings-list.php:169
#: templates/wish-list.php:336
#: templates/wish-list.php:353
msgid "Description"
msgstr ""

Expand Down Expand Up @@ -788,7 +788,7 @@ msgstr ""
#: includes/admin/class-alg-wc-wish-list-settings-list.php:192
#: includes/admin/class-alg-wc-wish-list-settings-list.php:226
#: templates/alg_wcwl-subtotal.php:1
#: templates/wish-list.php:367
#: templates/wish-list.php:384
msgid "Subtotal"
msgstr ""

Expand Down Expand Up @@ -1148,7 +1148,7 @@ msgid "Style > Thumb button > Icon - Added"
msgstr ""

#: includes/admin/class-alg-wc-wish-list-settings-social.php:37
#: includes/class-alg-wc-wish-list-core.php:1157
#: includes/class-alg-wc-wish-list-core.php:1146
msgid "Share"
msgstr ""

Expand Down Expand Up @@ -1842,7 +1842,7 @@ msgid "The success notification after all items have been removed from wishlist.
msgstr ""

#: includes/admin/class-alg-wc-wish-list-settings-texts.php:172
#: includes/class-alg-wc-wish-list-core.php:989
#: includes/class-alg-wc-wish-list-core.php:978
msgid "All the items have been removed from your wishlist."
msgstr ""

Expand Down Expand Up @@ -1953,42 +1953,42 @@ msgstr ""
msgid "All the items have been removed from your wish list."
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:889
#: includes/class-alg-wc-wish-list-core.php:878
#: includes/pro/class-alg-wc-wish-list-pro-user-profile.php:92
#: templates/wish-list.php:36
#: templates/wish-list.php:38
msgid "The Wish list is empty."
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:988
#: includes/class-alg-wc-wish-list-core.php:977
#: includes/free/class-alg-wc-wish-list-ajax.php:377
#: includes/free/class-alg-wc-wish-list-ajax.php:531
#: includes/free/class-alg-wc-wish-list-email-sharing.php:196
#: includes/free/class-alg-wc-wish-list.php:180
msgid "Sorry, Some error occurred. Please, try again later."
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:1401
#: includes/class-alg-wc-wish-list-core.php:1390
msgid "Select Wishlist"
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:1407
#: includes/class-alg-wc-wish-list-core.php:1415
#: includes/class-alg-wc-wish-list-core.php:1396
#: includes/class-alg-wc-wish-list-core.php:1404
msgid "Create Wishlist"
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:1408
#: includes/class-alg-wc-wish-list-core.php:1397
msgid "Done"
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:1417
#: includes/class-alg-wc-wish-list-core.php:1406
msgid "Wishlist Name"
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:1421
#: includes/class-alg-wc-wish-list-core.php:1410
msgid "Save Wishlist"
msgstr ""

#: includes/class-alg-wc-wish-list-core.php:1422
#: includes/class-alg-wc-wish-list-core.php:1411
msgid "Cancel"
msgstr ""

Expand All @@ -2005,7 +2005,7 @@ msgid "Please <a class='alg-wc-wl-link' href=\"%s\">login</a> if you want to use
msgstr ""

#: includes/free/class-alg-wc-wish-list-ajax.php:631
#: templates/wish-list.php:152
#: templates/wish-list.php:169
msgid "Default Wishlist"
msgstr ""

Expand Down Expand Up @@ -2063,8 +2063,8 @@ msgstr ""

#: includes/free/class-alg-wc-wish-list-stock-email.php:121
msgid ""
"Hello {username}, \r\n"
"\r\n"
"Hello {username}, \n"
"\n"
"{product_name} is in stock. Please, check it out on {site_title}"
msgstr ""

Expand Down Expand Up @@ -2183,33 +2183,33 @@ msgstr ""
msgid "Submit"
msgstr ""

#: templates/wish-list.php:176
#: templates/wish-list.php:193
msgid "Delete Wishlist"
msgstr ""

#: templates/wish-list.php:198
#: templates/wish-list.php:296
#: templates/wish-list.php:215
#: templates/wish-list.php:313
msgid "Product"
msgstr ""

#: templates/wish-list.php:207
#: templates/wish-list.php:321
#: templates/wish-list.php:224
#: templates/wish-list.php:338
msgid "Category"
msgstr ""

#: templates/wish-list.php:252
#: templates/wish-list.php:397
#: templates/wish-list.php:269
#: templates/wish-list.php:414
msgid "Remove"
msgstr ""

#: templates/wish-list.php:266
#: templates/wish-list.php:283
msgid "Drag and drop"
msgstr ""

#: templates/wish-list.php:272
#: templates/wish-list.php:289
msgid "Sort"
msgstr ""

#: templates/wish-list.php:284
#: templates/wish-list.php:301
msgid "Thumbnail"
msgstr ""
23 changes: 20 additions & 3 deletions templates/wish-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Wish list template.
*
* @author WPFactory.
* @version 2.1.1
* @version 3.0.2
* @since 1.0.0
*/

Expand All @@ -13,6 +13,8 @@
?>

<?php
global $wp_query;
$theid = intval( $wp_query->queried_object->ID );

$the_query = $params['the_query'];
$can_remove_items = $params['can_remove_items'];
Expand Down Expand Up @@ -57,9 +59,24 @@
$show_product_thumb = filter_var( get_option( Alg_WC_Wish_List_Settings_List::OPTION_IMAGES_ON_EMAILS, 'no' ), FILTER_VALIDATE_BOOLEAN );
$email_table_params = 'border="1" style="width:100%;border-collapse: collapse;border:1px solid #ccc" cellpadding="15"';
}
$current_page_id = get_the_ID();

// $current_page_id = get_the_ID();

$current_page_id = $theid;
$wish_list_permalink = get_permalink( $current_page_id );

$wl_tab_slug = get_option( 'alg_wc_wl_tab_slug', 'my-wish-list' );
$query_string = '?';
if( is_wc_endpoint_url( $wl_tab_slug ) ) {
$structure = get_option( 'permalink_structure', '' );
if( $structure == '' ){
$wish_list_permalink = untrailingslashit( $wish_list_permalink ) .'&' . $wl_tab_slug;
$query_string = '&';
} else {
$wish_list_permalink = untrailingslashit( $wish_list_permalink ) .'/' . $wl_tab_slug;
$query_string = '?';
}
}

if ( is_user_logged_in() ) {
$user = wp_get_current_user();
Expand Down Expand Up @@ -162,7 +179,7 @@
}
?>
<div class="col-20per">
<button class="alg-wc-wl-tablink col-20per <?php echo $active ;?>" onclick="location.href='<?php echo $wish_list_permalink; ?>?wtab=<?php echo $tab_id; ?>'" id="defaultOpen"><?php echo $list; ?></button>
<button class="alg-wc-wl-tablink col-20per <?php echo $active ;?>" onclick="location.href='<?php echo $wish_list_permalink; ?><?php echo $query_string; ?>wtab=<?php echo $tab_id; ?>'" id="defaultOpen"><?php echo $list; ?></button>
</div>
<?php
}
Expand Down
Loading

0 comments on commit 5430ae9

Please sign in to comment.