Version Description
Release Date - 29 July 2019
- Fixed unclosed 'strong' tag in admin notification
- Fixed empty URL issue for sharing buttons
- Fixed performance for meta tags addition on wishlist page
- Fixed empty text issue for 'View Wishlist' button
- Removed Google Plus (G+) sharing option since the service is closed
- Added cleanup of deleted products from wishlist
- Added parameters to the 'tinvwl_get_wishlist_products' to get a custom products query results
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.13.1 |
Comparing to | |
See all releases |
Code changes from version 1.13.0 to 1.13.1
- admin/settings/general.class.php +1 -7
- admin/tinvwl.class.php +403 -403
- assets/css/admin.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.min.js +1 -1
- includes/product.helper.php +10 -0
- includes/wizard.class.php +0 -3
- languages/ti-woocommerce-wishlist.pot +48 -52
- public/tinvwl.class.php +1 -1
- public/wishlist/social.class.php +0 -13
- public/wishlist/view.class.php +39 -47
- readme.txt +12 -7
- ti-woocommerce-wishlist.php +2 -2
- tinv-wishlists-function.php +3 -2
- views/wizard/step-social.php +88 -97
admin/settings/general.class.php
CHANGED
@@ -193,7 +193,7 @@ class TInvWL_Admin_Settings_General extends TInvWL_Admin_BaseSection {
|
|
193 |
),
|
194 |
array(
|
195 |
'type' => 'text',
|
196 |
-
'name' => '
|
197 |
'text' => __( '"View Wishlist" button Text', 'ti-woocommerce-wishlist' ),
|
198 |
'std' => 'View Wishlist',
|
199 |
'class' => 'tiwl-button-show-notice',
|
@@ -666,12 +666,6 @@ class TInvWL_Admin_Settings_General extends TInvWL_Admin_BaseSection {
|
|
666 |
'text' => __( 'Show "Pinterest" Button', 'ti-woocommerce-wishlist' ),
|
667 |
'std' => true,
|
668 |
),
|
669 |
-
array(
|
670 |
-
'type' => 'checkboxonoff',
|
671 |
-
'name' => 'google',
|
672 |
-
'text' => __( 'Show "Google+" Button', 'ti-woocommerce-wishlist' ),
|
673 |
-
'std' => true,
|
674 |
-
),
|
675 |
array(
|
676 |
'type' => 'checkboxonoff',
|
677 |
'name' => 'whatsapp',
|
193 |
),
|
194 |
array(
|
195 |
'type' => 'text',
|
196 |
+
'name' => 'text_browse',
|
197 |
'text' => __( '"View Wishlist" button Text', 'ti-woocommerce-wishlist' ),
|
198 |
'std' => 'View Wishlist',
|
199 |
'class' => 'tiwl-button-show-notice',
|
666 |
'text' => __( 'Show "Pinterest" Button', 'ti-woocommerce-wishlist' ),
|
667 |
'std' => true,
|
668 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
array(
|
670 |
'type' => 'checkboxonoff',
|
671 |
'name' => 'whatsapp',
|
admin/tinvwl.class.php
CHANGED
@@ -1,403 +1,403 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin pages class
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package TInvWishlist\Admin
|
7 |
-
*/
|
8 |
-
|
9 |
-
// If this file is called directly, abort.
|
10 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
-
die;
|
12 |
-
}
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Admin pages class
|
16 |
-
*/
|
17 |
-
class TInvWL_Admin_TInvWL extends TInvWL_Admin_Base {
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Constructor
|
21 |
-
*
|
22 |
-
* @param string $plugin_name Plugin name.
|
23 |
-
* @param string $version Plugin version.
|
24 |
-
*/
|
25 |
-
function __construct( $plugin_name, $version ) {
|
26 |
-
$this->_name = $plugin_name;
|
27 |
-
$this->_version = $version;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Load functions.
|
32 |
-
* Create Wishlist and Product class.
|
33 |
-
* Load settings classes.
|
34 |
-
*/
|
35 |
-
function load_function() {
|
36 |
-
TII18n();
|
37 |
-
|
38 |
-
$this->load_settings();
|
39 |
-
|
40 |
-
$this->define_hooks();
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Load settings classes.
|
45 |
-
*
|
46 |
-
* @return boolean
|
47 |
-
*/
|
48 |
-
function load_settings() {
|
49 |
-
$dir = TINVWL_PATH . 'admin/settings/';
|
50 |
-
if ( ! file_exists( $dir ) || ! is_dir( $dir ) ) {
|
51 |
-
return false;
|
52 |
-
}
|
53 |
-
$files = scandir( $dir );
|
54 |
-
foreach ( $files as $value ) {
|
55 |
-
if ( preg_match( '/\.class\.php$/i', $value ) ) {
|
56 |
-
$file = preg_replace( '/\.class\.php$/i', '', $value );
|
57 |
-
$class = 'TInvWL_Admin_Settings_' . ucfirst( $file );
|
58 |
-
$class::instance( $this->_name, $this->_version );
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
return true;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Define hooks
|
67 |
-
*/
|
68 |
-
function define_hooks() {
|
69 |
-
add_action( 'admin_menu', array( $this, 'action_menu' ) );
|
70 |
-
if ( 'skip' === filter_input( INPUT_GET, $this->_name . '-wizard' ) ) {
|
71 |
-
update_option( $this->_name . '_wizard', true );
|
72 |
-
}
|
73 |
-
if ( ! get_option( $this->_name . '_wizard' ) ) {
|
74 |
-
add_action( 'admin_notices', array( $this, 'wizard_run_admin_notice' ) );
|
75 |
-
} elseif ( ! tinv_get_option( 'page', 'wishlist' ) ) {
|
76 |
-
add_action( 'admin_notices', array( $this, 'empty_page_admin_notice' ) );
|
77 |
-
}
|
78 |
-
add_action( 'woocommerce_system_status_report', array( $this, 'system_report_templates' ) );
|
79 |
-
|
80 |
-
add_action( 'switch_theme', array( $this, 'admin_notice_outdated_templates' ) );
|
81 |
-
add_action( 'tinvwl_updated', array( $this, 'admin_notice_outdated_templates' ) );
|
82 |
-
|
83 |
-
// Add a post display state for special WC pages.
|
84 |
-
add_filter( 'display_post_states', array( $this, 'add_display_post_states' ), 10, 2 );
|
85 |
-
|
86 |
-
add_action( 'tinvwl_admin_promo_footer', array( $this, 'promo_footer' ) );
|
87 |
-
add_action( 'tinvwl_remove_without_author_wishlist', array( $this, 'remove_old_wishlists' ) );
|
88 |
-
$this->scheduled_remove_wishlist();
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Error notice if wizard didn't run.
|
93 |
-
*/
|
94 |
-
function wizard_run_admin_notice() {
|
95 |
-
printf( '<div class="notice notice-error"><p>%1$s</p><p><a href="%2$s" class="button-primary">%3$s</a> <a href="%4$s" class="button-secondary">%5$s</a></p></div>',
|
96 |
-
__( '<strong>Welcome to WooCommerce Wishlist Plugin
|
97 |
-
esc_url( admin_url( 'index.php?page=tinvwl-wizard' ) ),
|
98 |
-
esc_html__( 'Run the Setup Wizard', 'ti-woocommerce-wishlist' ),
|
99 |
-
esc_url( admin_url( 'index.php?page=' . $this->_name . '&' . $this->_name . '-wizard=skip' ) ),
|
100 |
-
esc_html__( 'Skip Setup', 'ti-woocommerce-wishlist' )
|
101 |
-
);
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Error notice if wishlist page not set.
|
106 |
-
*/
|
107 |
-
function empty_page_admin_notice() {
|
108 |
-
printf( '<div class="notice notice-error is-dismissible" style="position: relative;"><h4>%1$s</h4><p>%2$s</p><ol><li>%3$s</li><li>%4$s</li><li>%5$s</li></ol><p><a href="%6$s">%7$s</a>%8$s<a href="%9$s">%10$s</a></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss', 'ti-woocommerce-wishlist' ) . '</span></button></div>', // @codingStandardsIgnoreLine WordPress.XSS.EscapeOutput.OutputNotEscaped
|
109 |
-
esc_html__( 'WooCommerce Wishlist Plugin is misconfigured!', 'ti-woocommerce-wishlist' ),
|
110 |
-
esc_html__( 'Since the Setup Wizard was skipped, the Wishlist may function improperly.', 'ti-woocommerce-wishlist' ),
|
111 |
-
esc_html__( 'Create a New Page or open to edit a page where the Wishlist should be displayed.', 'ti-woocommerce-wishlist' ),
|
112 |
-
__( 'Add <code>[ti_wishlistsview]</code> shortcode into a page content.', 'ti-woocommerce-wishlist' ),
|
113 |
-
esc_html__( 'In a plugin General Settings section apply this page as a "Wishlist" page.', 'ti-woocommerce-wishlist' ),
|
114 |
-
esc_url( $this->admin_url( '' ) . '#general' ),
|
115 |
-
esc_html__( 'Please apply the Wishlist page', 'ti-woocommerce-wishlist' ),
|
116 |
-
esc_html__( ' or ', 'ti-woocommerce-wishlist' ),
|
117 |
-
esc_url( admin_url( 'index.php?page=tinvwl-wizard' ) ),
|
118 |
-
esc_html__( 'Run the Setup Wizard', 'ti-woocommerce-wishlist' )
|
119 |
-
);
|
120 |
-
}
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Creation mune and sub-menu
|
124 |
-
*/
|
125 |
-
function action_menu() {
|
126 |
-
global $wp_roles;
|
127 |
-
$page = add_menu_page( 'TI Wishlist', 'TI Wishlist', 'tinvwl_general_settings', $this->_name, null, TINVWL_URL . 'assets/img/icon_menu.png', '55.888' );
|
128 |
-
add_action( "load-$page", array( $this, 'onload' ) );
|
129 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'add_inline_scripts' ) );
|
130 |
-
$menu = apply_filters( 'tinvwl_admin_menu', array() );
|
131 |
-
foreach ( $menu as $item ) {
|
132 |
-
if ( ! array_key_exists( 'page_title', $item ) ) {
|
133 |
-
$item['page_title'] = $item['title'];
|
134 |
-
}
|
135 |
-
if ( ! array_key_exists( 'parent', $item ) ) {
|
136 |
-
$item['parent'] = $this->_name;
|
137 |
-
}
|
138 |
-
if ( ! array_key_exists( 'capability', $item ) ) {
|
139 |
-
$item['capability'] = 'manage_woocommerce';
|
140 |
-
}
|
141 |
-
|
142 |
-
if ( ! array_key_exists( 'roles', $item ) ) {
|
143 |
-
$item['roles'] = array( 'administrator' );
|
144 |
-
}
|
145 |
-
|
146 |
-
foreach ( $item['roles'] as $role ) {
|
147 |
-
$wp_roles->add_cap( $role, $item['capability'] );
|
148 |
-
}
|
149 |
-
|
150 |
-
$item['slug'] = implode( '-', array_filter( array( $this->_name, $item['slug'] ) ) );
|
151 |
-
|
152 |
-
$page = add_submenu_page( $item['parent'], $item['page_title'], $item['title'], $item['capability'], $item['slug'], $item['method'] );
|
153 |
-
add_action( "load-$page", array( $this, 'onload' ) );
|
154 |
-
}
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Load style and javascript
|
159 |
-
*/
|
160 |
-
function onload() {
|
161 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
|
162 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
163 |
-
add_filter( 'admin_footer_text', array( $this, 'footer_admin' ) );
|
164 |
-
add_filter( 'screen_options_show_screen', array( $this, 'screen_options_hide_screen' ), 10, 2 );
|
165 |
-
|
166 |
-
add_filter( 'tinvwl_view_panelstatus', array( $this, 'status_panel' ), 9999 );
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Load style
|
171 |
-
*/
|
172 |
-
function enqueue_styles() {
|
173 |
-
wp_enqueue_style( 'gfonts', ( is_ssl() ? 'https' : 'http' ) . '://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800', '', null, 'all' );
|
174 |
-
wp_enqueue_style( $this->_name, TINVWL_URL . 'assets/css/admin.css', array(), $this->_version, 'all' );
|
175 |
-
wp_enqueue_style( $this->_name . '-form', TINVWL_URL . 'assets/css/admin-form.css', array(), $this->_version, 'all' );
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Load javascript
|
180 |
-
*/
|
181 |
-
function add_inline_scripts() {
|
182 |
-
wp_add_inline_script( 'jquery-blockui', 'jQuery(function(c){c("body").on("click.woo",\'a[href*="woocommerce.com"]\',function(o){var e=(((o||{}).originalEvent||{}).target||{}).href||!1,r=((o||{}).currentTarget||{}).href||!1,t="&";e&&r&&(o.currentTarget.href=e.split("?")[0]+"?utm_source=dashboard"+t+"aff=3955"+t+"utm_campaign=promo"+t+"cid=2034496"+t+"utm_medium=free",setTimeout(function(){o.originalEvent.target.href=e},1)),c("body").off("click.woo",\'a[href*="woocommerce.com"]\')})});' );
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Load javascript
|
187 |
-
*/
|
188 |
-
function enqueue_scripts() {
|
189 |
-
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
190 |
-
wp_enqueue_script( $this->_name . '-bootstrap', TINVWL_URL . 'assets/js/bootstrap' . $suffix . '.js', array( 'jquery' ), $this->_version, 'all' );
|
191 |
-
wp_register_script( $this->_name, TINVWL_URL . 'assets/js/admin' . $suffix . '.js', array(
|
192 |
-
'jquery',
|
193 |
-
'wp-color-picker',
|
194 |
-
), $this->_version, 'all' );
|
195 |
-
wp_localize_script( $this->_name, 'tinvwl_comfirm', array(
|
196 |
-
'text_comfirm_reset' => __( 'Are you sure you want to reset the settings?', 'ti-woocommerce-wishlist' ),
|
197 |
-
) );
|
198 |
-
wp_enqueue_script( $this->_name );
|
199 |
-
|
200 |
-
if ( ! tinv_get_option( 'chat', 'disabled' ) ) {
|
201 |
-
|
202 |
-
$geo = new WC_Geolocation(); // Get WC_Geolocation instance object
|
203 |
-
$user_ip = $geo->get_ip_address(); // Get user IP
|
204 |
-
$user_geo = $geo->geolocate_ip( $user_ip ); // Get geolocated user data.
|
205 |
-
$country_code = $user_geo['country']; // Get the country code
|
206 |
-
$restricted_codes = array( 'BD', 'PK', 'IN', 'NG', 'KE' );
|
207 |
-
|
208 |
-
if ( ! in_array( $country_code, $restricted_codes ) ) {
|
209 |
-
|
210 |
-
$user_id = get_current_user_id();
|
211 |
-
$user_info = get_userdata( $user_id );
|
212 |
-
$current_theme = wp_get_theme();
|
213 |
-
|
214 |
-
$parent_theme = $current_theme->parent();
|
215 |
-
|
216 |
-
wp_add_inline_script( $this->_name, 'window.intercomSettings = {
|
217 |
-
app_id: "wj7rirzi",
|
218 |
-
"Website": "' . get_site_url() . '",
|
219 |
-
"Plugin name": "WooCommerce Wishlist Plugin",
|
220 |
-
"Plugin version":"' . TINVWL_FVERSION . '",
|
221 |
-
"Theme name":"' . $current_theme->get( 'Name' ) . '",
|
222 |
-
"Theme version":"' . $current_theme->get( 'Version' ) . '",
|
223 |
-
"Theme URI":"' . $current_theme->get( 'ThemeURI' ) . '",
|
224 |
-
"Theme author":"' . $current_theme->get( 'Author' ) . '",
|
225 |
-
"Theme author URI":"' . $current_theme->get( 'AuthorURI' ) . '",
|
226 |
-
"Parent theme name":"' . ( ( $parent_theme ) ? $parent_theme->get( 'Name' ) : '' ) . '",
|
227 |
-
"Parent theme version":"' . ( ( $parent_theme ) ? $parent_theme->get( 'Version' ) : '' ) . '",
|
228 |
-
"Parent theme URI":"' . ( ( $parent_theme ) ? $parent_theme->get( 'ThemeURI' ) : '' ) . '",
|
229 |
-
"Parent theme author":"' . ( ( $parent_theme ) ? $parent_theme->get( 'Author' ) : '' ) . '",
|
230 |
-
"Parent theme author URI":"' . ( ( $parent_theme ) ? $parent_theme->get( 'AuthorURI' ) : '' ) . '",
|
231 |
-
};
|
232 |
-
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic("reattach_activator");ic("update",intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement("script");s.type="text/javascript";s.async=true;s.src="https://widget.intercom.io/widget/zyh6v0pc";var x=d.getElementsByTagName("script")[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent("onload",l);}else{w.addEventListener("load",l,false);}}})();
|
233 |
-
Intercom("trackEvent", "wishlist-free-install", {
|
234 |
-
theme_name:"' . ( ( $parent_theme ) ? $parent_theme->get( 'Name' ) : $current_theme->get( 'Name' ) ) . '",
|
235 |
-
theme_uri:"' . ( ( $parent_theme ) ? $parent_theme->get( 'ThemeURI' ) : $current_theme->get( 'ThemeURI' ) ) . '",
|
236 |
-
theme_author:"' . ( ( $parent_theme ) ? $parent_theme->get( 'Author' ) : $current_theme->get( 'Author' ) ) . '",
|
237 |
-
theme_author_uri:"' . ( ( $parent_theme ) ? $parent_theme->get( 'AuthorURI' ) : $current_theme->get( 'AuthorURI' ) ) . '",
|
238 |
-
theme_version:"' . ( ( $parent_theme ) ? $parent_theme->get( 'Version' ) : $current_theme->get( 'Version' ) ) . '",
|
239 |
-
website:"' . get_site_url() . '",
|
240 |
-
user:"' . $user_info->user_email . '",
|
241 |
-
user_name:"' . $user_info->user_nicename . '",
|
242 |
-
plugin_name:"WooCommerce Wishlist Plugin",
|
243 |
-
plugin_version:"' . TINVWL_FVERSION . '",
|
244 |
-
partner:"' . TINVWL_UTM_SOURCE . '"
|
245 |
-
});
|
246 |
-
' );
|
247 |
-
}
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
/**
|
252 |
-
* Add plugin footer copywriting
|
253 |
-
*/
|
254 |
-
function footer_admin() {
|
255 |
-
do_action( 'tinvwl_admin_promo_footer' );
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Promo in footer for wishlist
|
260 |
-
*/
|
261 |
-
function promo_footer() {
|
262 |
-
echo 'Made with <i class="ftinvwl ftinvwl-heart2"></i> by <a href="https://templateinvaders.com/?utm_source=' . TINVWL_UTM_SOURCE . '&utm_campaign=' . TINVWL_UTM_CAMPAIGN . '&utm_medium=' . TINVWL_UTM_MEDIUM . '&utm_content=made_by&partner=' . TINVWL_UTM_SOURCE . '">TemplateInvaders</a><br />If you like WooCommerce Wishlist Plugin please leave us a <a href="https://wordpress.org/support/plugin/ti-woocommerce-wishlist/reviews/#new-post"><span><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i></span></a> rating.'; // WPCS: xss ok.
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Create Upgrade button
|
267 |
-
*
|
268 |
-
* @param array $panel Panel Button.
|
269 |
-
*
|
270 |
-
* @return array
|
271 |
-
*/
|
272 |
-
function status_panel( $panel ) {
|
273 |
-
array_unshift( $panel, sprintf( '<a class="tinvwl-btn red w-icon smaller-txt" href="%s"><i class="ftinvwl ftinvwl-star"></i><span class="tinvwl-txt">%s</span></a>', 'https://templateinvaders.com/product/ti-woocommerce-wishlist-wordpress-plugin/?utm_source=' . TINVWL_UTM_SOURCE . '&utm_campaign=' . TINVWL_UTM_CAMPAIGN . '&utm_medium=' . TINVWL_UTM_MEDIUM . '&utm_content=header_upgrade&partner=' . TINVWL_UTM_SOURCE, __( 'Upgrade to Premium', 'ti-woocommerce-wishlist' ) ) );
|
274 |
-
|
275 |
-
return $panel;
|
276 |
-
}
|
277 |
-
|
278 |
-
/**
|
279 |
-
* Templates overriding status check.
|
280 |
-
*
|
281 |
-
* @param boolean $outdated Out date status.
|
282 |
-
*
|
283 |
-
* @return string
|
284 |
-
*/
|
285 |
-
function templates_status_check( $outdated = false ) {
|
286 |
-
|
287 |
-
$found_files = array();
|
288 |
-
|
289 |
-
$scanned_files = WC_Admin_Status::scan_template_files( TINVWL_PATH . '/templates/' );
|
290 |
-
|
291 |
-
foreach ( $scanned_files as $file ) {
|
292 |
-
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
293 |
-
$theme_file = get_stylesheet_directory() . '/' . $file;
|
294 |
-
} elseif ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
|
295 |
-
$theme_file = get_stylesheet_directory() . '/woocommerce/' . $file;
|
296 |
-
} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
|
297 |
-
$theme_file = get_template_directory() . '/' . $file;
|
298 |
-
} elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
|
299 |
-
$theme_file = get_template_directory() . '/woocommerce/' . $file;
|
300 |
-
} else {
|
301 |
-
$theme_file = false;
|
302 |
-
}
|
303 |
-
|
304 |
-
if ( ! empty( $theme_file ) ) {
|
305 |
-
$core_version = WC_Admin_Status::get_file_version( TINVWL_PATH . '/templates/' . $file );
|
306 |
-
$theme_version = WC_Admin_Status::get_file_version( $theme_file );
|
307 |
-
|
308 |
-
if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) {
|
309 |
-
if ( $outdated ) {
|
310 |
-
return 'outdated';
|
311 |
-
}
|
312 |
-
$found_files[] = sprintf( __( '<code>%1$s</code> version <strong style="color:red">%2$s</strong> is out of date. The core version is <strong style="color:red">%3$s</strong>', 'ti-woocommerce-wishlist' ), str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ), $theme_version ? $theme_version : '-', $core_version );
|
313 |
-
} else {
|
314 |
-
$found_files[] = str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file );
|
315 |
-
}
|
316 |
-
}
|
317 |
-
}
|
318 |
-
|
319 |
-
return $found_files;
|
320 |
-
}
|
321 |
-
|
322 |
-
/**
|
323 |
-
* Templates overriding status for WooCommerce Status report page.
|
324 |
-
*/
|
325 |
-
function system_report_templates() {
|
326 |
-
|
327 |
-
TInvWL_View::view( 'templates-status', array( 'found_files' => $this->templates_status_check() ) );
|
328 |
-
}
|
329 |
-
|
330 |
-
/**
|
331 |
-
* Outdated templates notice.
|
332 |
-
*/
|
333 |
-
function admin_notice_outdated_templates() {
|
334 |
-
if ( 'outdated' === $this->templates_status_check( true ) ) {
|
335 |
-
|
336 |
-
$theme = wp_get_theme();
|
337 |
-
|
338 |
-
$html = sprintf( __( '<strong>Your theme (%1$s) contains outdated copies of some WooCommerce Wishlist Plugin template files.</strong><br> These files may need updating to ensure they are compatible with the current version of WooCommerce Wishlist Plugin.<br> You can see which files are affected from the <a href="%2$s">system status page</a>.<br> If in doubt, check with the author of the theme.', 'ti-woocommerce-wishlist' ), esc_html( $theme['Name'] ), esc_url( admin_url( 'admin.php?page=wc-status' ) ) );
|
339 |
-
|
340 |
-
WC_Admin_Notices::add_custom_notice( 'outdated_templates', $html );
|
341 |
-
} else {
|
342 |
-
WC_Admin_Notices::remove_notice( 'outdated_templates' );
|
343 |
-
}
|
344 |
-
}
|
345 |
-
|
346 |
-
/**
|
347 |
-
* Disable screen option on plugin pages
|
348 |
-
*
|
349 |
-
* @param boolean $show_screen Show screen.
|
350 |
-
* @param \WP_Screen $_this Screen option page.
|
351 |
-
*
|
352 |
-
* @return boolean
|
353 |
-
*/
|
354 |
-
function screen_options_hide_screen( $show_screen, $_this ) {
|
355 |
-
if ( $this->_name === $_this->parent_base || $this->_name === $_this->parent_file ) {
|
356 |
-
return false;
|
357 |
-
}
|
358 |
-
|
359 |
-
return $show_screen;
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Check if there is a hook in the cron
|
364 |
-
*/
|
365 |
-
function scheduled_remove_wishlist() {
|
366 |
-
$timestamp = wp_next_scheduled( 'tinvwl_remove_without_author_wishlist' );
|
367 |
-
if ( ! $timestamp ) {
|
368 |
-
$time = strtotime( '00:00 today +1 HOURS' );
|
369 |
-
wp_schedule_event( $time, 'daily', 'tinvwl_remove_without_author_wishlist' );
|
370 |
-
}
|
371 |
-
}
|
372 |
-
|
373 |
-
/**
|
374 |
-
* Removing old wishlist without a user older than 34 days
|
375 |
-
*/
|
376 |
-
public function remove_old_wishlists() {
|
377 |
-
$wl = new TInvWL_Wishlist();
|
378 |
-
$wishlists = $wl->get( array(
|
379 |
-
'author' => 0,
|
380 |
-
'type' => 'default',
|
381 |
-
'sql' => 'SELECT * FROM {table} {where} AND `date` < DATE_SUB( CURDATE(), INTERVAL 34 DAY)',
|
382 |
-
) );
|
383 |
-
foreach ( $wishlists as $wishlist ) {
|
384 |
-
$wl->remove( $wishlist['ID'] );
|
385 |
-
}
|
386 |
-
}
|
387 |
-
|
388 |
-
/**
|
389 |
-
* Add a post display state for special WC pages in the page list table.
|
390 |
-
*
|
391 |
-
* @param array $post_states An array of post display states.
|
392 |
-
* @param WP_Post $post The current post object.
|
393 |
-
*
|
394 |
-
* @return array
|
395 |
-
*/
|
396 |
-
public function add_display_post_states( $post_states, $post ) {
|
397 |
-
if ( tinv_get_option( 'page', 'wishlist' ) === $post->ID ) {
|
398 |
-
$post_states['tinvwl_page_for_wishlist'] = __( 'Wishlist Page', 'ti-woocommerce-wishlist' );
|
399 |
-
}
|
400 |
-
|
401 |
-
return $post_states;
|
402 |
-
}
|
403 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin pages class
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package TInvWishlist\Admin
|
7 |
+
*/
|
8 |
+
|
9 |
+
// If this file is called directly, abort.
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
die;
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Admin pages class
|
16 |
+
*/
|
17 |
+
class TInvWL_Admin_TInvWL extends TInvWL_Admin_Base {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructor
|
21 |
+
*
|
22 |
+
* @param string $plugin_name Plugin name.
|
23 |
+
* @param string $version Plugin version.
|
24 |
+
*/
|
25 |
+
function __construct( $plugin_name, $version ) {
|
26 |
+
$this->_name = $plugin_name;
|
27 |
+
$this->_version = $version;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Load functions.
|
32 |
+
* Create Wishlist and Product class.
|
33 |
+
* Load settings classes.
|
34 |
+
*/
|
35 |
+
function load_function() {
|
36 |
+
TII18n();
|
37 |
+
|
38 |
+
$this->load_settings();
|
39 |
+
|
40 |
+
$this->define_hooks();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Load settings classes.
|
45 |
+
*
|
46 |
+
* @return boolean
|
47 |
+
*/
|
48 |
+
function load_settings() {
|
49 |
+
$dir = TINVWL_PATH . 'admin/settings/';
|
50 |
+
if ( ! file_exists( $dir ) || ! is_dir( $dir ) ) {
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
$files = scandir( $dir );
|
54 |
+
foreach ( $files as $value ) {
|
55 |
+
if ( preg_match( '/\.class\.php$/i', $value ) ) {
|
56 |
+
$file = preg_replace( '/\.class\.php$/i', '', $value );
|
57 |
+
$class = 'TInvWL_Admin_Settings_' . ucfirst( $file );
|
58 |
+
$class::instance( $this->_name, $this->_version );
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
return true;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Define hooks
|
67 |
+
*/
|
68 |
+
function define_hooks() {
|
69 |
+
add_action( 'admin_menu', array( $this, 'action_menu' ) );
|
70 |
+
if ( 'skip' === filter_input( INPUT_GET, $this->_name . '-wizard' ) ) {
|
71 |
+
update_option( $this->_name . '_wizard', true );
|
72 |
+
}
|
73 |
+
if ( ! get_option( $this->_name . '_wizard' ) ) {
|
74 |
+
add_action( 'admin_notices', array( $this, 'wizard_run_admin_notice' ) );
|
75 |
+
} elseif ( ! tinv_get_option( 'page', 'wishlist' ) ) {
|
76 |
+
add_action( 'admin_notices', array( $this, 'empty_page_admin_notice' ) );
|
77 |
+
}
|
78 |
+
add_action( 'woocommerce_system_status_report', array( $this, 'system_report_templates' ) );
|
79 |
+
|
80 |
+
add_action( 'switch_theme', array( $this, 'admin_notice_outdated_templates' ) );
|
81 |
+
add_action( 'tinvwl_updated', array( $this, 'admin_notice_outdated_templates' ) );
|
82 |
+
|
83 |
+
// Add a post display state for special WC pages.
|
84 |
+
add_filter( 'display_post_states', array( $this, 'add_display_post_states' ), 10, 2 );
|
85 |
+
|
86 |
+
add_action( 'tinvwl_admin_promo_footer', array( $this, 'promo_footer' ) );
|
87 |
+
add_action( 'tinvwl_remove_without_author_wishlist', array( $this, 'remove_old_wishlists' ) );
|
88 |
+
$this->scheduled_remove_wishlist();
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Error notice if wizard didn't run.
|
93 |
+
*/
|
94 |
+
function wizard_run_admin_notice() {
|
95 |
+
printf( '<div class="notice notice-error"><p>%1$s</p><p><a href="%2$s" class="button-primary">%3$s</a> <a href="%4$s" class="button-secondary">%5$s</a></p></div>',
|
96 |
+
__( '<strong>Welcome to WooCommerce Wishlist Plugin</strong> – You‘re almost ready to start :)', 'ti-woocommerce-wishlist' ), // @codingStandardsIgnoreLine WordPress.XSS.EscapeOutput.OutputNotEscaped
|
97 |
+
esc_url( admin_url( 'index.php?page=tinvwl-wizard' ) ),
|
98 |
+
esc_html__( 'Run the Setup Wizard', 'ti-woocommerce-wishlist' ),
|
99 |
+
esc_url( admin_url( 'index.php?page=' . $this->_name . '&' . $this->_name . '-wizard=skip' ) ),
|
100 |
+
esc_html__( 'Skip Setup', 'ti-woocommerce-wishlist' )
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Error notice if wishlist page not set.
|
106 |
+
*/
|
107 |
+
function empty_page_admin_notice() {
|
108 |
+
printf( '<div class="notice notice-error is-dismissible" style="position: relative;"><h4>%1$s</h4><p>%2$s</p><ol><li>%3$s</li><li>%4$s</li><li>%5$s</li></ol><p><a href="%6$s">%7$s</a>%8$s<a href="%9$s">%10$s</a></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss', 'ti-woocommerce-wishlist' ) . '</span></button></div>', // @codingStandardsIgnoreLine WordPress.XSS.EscapeOutput.OutputNotEscaped
|
109 |
+
esc_html__( 'WooCommerce Wishlist Plugin is misconfigured!', 'ti-woocommerce-wishlist' ),
|
110 |
+
esc_html__( 'Since the Setup Wizard was skipped, the Wishlist may function improperly.', 'ti-woocommerce-wishlist' ),
|
111 |
+
esc_html__( 'Create a New Page or open to edit a page where the Wishlist should be displayed.', 'ti-woocommerce-wishlist' ),
|
112 |
+
__( 'Add <code>[ti_wishlistsview]</code> shortcode into a page content.', 'ti-woocommerce-wishlist' ),
|
113 |
+
esc_html__( 'In a plugin General Settings section apply this page as a "Wishlist" page.', 'ti-woocommerce-wishlist' ),
|
114 |
+
esc_url( $this->admin_url( '' ) . '#general' ),
|
115 |
+
esc_html__( 'Please apply the Wishlist page', 'ti-woocommerce-wishlist' ),
|
116 |
+
esc_html__( ' or ', 'ti-woocommerce-wishlist' ),
|
117 |
+
esc_url( admin_url( 'index.php?page=tinvwl-wizard' ) ),
|
118 |
+
esc_html__( 'Run the Setup Wizard', 'ti-woocommerce-wishlist' )
|
119 |
+
);
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Creation mune and sub-menu
|
124 |
+
*/
|
125 |
+
function action_menu() {
|
126 |
+
global $wp_roles;
|
127 |
+
$page = add_menu_page( 'TI Wishlist', 'TI Wishlist', 'tinvwl_general_settings', $this->_name, null, TINVWL_URL . 'assets/img/icon_menu.png', '55.888' );
|
128 |
+
add_action( "load-$page", array( $this, 'onload' ) );
|
129 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'add_inline_scripts' ) );
|
130 |
+
$menu = apply_filters( 'tinvwl_admin_menu', array() );
|
131 |
+
foreach ( $menu as $item ) {
|
132 |
+
if ( ! array_key_exists( 'page_title', $item ) ) {
|
133 |
+
$item['page_title'] = $item['title'];
|
134 |
+
}
|
135 |
+
if ( ! array_key_exists( 'parent', $item ) ) {
|
136 |
+
$item['parent'] = $this->_name;
|
137 |
+
}
|
138 |
+
if ( ! array_key_exists( 'capability', $item ) ) {
|
139 |
+
$item['capability'] = 'manage_woocommerce';
|
140 |
+
}
|
141 |
+
|
142 |
+
if ( ! array_key_exists( 'roles', $item ) ) {
|
143 |
+
$item['roles'] = array( 'administrator' );
|
144 |
+
}
|
145 |
+
|
146 |
+
foreach ( $item['roles'] as $role ) {
|
147 |
+
$wp_roles->add_cap( $role, $item['capability'] );
|
148 |
+
}
|
149 |
+
|
150 |
+
$item['slug'] = implode( '-', array_filter( array( $this->_name, $item['slug'] ) ) );
|
151 |
+
|
152 |
+
$page = add_submenu_page( $item['parent'], $item['page_title'], $item['title'], $item['capability'], $item['slug'], $item['method'] );
|
153 |
+
add_action( "load-$page", array( $this, 'onload' ) );
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Load style and javascript
|
159 |
+
*/
|
160 |
+
function onload() {
|
161 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
|
162 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
163 |
+
add_filter( 'admin_footer_text', array( $this, 'footer_admin' ) );
|
164 |
+
add_filter( 'screen_options_show_screen', array( $this, 'screen_options_hide_screen' ), 10, 2 );
|
165 |
+
|
166 |
+
add_filter( 'tinvwl_view_panelstatus', array( $this, 'status_panel' ), 9999 );
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Load style
|
171 |
+
*/
|
172 |
+
function enqueue_styles() {
|
173 |
+
wp_enqueue_style( 'gfonts', ( is_ssl() ? 'https' : 'http' ) . '://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800', '', null, 'all' );
|
174 |
+
wp_enqueue_style( $this->_name, TINVWL_URL . 'assets/css/admin.css', array(), $this->_version, 'all' );
|
175 |
+
wp_enqueue_style( $this->_name . '-form', TINVWL_URL . 'assets/css/admin-form.css', array(), $this->_version, 'all' );
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Load javascript
|
180 |
+
*/
|
181 |
+
function add_inline_scripts() {
|
182 |
+
wp_add_inline_script( 'jquery-blockui', 'jQuery(function(c){c("body").on("click.woo",\'a[href*="woocommerce.com"]\',function(o){var e=(((o||{}).originalEvent||{}).target||{}).href||!1,r=((o||{}).currentTarget||{}).href||!1,t="&";e&&r&&(o.currentTarget.href=e.split("?")[0]+"?utm_source=dashboard"+t+"aff=3955"+t+"utm_campaign=promo"+t+"cid=2034496"+t+"utm_medium=free",setTimeout(function(){o.originalEvent.target.href=e},1)),c("body").off("click.woo",\'a[href*="woocommerce.com"]\')})});' );
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Load javascript
|
187 |
+
*/
|
188 |
+
function enqueue_scripts() {
|
189 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
190 |
+
wp_enqueue_script( $this->_name . '-bootstrap', TINVWL_URL . 'assets/js/bootstrap' . $suffix . '.js', array( 'jquery' ), $this->_version, 'all' );
|
191 |
+
wp_register_script( $this->_name, TINVWL_URL . 'assets/js/admin' . $suffix . '.js', array(
|
192 |
+
'jquery',
|
193 |
+
'wp-color-picker',
|
194 |
+
), $this->_version, 'all' );
|
195 |
+
wp_localize_script( $this->_name, 'tinvwl_comfirm', array(
|
196 |
+
'text_comfirm_reset' => __( 'Are you sure you want to reset the settings?', 'ti-woocommerce-wishlist' ),
|
197 |
+
) );
|
198 |
+
wp_enqueue_script( $this->_name );
|
199 |
+
|
200 |
+
if ( ! tinv_get_option( 'chat', 'disabled' ) ) {
|
201 |
+
|
202 |
+
$geo = new WC_Geolocation(); // Get WC_Geolocation instance object
|
203 |
+
$user_ip = $geo->get_ip_address(); // Get user IP
|
204 |
+
$user_geo = $geo->geolocate_ip( $user_ip ); // Get geolocated user data.
|
205 |
+
$country_code = $user_geo['country']; // Get the country code
|
206 |
+
$restricted_codes = array( 'BD', 'PK', 'IN', 'NG', 'KE' );
|
207 |
+
|
208 |
+
if ( ! in_array( $country_code, $restricted_codes ) ) {
|
209 |
+
|
210 |
+
$user_id = get_current_user_id();
|
211 |
+
$user_info = get_userdata( $user_id );
|
212 |
+
$current_theme = wp_get_theme();
|
213 |
+
|
214 |
+
$parent_theme = $current_theme->parent();
|
215 |
+
|
216 |
+
wp_add_inline_script( $this->_name, 'window.intercomSettings = {
|
217 |
+
app_id: "wj7rirzi",
|
218 |
+
"Website": "' . get_site_url() . '",
|
219 |
+
"Plugin name": "WooCommerce Wishlist Plugin",
|
220 |
+
"Plugin version":"' . TINVWL_FVERSION . '",
|
221 |
+
"Theme name":"' . $current_theme->get( 'Name' ) . '",
|
222 |
+
"Theme version":"' . $current_theme->get( 'Version' ) . '",
|
223 |
+
"Theme URI":"' . $current_theme->get( 'ThemeURI' ) . '",
|
224 |
+
"Theme author":"' . $current_theme->get( 'Author' ) . '",
|
225 |
+
"Theme author URI":"' . $current_theme->get( 'AuthorURI' ) . '",
|
226 |
+
"Parent theme name":"' . ( ( $parent_theme ) ? $parent_theme->get( 'Name' ) : '' ) . '",
|
227 |
+
"Parent theme version":"' . ( ( $parent_theme ) ? $parent_theme->get( 'Version' ) : '' ) . '",
|
228 |
+
"Parent theme URI":"' . ( ( $parent_theme ) ? $parent_theme->get( 'ThemeURI' ) : '' ) . '",
|
229 |
+
"Parent theme author":"' . ( ( $parent_theme ) ? $parent_theme->get( 'Author' ) : '' ) . '",
|
230 |
+
"Parent theme author URI":"' . ( ( $parent_theme ) ? $parent_theme->get( 'AuthorURI' ) : '' ) . '",
|
231 |
+
};
|
232 |
+
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic("reattach_activator");ic("update",intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement("script");s.type="text/javascript";s.async=true;s.src="https://widget.intercom.io/widget/zyh6v0pc";var x=d.getElementsByTagName("script")[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent("onload",l);}else{w.addEventListener("load",l,false);}}})();
|
233 |
+
Intercom("trackEvent", "wishlist-free-install", {
|
234 |
+
theme_name:"' . ( ( $parent_theme ) ? $parent_theme->get( 'Name' ) : $current_theme->get( 'Name' ) ) . '",
|
235 |
+
theme_uri:"' . ( ( $parent_theme ) ? $parent_theme->get( 'ThemeURI' ) : $current_theme->get( 'ThemeURI' ) ) . '",
|
236 |
+
theme_author:"' . ( ( $parent_theme ) ? $parent_theme->get( 'Author' ) : $current_theme->get( 'Author' ) ) . '",
|
237 |
+
theme_author_uri:"' . ( ( $parent_theme ) ? $parent_theme->get( 'AuthorURI' ) : $current_theme->get( 'AuthorURI' ) ) . '",
|
238 |
+
theme_version:"' . ( ( $parent_theme ) ? $parent_theme->get( 'Version' ) : $current_theme->get( 'Version' ) ) . '",
|
239 |
+
website:"' . get_site_url() . '",
|
240 |
+
user:"' . $user_info->user_email . '",
|
241 |
+
user_name:"' . $user_info->user_nicename . '",
|
242 |
+
plugin_name:"WooCommerce Wishlist Plugin",
|
243 |
+
plugin_version:"' . TINVWL_FVERSION . '",
|
244 |
+
partner:"' . TINVWL_UTM_SOURCE . '"
|
245 |
+
});
|
246 |
+
' );
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Add plugin footer copywriting
|
253 |
+
*/
|
254 |
+
function footer_admin() {
|
255 |
+
do_action( 'tinvwl_admin_promo_footer' );
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Promo in footer for wishlist
|
260 |
+
*/
|
261 |
+
function promo_footer() {
|
262 |
+
echo 'Made with <i class="ftinvwl ftinvwl-heart2"></i> by <a href="https://templateinvaders.com/?utm_source=' . TINVWL_UTM_SOURCE . '&utm_campaign=' . TINVWL_UTM_CAMPAIGN . '&utm_medium=' . TINVWL_UTM_MEDIUM . '&utm_content=made_by&partner=' . TINVWL_UTM_SOURCE . '">TemplateInvaders</a><br />If you like WooCommerce Wishlist Plugin please leave us a <a href="https://wordpress.org/support/plugin/ti-woocommerce-wishlist/reviews/#new-post"><span><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i><i class="ftinvwl ftinvwl-star"></i></span></a> rating.'; // WPCS: xss ok.
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Create Upgrade button
|
267 |
+
*
|
268 |
+
* @param array $panel Panel Button.
|
269 |
+
*
|
270 |
+
* @return array
|
271 |
+
*/
|
272 |
+
function status_panel( $panel ) {
|
273 |
+
array_unshift( $panel, sprintf( '<a class="tinvwl-btn red w-icon smaller-txt" href="%s"><i class="ftinvwl ftinvwl-star"></i><span class="tinvwl-txt">%s</span></a>', 'https://templateinvaders.com/product/ti-woocommerce-wishlist-wordpress-plugin/?utm_source=' . TINVWL_UTM_SOURCE . '&utm_campaign=' . TINVWL_UTM_CAMPAIGN . '&utm_medium=' . TINVWL_UTM_MEDIUM . '&utm_content=header_upgrade&partner=' . TINVWL_UTM_SOURCE, __( 'Upgrade to Premium', 'ti-woocommerce-wishlist' ) ) );
|
274 |
+
|
275 |
+
return $panel;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Templates overriding status check.
|
280 |
+
*
|
281 |
+
* @param boolean $outdated Out date status.
|
282 |
+
*
|
283 |
+
* @return string
|
284 |
+
*/
|
285 |
+
function templates_status_check( $outdated = false ) {
|
286 |
+
|
287 |
+
$found_files = array();
|
288 |
+
|
289 |
+
$scanned_files = WC_Admin_Status::scan_template_files( TINVWL_PATH . '/templates/' );
|
290 |
+
|
291 |
+
foreach ( $scanned_files as $file ) {
|
292 |
+
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
293 |
+
$theme_file = get_stylesheet_directory() . '/' . $file;
|
294 |
+
} elseif ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
|
295 |
+
$theme_file = get_stylesheet_directory() . '/woocommerce/' . $file;
|
296 |
+
} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
|
297 |
+
$theme_file = get_template_directory() . '/' . $file;
|
298 |
+
} elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
|
299 |
+
$theme_file = get_template_directory() . '/woocommerce/' . $file;
|
300 |
+
} else {
|
301 |
+
$theme_file = false;
|
302 |
+
}
|
303 |
+
|
304 |
+
if ( ! empty( $theme_file ) ) {
|
305 |
+
$core_version = WC_Admin_Status::get_file_version( TINVWL_PATH . '/templates/' . $file );
|
306 |
+
$theme_version = WC_Admin_Status::get_file_version( $theme_file );
|
307 |
+
|
308 |
+
if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) {
|
309 |
+
if ( $outdated ) {
|
310 |
+
return 'outdated';
|
311 |
+
}
|
312 |
+
$found_files[] = sprintf( __( '<code>%1$s</code> version <strong style="color:red">%2$s</strong> is out of date. The core version is <strong style="color:red">%3$s</strong>', 'ti-woocommerce-wishlist' ), str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ), $theme_version ? $theme_version : '-', $core_version );
|
313 |
+
} else {
|
314 |
+
$found_files[] = str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file );
|
315 |
+
}
|
316 |
+
}
|
317 |
+
}
|
318 |
+
|
319 |
+
return $found_files;
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Templates overriding status for WooCommerce Status report page.
|
324 |
+
*/
|
325 |
+
function system_report_templates() {
|
326 |
+
|
327 |
+
TInvWL_View::view( 'templates-status', array( 'found_files' => $this->templates_status_check() ) );
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Outdated templates notice.
|
332 |
+
*/
|
333 |
+
function admin_notice_outdated_templates() {
|
334 |
+
if ( 'outdated' === $this->templates_status_check( true ) ) {
|
335 |
+
|
336 |
+
$theme = wp_get_theme();
|
337 |
+
|
338 |
+
$html = sprintf( __( '<strong>Your theme (%1$s) contains outdated copies of some WooCommerce Wishlist Plugin template files.</strong><br> These files may need updating to ensure they are compatible with the current version of WooCommerce Wishlist Plugin.<br> You can see which files are affected from the <a href="%2$s">system status page</a>.<br> If in doubt, check with the author of the theme.', 'ti-woocommerce-wishlist' ), esc_html( $theme['Name'] ), esc_url( admin_url( 'admin.php?page=wc-status' ) ) );
|
339 |
+
|
340 |
+
WC_Admin_Notices::add_custom_notice( 'outdated_templates', $html );
|
341 |
+
} else {
|
342 |
+
WC_Admin_Notices::remove_notice( 'outdated_templates' );
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Disable screen option on plugin pages
|
348 |
+
*
|
349 |
+
* @param boolean $show_screen Show screen.
|
350 |
+
* @param \WP_Screen $_this Screen option page.
|
351 |
+
*
|
352 |
+
* @return boolean
|
353 |
+
*/
|
354 |
+
function screen_options_hide_screen( $show_screen, $_this ) {
|
355 |
+
if ( $this->_name === $_this->parent_base || $this->_name === $_this->parent_file ) {
|
356 |
+
return false;
|
357 |
+
}
|
358 |
+
|
359 |
+
return $show_screen;
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Check if there is a hook in the cron
|
364 |
+
*/
|
365 |
+
function scheduled_remove_wishlist() {
|
366 |
+
$timestamp = wp_next_scheduled( 'tinvwl_remove_without_author_wishlist' );
|
367 |
+
if ( ! $timestamp ) {
|
368 |
+
$time = strtotime( '00:00 today +1 HOURS' );
|
369 |
+
wp_schedule_event( $time, 'daily', 'tinvwl_remove_without_author_wishlist' );
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Removing old wishlist without a user older than 34 days
|
375 |
+
*/
|
376 |
+
public function remove_old_wishlists() {
|
377 |
+
$wl = new TInvWL_Wishlist();
|
378 |
+
$wishlists = $wl->get( array(
|
379 |
+
'author' => 0,
|
380 |
+
'type' => 'default',
|
381 |
+
'sql' => 'SELECT * FROM {table} {where} AND `date` < DATE_SUB( CURDATE(), INTERVAL 34 DAY)',
|
382 |
+
) );
|
383 |
+
foreach ( $wishlists as $wishlist ) {
|
384 |
+
$wl->remove( $wishlist['ID'] );
|
385 |
+
}
|
386 |
+
}
|
387 |
+
|
388 |
+
/**
|
389 |
+
* Add a post display state for special WC pages in the page list table.
|
390 |
+
*
|
391 |
+
* @param array $post_states An array of post display states.
|
392 |
+
* @param WP_Post $post The current post object.
|
393 |
+
*
|
394 |
+
* @return array
|
395 |
+
*/
|
396 |
+
public function add_display_post_states( $post_states, $post ) {
|
397 |
+
if ( tinv_get_option( 'page', 'wishlist' ) === $post->ID ) {
|
398 |
+
$post_states['tinvwl_page_for_wishlist'] = __( 'Wishlist Page', 'ti-woocommerce-wishlist' );
|
399 |
+
}
|
400 |
+
|
401 |
+
return $post_states;
|
402 |
+
}
|
403 |
+
}
|
assets/css/admin.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.13.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.13.1
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/public.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.13.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.13.1
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/theme.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.13.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.13.1
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/js/admin.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.13.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"===i.val()?n.preventDefault():e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.attr("type","checkbox").hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){var t=s(this),n=function(){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),e=c.isChecked.call(t),o=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&o(n,e),"string"==typeof i&&o(i,!e),t};return t.is("input")&&"checkbox"==t.attr("type")?(s(this).on("change",n),n.call(t)):t})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){var t=s(this),n=function(e){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),o=e.onClick.call(t),c=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&c(n,o),"string"==typeof i&&c(i,!o),t};return t.is("input")||t.is("select")?(s(this).on("change",function(){n.call(this,i)}),n.call(t,i)):t})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.13.1
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"===i.val()?n.preventDefault():e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.attr("type","checkbox").hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){var t=s(this),n=function(){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),e=c.isChecked.call(t),o=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&o(n,e),"string"==typeof i&&o(i,!e),t};return t.is("input")&&"checkbox"==t.attr("type")?(s(this).on("change",n),n.call(t)):t})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){var t=s(this),n=function(e){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),o=e.onClick.call(t),c=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&c(n,o),"string"==typeof i&&c(i,!o),t};return t.is("input")||t.is("select")?(s(this).on("change",function(){n.call(this,i)}),n.call(t,i)):t})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(jQuery);
|
assets/js/public.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.13.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function update_cart_hash(){if(!tinvwl_add_to_wishlist.wc_cart_fragments_refresh)return!1;jQuery(document.body).on("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist",function(){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=wc_cart_fragments_params.cart_hash_key;localStorage.setItem(t,localStorage.getItem(t)+(new Date).getTime()),sessionStorage.setItem(t,sessionStorage.getItem(t)+(new Date).getTime()),jQuery(document.body).off("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist")})}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(r){r.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href,text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){r(this).append(r("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){r(t).addClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){r(t).removeClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(r(this).is(".disabled-add-wishlist"))return!1;r(this).is(".ftinvwl-animated")&&r(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):o.onActionProduct.call(this),update_cart_hash()},onPrepareDataAction:function(t,i){r("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var n={};return r("form.cart[method=post], .woocommerce-variation-add-to-cart").find("input, select").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val();"checkbox"===i||"radio"===i?r(this).is(":checked")&&(n["form"+t]=e):n["form"+t]=e}),n=n.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof n)return t.in;var i=parseInt(n);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=o.onPrepareList.call(t)||t,t=o.filterProductAlreadyIn.call(this,t)||t,r(this).parent().parent().find(".already-in").remove();var e="";switch(t.length){case 0:break;default:e=r("<ul>");r.each(t,function(t,i){e.append(r("<li>").html(r("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}e.length&&r(this).closest(".tinv-modal-inner").find("img").after(r("<div>").addClass("already-in").html(o.text_already_in+" ").append(e))},onAction:{redirect:function(t){o.redirectTimer&&clearTimeout(o.redirectTimer),o.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){r(this).attr("data-tinv-wl-list",t)},msg:function(t){if(!t)return!1;var i=r(t).eq(0);r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),o.redirectTimer&&clearTimeout(o.redirectTimer)})},status:function(t){t&&r(this).addClass("tinvwl-product-in-list")},removed:function(t){t&&r(this).removeClass("tinvwl-product-in-list").removeClass("tinvwl-product-make-remove").attr("data-tinv-wl-action","addto")},make_remove:function(t){r(this).toggleClass("tinvwl-product-make-remove",t).attr("data-tinv-wl-action",t?"remove":"addto")},fragments:function(t){if("undefined"==typeof wc_cart_fragments_params)return r.each(t,function(t,i){r(t).replaceWith(i)}),!1;var i;try{i="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(t){i=!1}if(i)try{var e=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),n=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash",o=sessionStorage.getItem(n),a=Cookies.get("woocommerce_cart_hash"),l=sessionStorage.getItem("wc_cart_created");if(null!=o&&""!==o||(o=""),null!=a&&""!==a||(a=""),o&&(null==l||""===l))throw"No cart_created";if(r.each(t,function(t,i){e[t]=i}),localStorage.setItem(n,localStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(n,sessionStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e)),!e||!e["div.widget_shopping_cart_content"]||o!==a)throw"No fragment";r.each(e,function(t,i){r(t).replaceWith(i)}),r(document.body).trigger("wc_fragments_loaded")}catch(t){r(document.body).trigger("wc_fragment_refresh")}}},onActionProduct:function(t,i){var s={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:r(this).attr("data-tinv-wl-producttype"),product_id:r(this).attr("data-tinv-wl-product")||0,product_variation:r(this).attr("data-tinv-wl-productvariation")||0,product_action:r(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},e=this;r(e).closest("form.cart[method=post], .tinvwl-loop-button-wrapper").find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val(),n=10,o=function t(i,e){if("object"!==_typeof(e))return e;for(var n in void 0===i&&(i={}),e)if(""===n){var o=-1;for(o in i)o=o;i[o=parseInt(o)+1]=t(i[n],e[n])}else i[n]=t(i[n],e[n]);return i};if("button"!==i&&void 0!==t&&"attribute_"!=t.substr(0,10)){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<n;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=e,e=l}t=a[1],n--}"checkbox"===i||"radio"===i?r(this).is(":checked")&&(e.length||"object"===_typeof(e)||(e=!0),s.form[t]=o(s.form[t],e)):s.form[t]=o(s.form[t],e)}}),s=o.onPrepareDataAction.call(e,e,s)||s,r.post(o.api_url,s,function(t){if(o.onDialogHide.call(e.tinvwl_dialog,e),"object"===_typeof(t))for(var i in t)"function"==typeof o.onAction[i]&&o.onAction[i].call(e,t[i]);else"function"==typeof o.onAction.msg&&o.onAction.msg.call(e,t)})}},o=r.extend(!0,{},i,t);return r(this).each(function(){if(!r(this).attr("data-tinv-wl-list"))return!1;if(o.dialogbox&&o.dialogbox.length&&(this.tinvwl_dialog=o.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=o.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=r(this).nextAll(o.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){o.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var e=r(this).find(o.class.select).eq(0);r(this).find(o.class.newtitle).hide().val(""),e.html(""),r.each(t,function(t,i){o.onCreateWishList.call(e,i)}),o.text_create&&o.onCreateWishList.call(e,{ID:"",title:o.text_create,in:!1}),o.onMultiProductAlreadyIn.call(e,t),o.onSelectWishList.call(e,t),r(this).find(o.class.newtitle).toggle(""===e.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=r.parseJSON(r(this).attr("data-tinv-wl-list"))||[];t.length?(t=o.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),o.onDialogShow.call(this.tinvwl_dialog,this)):o.onActionProduct.call(this)});var n=this;r(this.tinvwl_dialog).find(o.class.dialogbutton).off("click").on("click",function(){var t,i=r(n.tinvwl_dialog).find(o.class.select),e=r(n.tinvwl_dialog).find(o.class.newtitle);i.val()||e.val()?o.onActionProduct.call(n,i.val(),e.val()):((t=e.is(":visible")?e:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}r(this).off("click").on("click",o.onClick),o.onInited.call(this,o)})},r(document).ready(function(){r("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(r(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);r(this).is(".inited-add-wishlist")||r(this).tinvwl_to_wishlist({onInited:function(t){r(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),r(document).on("hide_variation",".variations_form",function(t){var i=r(this).find(".tinvwl_add_to_wishlist_button");i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),r(document).on("show_variation",".variations_form",function(t,i,e){var n=r(this).find(".tinvwl_add_to_wishlist_button");if(n.length){var o=JSON.parse(n.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in o)o[s].hasOwnProperty("in")&&Array.isArray(o[s].in)&&-1<(o[s].in||[]).indexOf(i.variation_id)&&(a=!0);n.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto"),t.preventDefault(),n.removeClass("disabled-add-wishlist")}})})}(jQuery),function(n){n(document).ready(function(){if(n("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),n(".tinv-lists-nav").each(function(){n.trim(n(this).html()).length||n(this).remove()}),n("body").on("click",".social-buttons .social[title!=email][title!=whatsapp][title!=clipboard]",function(t){var i=window.open(n(this).attr("href"),n(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}n("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),n("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),n(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),n("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){n(this).data("url")&&(t.preventDefault(),window.location=n(this).data("url"))});var e=n(".tinv-wishlist .navigation-button");e.length&&e.each(function(){var t=n(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),n(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),n(this).closest(".tinv-login").find(".login").toggle()}),n(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){n(this).toggle(!!n(this).children().not(".look_in").length||!!n(this).children(".look_in").children().length)})}),n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var t=!("0"==n(".wishlist_products_counter_number").html()||""==n(".wishlist_products_counter_number").html());n(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t)}),update_cart_hash()}(jQuery),function(n){n.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return n(this).val()},rule:function(){var t=n(this).parents("form").eq(0).find(e.selector),i=e.invert;return 0===t.length?e.ifempty:(t.each(function(){i&&!e.invert||!i&&e.invert||(i=Boolean(e.validate.call(n(this))))}),i)}},e=n.extend(!0,{},i,t);return n(this).each(function(){n(this).on("click",function(t){e.rule.call(n(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},n(document).ready(function(){n(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),n(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return n(this).is(":checked")}}),n(".global-cb").on("click",function(){n(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",n(this).is(":checked"))})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.13.1
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function update_cart_hash(){if(!tinvwl_add_to_wishlist.wc_cart_fragments_refresh)return!1;jQuery(document.body).on("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist",function(){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=wc_cart_fragments_params.cart_hash_key;localStorage.setItem(t,localStorage.getItem(t)+(new Date).getTime()),sessionStorage.setItem(t,sessionStorage.getItem(t)+(new Date).getTime()),jQuery(document.body).off("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist")})}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(r){r.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href,text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){r(this).append(r("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){r(t).addClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){r(t).removeClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(r(this).is(".disabled-add-wishlist"))return!1;r(this).is(".ftinvwl-animated")&&r(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):o.onActionProduct.call(this),update_cart_hash()},onPrepareDataAction:function(t,i){r("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var n={};return r("form.cart[method=post], .woocommerce-variation-add-to-cart").find("input, select").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val();"checkbox"===i||"radio"===i?r(this).is(":checked")&&(n["form"+t]=e):n["form"+t]=e}),n=n.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof n)return t.in;var i=parseInt(n);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=o.onPrepareList.call(t)||t,t=o.filterProductAlreadyIn.call(this,t)||t,r(this).parent().parent().find(".already-in").remove();var e="";switch(t.length){case 0:break;default:e=r("<ul>");r.each(t,function(t,i){e.append(r("<li>").html(r("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}e.length&&r(this).closest(".tinv-modal-inner").find("img").after(r("<div>").addClass("already-in").html(o.text_already_in+" ").append(e))},onAction:{redirect:function(t){o.redirectTimer&&clearTimeout(o.redirectTimer),o.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){r(this).attr("data-tinv-wl-list",t)},msg:function(t){if(!t)return!1;var i=r(t).eq(0);r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),o.redirectTimer&&clearTimeout(o.redirectTimer)})},status:function(t){t&&r(this).addClass("tinvwl-product-in-list")},removed:function(t){t&&r(this).removeClass("tinvwl-product-in-list").removeClass("tinvwl-product-make-remove").attr("data-tinv-wl-action","addto")},make_remove:function(t){r(this).toggleClass("tinvwl-product-make-remove",t).attr("data-tinv-wl-action",t?"remove":"addto")},fragments:function(t){if("undefined"==typeof wc_cart_fragments_params)return r.each(t,function(t,i){r(t).replaceWith(i)}),!1;var i;try{i="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(t){i=!1}if(i)try{var e=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),n=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash",o=sessionStorage.getItem(n),a=Cookies.get("woocommerce_cart_hash"),l=sessionStorage.getItem("wc_cart_created");if(null!=o&&""!==o||(o=""),null!=a&&""!==a||(a=""),o&&(null==l||""===l))throw"No cart_created";if(r.each(t,function(t,i){e[t]=i}),localStorage.setItem(n,localStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(n,sessionStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e)),!e||!e["div.widget_shopping_cart_content"]||o!==a)throw"No fragment";r.each(e,function(t,i){r(t).replaceWith(i)}),r(document.body).trigger("wc_fragments_loaded")}catch(t){r(document.body).trigger("wc_fragment_refresh")}}},onActionProduct:function(t,i){var s={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:r(this).attr("data-tinv-wl-producttype"),product_id:r(this).attr("data-tinv-wl-product")||0,product_variation:r(this).attr("data-tinv-wl-productvariation")||0,product_action:r(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},e=this;r(e).closest("form.cart[method=post], .tinvwl-loop-button-wrapper").find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val(),n=10,o=function t(i,e){if("object"!==_typeof(e))return e;for(var n in void 0===i&&(i={}),e)if(""===n){var o=-1;for(o in i)o=o;i[o=parseInt(o)+1]=t(i[n],e[n])}else i[n]=t(i[n],e[n]);return i};if("button"!==i&&void 0!==t&&"attribute_"!=t.substr(0,10)){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<n;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=e,e=l}t=a[1],n--}"checkbox"===i||"radio"===i?r(this).is(":checked")&&(e.length||"object"===_typeof(e)||(e=!0),s.form[t]=o(s.form[t],e)):s.form[t]=o(s.form[t],e)}}),s=o.onPrepareDataAction.call(e,e,s)||s,r.post(o.api_url,s,function(t){if(o.onDialogHide.call(e.tinvwl_dialog,e),"object"===_typeof(t))for(var i in t)"function"==typeof o.onAction[i]&&o.onAction[i].call(e,t[i]);else"function"==typeof o.onAction.msg&&o.onAction.msg.call(e,t)})}},o=r.extend(!0,{},i,t);return r(this).each(function(){if(!r(this).attr("data-tinv-wl-list"))return!1;if(o.dialogbox&&o.dialogbox.length&&(this.tinvwl_dialog=o.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=o.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=r(this).nextAll(o.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){o.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var e=r(this).find(o.class.select).eq(0);r(this).find(o.class.newtitle).hide().val(""),e.html(""),r.each(t,function(t,i){o.onCreateWishList.call(e,i)}),o.text_create&&o.onCreateWishList.call(e,{ID:"",title:o.text_create,in:!1}),o.onMultiProductAlreadyIn.call(e,t),o.onSelectWishList.call(e,t),r(this).find(o.class.newtitle).toggle(""===e.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=r.parseJSON(r(this).attr("data-tinv-wl-list"))||[];t.length?(t=o.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),o.onDialogShow.call(this.tinvwl_dialog,this)):o.onActionProduct.call(this)});var n=this;r(this.tinvwl_dialog).find(o.class.dialogbutton).off("click").on("click",function(){var t,i=r(n.tinvwl_dialog).find(o.class.select),e=r(n.tinvwl_dialog).find(o.class.newtitle);i.val()||e.val()?o.onActionProduct.call(n,i.val(),e.val()):((t=e.is(":visible")?e:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}r(this).off("click").on("click",o.onClick),o.onInited.call(this,o)})},r(document).ready(function(){r("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(r(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);r(this).is(".inited-add-wishlist")||r(this).tinvwl_to_wishlist({onInited:function(t){r(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),r(document).on("hide_variation",".variations_form",function(t){var i=r(this).find(".tinvwl_add_to_wishlist_button");i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),r(document).on("show_variation",".variations_form",function(t,i,e){var n=r(this).find(".tinvwl_add_to_wishlist_button");if(n.length){var o=JSON.parse(n.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in o)o[s].hasOwnProperty("in")&&Array.isArray(o[s].in)&&-1<(o[s].in||[]).indexOf(i.variation_id)&&(a=!0);n.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto"),t.preventDefault(),n.removeClass("disabled-add-wishlist")}})})}(jQuery),function(n){n(document).ready(function(){if(n("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),n(".tinv-lists-nav").each(function(){n.trim(n(this).html()).length||n(this).remove()}),n("body").on("click",".social-buttons .social[title!=email][title!=whatsapp][title!=clipboard]",function(t){var i=window.open(n(this).attr("href"),n(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}n("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),n("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),n(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),n("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){n(this).data("url")&&(t.preventDefault(),window.location=n(this).data("url"))});var e=n(".tinv-wishlist .navigation-button");e.length&&e.each(function(){var t=n(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),n(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),n(this).closest(".tinv-login").find(".login").toggle()}),n(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){n(this).toggle(!!n(this).children().not(".look_in").length||!!n(this).children(".look_in").children().length)})}),n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var t=!("0"==n(".wishlist_products_counter_number").html()||""==n(".wishlist_products_counter_number").html());n(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t)}),update_cart_hash()}(jQuery),function(n){n.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return n(this).val()},rule:function(){var t=n(this).parents("form").eq(0).find(e.selector),i=e.invert;return 0===t.length?e.ifempty:(t.each(function(){i&&!e.invert||!i&&e.invert||(i=Boolean(e.validate.call(n(this))))}),i)}},e=n.extend(!0,{},i,t);return n(this).each(function(){n(this).on("click",function(t){e.rule.call(n(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},n(document).ready(function(){n(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),n(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return n(this).is(":checked")}}),n(".global-cb").on("click",function(){n(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",n(this).is(":checked"))})})}(jQuery);
|
includes/product.helper.php
CHANGED
@@ -412,6 +412,16 @@ class TInvWL_Product {
|
|
412 |
}
|
413 |
}
|
414 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
}
|
416 |
|
417 |
return $products;
|
412 |
}
|
413 |
}
|
414 |
}
|
415 |
+
|
416 |
+
// remove deleted products from database
|
417 |
+
if ( $default['external'] ) {
|
418 |
+
foreach ( $products as $key => $product ) {
|
419 |
+
if ( empty( $product['data'] ) ) {
|
420 |
+
unset( $products[ $key ] );
|
421 |
+
$this->remove( $product );
|
422 |
+
}
|
423 |
+
}
|
424 |
+
}
|
425 |
}
|
426 |
|
427 |
return $products;
|
includes/wizard.class.php
CHANGED
@@ -484,7 +484,6 @@ class TInvWL_Wizard {
|
|
484 |
'social_facebook_value' => tinv_get_option( 'social', 'facebook' ),
|
485 |
'social_twitter_value' => tinv_get_option( 'social', 'twitter' ),
|
486 |
'social_pinterest_value' => tinv_get_option( 'social', 'pinterest' ),
|
487 |
-
'social_google_value' => tinv_get_option( 'social', 'google' ),
|
488 |
'social_whatsapp_value' => tinv_get_option( 'social', 'whatsapp' ),
|
489 |
'social_clipboard_value' => tinv_get_option( 'social', 'clipboard' ),
|
490 |
'social_email_value' => tinv_get_option( 'social', 'email' ),
|
@@ -500,7 +499,6 @@ class TInvWL_Wizard {
|
|
500 |
'social_facebook' => FILTER_VALIDATE_BOOLEAN,
|
501 |
'social_twitter' => FILTER_VALIDATE_BOOLEAN,
|
502 |
'social_pinterest' => FILTER_VALIDATE_BOOLEAN,
|
503 |
-
'social_google' => FILTER_VALIDATE_BOOLEAN,
|
504 |
'social_whatsapp' => FILTER_VALIDATE_BOOLEAN,
|
505 |
'social_clipboard' => FILTER_VALIDATE_BOOLEAN,
|
506 |
'social_email' => FILTER_VALIDATE_BOOLEAN,
|
@@ -508,7 +506,6 @@ class TInvWL_Wizard {
|
|
508 |
tinv_update_option( 'social', 'facebook', (bool) $data['social_facebook'] );
|
509 |
tinv_update_option( 'social', 'twitter', (bool) $data['social_twitter'] );
|
510 |
tinv_update_option( 'social', 'pinterest', (bool) $data['social_pinterest'] );
|
511 |
-
tinv_update_option( 'social', 'google', (bool) $data['social_google'] );
|
512 |
tinv_update_option( 'social', 'whatsapp', (bool) $data['social_whatsapp'] );
|
513 |
tinv_update_option( 'social', 'clipboard', (bool) $data['social_clipboard'] );
|
514 |
tinv_update_option( 'social', 'email', (bool) $data['social_email'] );
|
484 |
'social_facebook_value' => tinv_get_option( 'social', 'facebook' ),
|
485 |
'social_twitter_value' => tinv_get_option( 'social', 'twitter' ),
|
486 |
'social_pinterest_value' => tinv_get_option( 'social', 'pinterest' ),
|
|
|
487 |
'social_whatsapp_value' => tinv_get_option( 'social', 'whatsapp' ),
|
488 |
'social_clipboard_value' => tinv_get_option( 'social', 'clipboard' ),
|
489 |
'social_email_value' => tinv_get_option( 'social', 'email' ),
|
499 |
'social_facebook' => FILTER_VALIDATE_BOOLEAN,
|
500 |
'social_twitter' => FILTER_VALIDATE_BOOLEAN,
|
501 |
'social_pinterest' => FILTER_VALIDATE_BOOLEAN,
|
|
|
502 |
'social_whatsapp' => FILTER_VALIDATE_BOOLEAN,
|
503 |
'social_clipboard' => FILTER_VALIDATE_BOOLEAN,
|
504 |
'social_email' => FILTER_VALIDATE_BOOLEAN,
|
506 |
tinv_update_option( 'social', 'facebook', (bool) $data['social_facebook'] );
|
507 |
tinv_update_option( 'social', 'twitter', (bool) $data['social_twitter'] );
|
508 |
tinv_update_option( 'social', 'pinterest', (bool) $data['social_pinterest'] );
|
|
|
509 |
tinv_update_option( 'social', 'whatsapp', (bool) $data['social_whatsapp'] );
|
510 |
tinv_update_option( 'social', 'clipboard', (bool) $data['social_clipboard'] );
|
511 |
tinv_update_option( 'social', 'email', (bool) $data['social_email'] );
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2019 TI WooCommerce Wishlist Plugin - 1.13.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.13.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.13.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -32,15 +32,15 @@ msgstr ""
|
|
32 |
msgid "Template Custom CSS"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: admin/basestyle.helper.php:115, admin/settings/general.class.php:
|
36 |
msgid "Save Settings"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: admin/basestyle.helper.php:121, admin/settings/general.class.php:
|
40 |
msgid "Reset"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: admin/basestyle.helper.php:127, admin/settings/general.class.php:
|
44 |
msgid "Save"
|
45 |
msgstr ""
|
46 |
|
@@ -220,27 +220,27 @@ msgstr ""
|
|
220 |
msgid "\"Add to Wishlist\" Icon"
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: admin/settings/general.class.php:336, admin/settings/general.class.php:
|
224 |
msgid "You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px."
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: admin/settings/general.class.php:339, admin/settings/general.class.php:463, admin/settings/general.class.php:
|
228 |
msgid "None"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: admin/settings/general.class.php:340, admin/settings/general.class.php:464, admin/settings/general.class.php:
|
232 |
msgid "Heart"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: admin/settings/general.class.php:341, admin/settings/general.class.php:465, admin/settings/general.class.php:
|
236 |
msgid "Heart+"
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: admin/settings/general.class.php:342, admin/settings/general.class.php:466, admin/settings/general.class.php:
|
240 |
msgid "Custom"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: admin/settings/general.class.php:359, admin/settings/general.class.php:482, admin/settings/general.class.php:
|
244 |
msgid "Upload"
|
245 |
msgstr ""
|
246 |
|
@@ -248,15 +248,15 @@ msgstr ""
|
|
248 |
msgid "\"Add to Wishlist\" Icon Color"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: admin/settings/general.class.php:370, admin/settings/general.class.php:493, admin/settings/general.class.php:
|
252 |
msgid "Use font color"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: admin/settings/general.class.php:371, admin/settings/general.class.php:494, admin/settings/general.class.php:
|
256 |
msgid "Black"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: admin/settings/general.class.php:372, admin/settings/general.class.php:495, admin/settings/general.class.php:
|
260 |
msgid "White"
|
261 |
msgstr ""
|
262 |
|
@@ -389,94 +389,90 @@ msgid "Show \"Pinterest\" Button"
|
|
389 |
msgstr ""
|
390 |
|
391 |
#: admin/settings/general.class.php:672, views/wizard/step-social.php:53
|
392 |
-
msgid "Show \"Google+\" Button"
|
393 |
-
msgstr ""
|
394 |
-
|
395 |
-
#: admin/settings/general.class.php:678, views/wizard/step-social.php:62
|
396 |
msgid "Show \"WhatsApp\" Button"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: admin/settings/general.class.php:
|
400 |
msgid "Show \"Copy to clipboard\" Button"
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: admin/settings/general.class.php:
|
404 |
msgid "Show \"Share by Email\" Button"
|
405 |
msgstr ""
|
406 |
|
407 |
-
#: admin/settings/general.class.php:
|
408 |
msgid "\"Share on\" Text"
|
409 |
msgstr ""
|
410 |
|
411 |
-
#: admin/settings/general.class.php:
|
412 |
msgid "Social Icons Color"
|
413 |
msgstr ""
|
414 |
|
415 |
-
#: admin/settings/general.class.php:
|
416 |
msgid "Dark"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: admin/settings/general.class.php:
|
420 |
msgid "Wishlist Product Counter"
|
421 |
msgstr ""
|
422 |
|
423 |
-
#: admin/settings/general.class.php:
|
424 |
msgid "Add this shortcode <code>[ti_wishlist_products_counter]</code> anywhere into a page content to show Wishlist Counter.<br/><br/>It can be also added as a widget <code>Wishlist Products Counter</code> under the <a href=\"%s\">Appearance -> Widgets</a> section."
|
425 |
msgstr ""
|
426 |
|
427 |
-
#: admin/settings/general.class.php:
|
428 |
msgid "\"Wishlist\" Counter Icon"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: admin/settings/general.class.php:
|
432 |
msgid "\"Wishlist\" Counter Icon Color"
|
433 |
msgstr ""
|
434 |
|
435 |
-
#: admin/settings/general.class.php:
|
436 |
msgid "Show \"Wishlist\" Counter Text"
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: admin/settings/general.class.php:
|
440 |
msgid "\"Wishlist\" Counter Text"
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: admin/settings/general.class.php:
|
444 |
msgid "Wishlist - "
|
445 |
msgstr ""
|
446 |
|
447 |
-
#: admin/settings/general.class.php:
|
448 |
msgid "Add counter to menu"
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: admin/settings/general.class.php:
|
452 |
msgid "You can add a wishlist products counter as item to the selected menu."
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: admin/settings/general.class.php:
|
456 |
msgid "Counter position (Menu item order)"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: admin/settings/general.class.php:
|
460 |
msgid "Allows you to add the wishlist counter as a menu item and apply its position."
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: admin/settings/general.class.php:
|
464 |
msgid "Show number of products in counter"
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: admin/settings/general.class.php:
|
468 |
msgid "Hide zero value"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: admin/settings/general.class.php:
|
472 |
msgid "Do not show the \"0\" value in a counter if wishlist is empty."
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: admin/settings/general.class.php:
|
476 |
msgid "Support chat settings"
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: admin/settings/general.class.php:
|
480 |
msgid "Disable support chat"
|
481 |
msgstr ""
|
482 |
|
@@ -689,7 +685,7 @@ msgid "Premium Features"
|
|
689 |
msgstr ""
|
690 |
|
691 |
#: admin/tinvwl.class.php:96
|
692 |
-
msgid "<strong>Welcome to WooCommerce Wishlist Plugin
|
693 |
msgstr ""
|
694 |
|
695 |
#: admin/tinvwl.class.php:98, admin/tinvwl.class.php:118
|
@@ -892,7 +888,7 @@ msgstr ""
|
|
892 |
msgid "Share"
|
893 |
msgstr ""
|
894 |
|
895 |
-
#: includes/wizard.class.php:
|
896 |
msgid "Ready!"
|
897 |
msgstr ""
|
898 |
|
@@ -967,7 +963,7 @@ msgstr ""
|
|
967 |
msgid "Remove"
|
968 |
msgstr ""
|
969 |
|
970 |
-
#: public/wishlist/buttons.class.php:494, public/wishlist/view.class.php:
|
971 |
msgid "“%s”"
|
972 |
msgstr ""
|
973 |
|
@@ -977,27 +973,27 @@ msgid_plural "%s have been successfully removed from wishlist."
|
|
977 |
msgstr[0] ""
|
978 |
msgstr[1] ""
|
979 |
|
980 |
-
#: public/wishlist/view.class.php:
|
981 |
msgid "%1$s by %2$s"
|
982 |
msgstr ""
|
983 |
|
984 |
-
#: public/wishlist/view.class.php:
|
985 |
msgid "%s has been removed from wishlist."
|
986 |
msgstr ""
|
987 |
|
988 |
-
#: public/wishlist/view.class.php:
|
989 |
msgid "%s has not been removed from wishlist."
|
990 |
msgstr ""
|
991 |
|
992 |
-
#: public/wishlist/view.class.php:
|
993 |
msgid "Return to Wishlist"
|
994 |
msgstr ""
|
995 |
|
996 |
-
#: public/wishlist/view.class.php:
|
997 |
msgid "Previous Page"
|
998 |
msgstr ""
|
999 |
|
1000 |
-
#: public/wishlist/view.class.php:
|
1001 |
msgid "Next Page"
|
1002 |
msgstr ""
|
1003 |
|
@@ -1289,11 +1285,11 @@ msgstr ""
|
|
1289 |
msgid "\"Add to Wishlist\" Text in Product listing"
|
1290 |
msgstr ""
|
1291 |
|
1292 |
-
#: views/wizard/step-button.php:76, views/wizard/step-page.php:53, views/wizard/step-processing.php:35, views/wizard/step-social.php:
|
1293 |
msgid "Skip this step"
|
1294 |
msgstr ""
|
1295 |
|
1296 |
-
#: views/wizard/step-button.php:77, views/wizard/step-page.php:54, views/wizard/step-processing.php:36, views/wizard/step-social.php:
|
1297 |
msgid "continue"
|
1298 |
msgstr ""
|
1299 |
|
@@ -1329,6 +1325,6 @@ msgstr ""
|
|
1329 |
msgid "Allow people to share wishlists by adding social share buttons to Wishlist page."
|
1330 |
msgstr ""
|
1331 |
|
1332 |
-
#: views/wizard/step-social.php:
|
1333 |
msgid "Show \"Clipboard\" Button"
|
1334 |
msgstr ""
|
1 |
+
# Copyright (C) 2019 TI WooCommerce Wishlist Plugin - 1.13.1
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.13.1 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.13.1\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
32 |
msgid "Template Custom CSS"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: admin/basestyle.helper.php:115, admin/settings/general.class.php:842
|
36 |
msgid "Save Settings"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: admin/basestyle.helper.php:121, admin/settings/general.class.php:848
|
40 |
msgid "Reset"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: admin/basestyle.helper.php:127, admin/settings/general.class.php:854
|
44 |
msgid "Save"
|
45 |
msgstr ""
|
46 |
|
220 |
msgid "\"Add to Wishlist\" Icon"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: admin/settings/general.class.php:336, admin/settings/general.class.php:724
|
224 |
msgid "You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px."
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: admin/settings/general.class.php:339, admin/settings/general.class.php:463, admin/settings/general.class.php:719
|
228 |
msgid "None"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: admin/settings/general.class.php:340, admin/settings/general.class.php:464, admin/settings/general.class.php:720
|
232 |
msgid "Heart"
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: admin/settings/general.class.php:341, admin/settings/general.class.php:465, admin/settings/general.class.php:721
|
236 |
msgid "Heart+"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: admin/settings/general.class.php:342, admin/settings/general.class.php:466, admin/settings/general.class.php:722
|
240 |
msgid "Custom"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: admin/settings/general.class.php:359, admin/settings/general.class.php:482, admin/settings/general.class.php:739
|
244 |
msgid "Upload"
|
245 |
msgstr ""
|
246 |
|
248 |
msgid "\"Add to Wishlist\" Icon Color"
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: admin/settings/general.class.php:370, admin/settings/general.class.php:493, admin/settings/general.class.php:699, admin/settings/general.class.php:750
|
252 |
msgid "Use font color"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: admin/settings/general.class.php:371, admin/settings/general.class.php:494, admin/settings/general.class.php:751
|
256 |
msgid "Black"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: admin/settings/general.class.php:372, admin/settings/general.class.php:495, admin/settings/general.class.php:701, admin/settings/general.class.php:752
|
260 |
msgid "White"
|
261 |
msgstr ""
|
262 |
|
389 |
msgstr ""
|
390 |
|
391 |
#: admin/settings/general.class.php:672, views/wizard/step-social.php:53
|
|
|
|
|
|
|
|
|
392 |
msgid "Show \"WhatsApp\" Button"
|
393 |
msgstr ""
|
394 |
|
395 |
+
#: admin/settings/general.class.php:678
|
396 |
msgid "Show \"Copy to clipboard\" Button"
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: admin/settings/general.class.php:684, views/wizard/step-social.php:71
|
400 |
msgid "Show \"Share by Email\" Button"
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: admin/settings/general.class.php:690
|
404 |
msgid "\"Share on\" Text"
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: admin/settings/general.class.php:696
|
408 |
msgid "Social Icons Color"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: admin/settings/general.class.php:700
|
412 |
msgid "Dark"
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: admin/settings/general.class.php:709
|
416 |
msgid "Wishlist Product Counter"
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: admin/settings/general.class.php:710
|
420 |
msgid "Add this shortcode <code>[ti_wishlist_products_counter]</code> anywhere into a page content to show Wishlist Counter.<br/><br/>It can be also added as a widget <code>Wishlist Products Counter</code> under the <a href=\"%s\">Appearance -> Widgets</a> section."
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: admin/settings/general.class.php:716
|
424 |
msgid "\"Wishlist\" Counter Icon"
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: admin/settings/general.class.php:748
|
428 |
msgid "\"Wishlist\" Counter Icon Color"
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: admin/settings/general.class.php:759
|
432 |
msgid "Show \"Wishlist\" Counter Text"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: admin/settings/general.class.php:768
|
436 |
msgid "\"Wishlist\" Counter Text"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: admin/settings/general.class.php:769
|
440 |
msgid "Wishlist - "
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: admin/settings/general.class.php:775
|
444 |
msgid "Add counter to menu"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: admin/settings/general.class.php:777
|
448 |
msgid "You can add a wishlist products counter as item to the selected menu."
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: admin/settings/general.class.php:786
|
452 |
msgid "Counter position (Menu item order)"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: admin/settings/general.class.php:787
|
456 |
msgid "Allows you to add the wishlist counter as a menu item and apply its position."
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: admin/settings/general.class.php:798
|
460 |
msgid "Show number of products in counter"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: admin/settings/general.class.php:807
|
464 |
msgid "Hide zero value"
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: admin/settings/general.class.php:808
|
468 |
msgid "Do not show the \"0\" value in a counter if wishlist is empty."
|
469 |
msgstr ""
|
470 |
|
471 |
+
#: admin/settings/general.class.php:819
|
472 |
msgid "Support chat settings"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: admin/settings/general.class.php:826
|
476 |
msgid "Disable support chat"
|
477 |
msgstr ""
|
478 |
|
685 |
msgstr ""
|
686 |
|
687 |
#: admin/tinvwl.class.php:96
|
688 |
+
msgid "<strong>Welcome to WooCommerce Wishlist Plugin</strong> – You‘re almost ready to start :)"
|
689 |
msgstr ""
|
690 |
|
691 |
#: admin/tinvwl.class.php:98, admin/tinvwl.class.php:118
|
888 |
msgid "Share"
|
889 |
msgstr ""
|
890 |
|
891 |
+
#: includes/wizard.class.php:520
|
892 |
msgid "Ready!"
|
893 |
msgstr ""
|
894 |
|
963 |
msgid "Remove"
|
964 |
msgstr ""
|
965 |
|
966 |
+
#: public/wishlist/buttons.class.php:494, public/wishlist/view.class.php:488
|
967 |
msgid "“%s”"
|
968 |
msgstr ""
|
969 |
|
973 |
msgstr[0] ""
|
974 |
msgstr[1] ""
|
975 |
|
976 |
+
#: public/wishlist/view.class.php:426
|
977 |
msgid "%1$s by %2$s"
|
978 |
msgstr ""
|
979 |
|
980 |
+
#: public/wishlist/view.class.php:498
|
981 |
msgid "%s has been removed from wishlist."
|
982 |
msgstr ""
|
983 |
|
984 |
+
#: public/wishlist/view.class.php:500
|
985 |
msgid "%s has not been removed from wishlist."
|
986 |
msgstr ""
|
987 |
|
988 |
+
#: public/wishlist/view.class.php:643
|
989 |
msgid "Return to Wishlist"
|
990 |
msgstr ""
|
991 |
|
992 |
+
#: public/wishlist/view.class.php:764
|
993 |
msgid "Previous Page"
|
994 |
msgstr ""
|
995 |
|
996 |
+
#: public/wishlist/view.class.php:790
|
997 |
msgid "Next Page"
|
998 |
msgstr ""
|
999 |
|
1285 |
msgid "\"Add to Wishlist\" Text in Product listing"
|
1286 |
msgstr ""
|
1287 |
|
1288 |
+
#: views/wizard/step-button.php:76, views/wizard/step-page.php:53, views/wizard/step-processing.php:35, views/wizard/step-social.php:84
|
1289 |
msgid "Skip this step"
|
1290 |
msgstr ""
|
1291 |
|
1292 |
+
#: views/wizard/step-button.php:77, views/wizard/step-page.php:54, views/wizard/step-processing.php:36, views/wizard/step-social.php:85
|
1293 |
msgid "continue"
|
1294 |
msgstr ""
|
1295 |
|
1325 |
msgid "Allow people to share wishlists by adding social share buttons to Wishlist page."
|
1326 |
msgstr ""
|
1327 |
|
1328 |
+
#: views/wizard/step-social.php:62
|
1329 |
msgid "Show \"Clipboard\" Button"
|
1330 |
msgstr ""
|
public/tinvwl.class.php
CHANGED
@@ -117,7 +117,7 @@ class TInvWL_Public_TInvWL {
|
|
117 |
* Define hooks
|
118 |
*/
|
119 |
function define_hooks() {
|
120 |
-
if ( tinv_get_option( 'social', 'facebook' )
|
121 |
add_filter( 'language_attributes', array( $this, 'add_ogp' ), 100 );
|
122 |
}
|
123 |
|
117 |
* Define hooks
|
118 |
*/
|
119 |
function define_hooks() {
|
120 |
+
if ( tinv_get_option( 'social', 'facebook' ) ) {
|
121 |
add_filter( 'language_attributes', array( $this, 'add_ogp' ), 100 );
|
122 |
}
|
123 |
|
public/wishlist/social.class.php
CHANGED
@@ -126,19 +126,6 @@ class TInvWL_Public_Wishlist_Social {
|
|
126 |
return 'http://pinterest.com/pin/create/button/?' . http_build_query( $data );
|
127 |
}
|
128 |
|
129 |
-
/**
|
130 |
-
* Create google++ share url
|
131 |
-
*
|
132 |
-
* @return string
|
133 |
-
*/
|
134 |
-
public static function google() {
|
135 |
-
$data = array(
|
136 |
-
'url' => self::$url,
|
137 |
-
);
|
138 |
-
|
139 |
-
return 'https://plus.google.com/share?' . http_build_query( $data );
|
140 |
-
}
|
141 |
-
|
142 |
/**
|
143 |
* Create email share url
|
144 |
*
|
126 |
return 'http://pinterest.com/pin/create/button/?' . http_build_query( $data );
|
127 |
}
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
/**
|
130 |
* Create email share url
|
131 |
*
|
public/wishlist/view.class.php
CHANGED
@@ -379,68 +379,60 @@ class TInvWL_Public_Wishlist_View {
|
|
379 |
function add_meta_tags() {
|
380 |
if ( is_page( apply_filters( 'wpml_object_id', tinv_get_option( 'page', 'wishlist' ), 'page', true ) ) ) {
|
381 |
$wishlist = $this->get_current_wishlist();
|
382 |
-
if ( $wishlist && 0 < $wishlist['ID']
|
383 |
-
|
384 |
-
|
385 |
-
if (
|
386 |
-
$
|
387 |
-
$user
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
} else {
|
389 |
$user_name = '';
|
390 |
$user = '';
|
391 |
}
|
392 |
-
} else {
|
393 |
-
$user_name = '';
|
394 |
-
$user = '';
|
395 |
-
}
|
396 |
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
|
|
409 |
}
|
410 |
}
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
}
|
417 |
|
418 |
-
|
419 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
|
421 |
-
$meta = apply_filters( 'tinvwl_social_header_meta', array(
|
422 |
-
'url' => $this->wishlist_url,
|
423 |
-
'type' => 'product.group',
|
424 |
-
'title' => sprintf( __( '%1$s by %2$s', 'ti-woocommerce-wishlist' ), $wishlist['title'], ( empty( $user_name ) ? $user : $user_name ) ),
|
425 |
-
'description' => implode( ', ', $products_title ),
|
426 |
-
'image' => $image,
|
427 |
-
) );
|
428 |
-
if ( tinv_get_option( 'social', 'facebook' ) ) {
|
429 |
foreach ( $meta as $name => $content ) {
|
430 |
echo sprintf( '<meta property="og:%s" content="%s" />', esc_attr( $name ), esc_attr( $content ) );
|
431 |
}
|
432 |
echo "\n";
|
433 |
}
|
434 |
-
if ( tinv_get_option( 'social', 'google' ) ) {
|
435 |
-
unset( $meta['url'], $meta['type'] );
|
436 |
-
foreach ( $meta as $name => $content ) {
|
437 |
-
if ( 'title' === $name ) {
|
438 |
-
$name = 'name';
|
439 |
-
}
|
440 |
-
echo sprintf( '<meta itemprop="%s" content="%s">', esc_attr( $name ), esc_attr( $content ) );
|
441 |
-
}
|
442 |
-
echo "\n";
|
443 |
-
}
|
444 |
} // End if().
|
445 |
} // End if().
|
446 |
}
|
379 |
function add_meta_tags() {
|
380 |
if ( is_page( apply_filters( 'wpml_object_id', tinv_get_option( 'page', 'wishlist' ), 'page', true ) ) ) {
|
381 |
$wishlist = $this->get_current_wishlist();
|
382 |
+
if ( $wishlist && 0 < $wishlist['ID'] ) {
|
383 |
+
$this->wishlist_url = tinv_url_wishlist( $wishlist['share_key'] );
|
384 |
+
if ( 'private' !== $wishlist['status'] && tinv_get_option( 'social', 'facebook' ) ) {
|
385 |
+
if ( is_user_logged_in() ) {
|
386 |
+
$user = get_user_by( 'id', $wishlist['author'] );
|
387 |
+
if ( $user && $user->exists() ) {
|
388 |
+
$user_name = trim( sprintf( '%s %s', $user->user_firstname, $user->user_lastname ) );
|
389 |
+
$user = @$user->display_name; // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
390 |
+
} else {
|
391 |
+
$user_name = '';
|
392 |
+
$user = '';
|
393 |
+
}
|
394 |
} else {
|
395 |
$user_name = '';
|
396 |
$user = '';
|
397 |
}
|
|
|
|
|
|
|
|
|
398 |
|
399 |
+
if ( is_array( $this->get_current_products_query() ) ) {
|
400 |
+
$products = $this->current_products_query;
|
401 |
+
} else {
|
402 |
+
$products = $this->get_current_products( $wishlist, true );
|
403 |
+
}
|
404 |
|
405 |
+
$products_title = array();
|
406 |
+
foreach ( $products as $product ) {
|
407 |
+
if ( ! empty( $product ) && ! empty( $product['data'] ) ) {
|
408 |
+
$title = $product['data']->get_title();
|
409 |
+
if ( ! in_array( $title, $products_title ) ) {
|
410 |
+
$products_title[] = $title;
|
411 |
+
}
|
412 |
}
|
413 |
}
|
414 |
+
$product = array_shift( $products );
|
415 |
+
$image = '';
|
416 |
+
if ( ! empty( $product ) && ! empty( $product['data'] ) ) {
|
417 |
+
list( $image ) = wp_get_attachment_image_src( $product['data']->get_image_id(), 'full' );
|
418 |
+
}
|
|
|
419 |
|
420 |
+
$this->social_image = $image;
|
421 |
+
|
422 |
+
|
423 |
+
$meta = apply_filters( 'tinvwl_social_header_meta', array(
|
424 |
+
'url' => $this->wishlist_url,
|
425 |
+
'type' => 'product.group',
|
426 |
+
'title' => sprintf( __( '%1$s by %2$s', 'ti-woocommerce-wishlist' ), $wishlist['title'], ( empty( $user_name ) ? $user : $user_name ) ),
|
427 |
+
'description' => implode( ', ', $products_title ),
|
428 |
+
'image' => $image,
|
429 |
+
) );
|
430 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
foreach ( $meta as $name => $content ) {
|
432 |
echo sprintf( '<meta property="og:%s" content="%s" />', esc_attr( $name ), esc_attr( $content ) );
|
433 |
}
|
434 |
echo "\n";
|
435 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
} // End if().
|
437 |
} // End if().
|
438 |
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: templateinvaders
|
|
3 |
Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.2
|
6 |
-
Stable tag: 1.13.
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -157,6 +157,17 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
|
|
157 |
|
158 |
|
159 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
= 1.13.0 =
|
161 |
*Release Date - 15 July 2019*
|
162 |
|
@@ -225,11 +236,5 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
|
|
225 |
* Fixed minor PHP issues
|
226 |
* Fixed minor CSS issues
|
227 |
|
228 |
-
= 1.9.18 =
|
229 |
-
*Release Date - 4 April 2019*
|
230 |
-
|
231 |
-
* Fixed an issue with removing products from wishlist when added to cart for WooCommerce prior 3.x versions.
|
232 |
-
* Fixed an issue when the wizard add multiple shortcodes to an exists page
|
233 |
-
|
234 |
[See changelog for all versions](https://raw.githubusercontent.com/TemplateInvaders/ti-woocommerce-wishlist/master/changelog.txt).
|
235 |
|
3 |
Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.2
|
6 |
+
Stable tag: 1.13.1
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
157 |
|
158 |
|
159 |
== Changelog ==
|
160 |
+
= 1.13.1 =
|
161 |
+
*Release Date - 29 July 2019*
|
162 |
+
|
163 |
+
* Fixed unclosed 'strong' tag in admin notification
|
164 |
+
* Fixed empty URL issue for sharing buttons
|
165 |
+
* Fixed performance for meta tags addition on wishlist page
|
166 |
+
* Fixed empty text issue for 'View Wishlist' button
|
167 |
+
* Removed Google Plus (G+) sharing option since the service is closed
|
168 |
+
* Added cleanup of deleted products from wishlist
|
169 |
+
* Added parameters to the 'tinvwl_get_wishlist_products' to get a custom products query results
|
170 |
+
|
171 |
= 1.13.0 =
|
172 |
*Release Date - 15 July 2019*
|
173 |
|
236 |
* Fixed minor PHP issues
|
237 |
* Fixed minor CSS issues
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
[See changelog for all versions](https://raw.githubusercontent.com/TemplateInvaders/ti-woocommerce-wishlist/master/changelog.txt).
|
240 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: TI WooCommerce Wishlist Plugin
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.13.
|
8 |
* Requires at least: 4.5
|
9 |
* Tested up to: 5.2
|
10 |
* WC requires at least: 2.6
|
@@ -41,7 +41,7 @@ if ( ! defined( 'TINVWL_DOMAIN' ) ) {
|
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
-
define( 'TINVWL_FVERSION', '1.13.
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
4 |
* Plugin Name: TI WooCommerce Wishlist Plugin
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
+
* Version: 1.13.1
|
8 |
* Requires at least: 4.5
|
9 |
* Tested up to: 5.2
|
10 |
* WC requires at least: 2.6
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
+
define( 'TINVWL_FVERSION', '1.13.1' );
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
tinv-wishlists-function.php
CHANGED
@@ -872,16 +872,17 @@ if ( ! function_exists( 'tinvwl_get_wishlist_products' ) ) {
|
|
872 |
* Get wishlist products for default user wishlist or by ID or SHAREKEY
|
873 |
*
|
874 |
* @param int $wishlist_id by ID or SHAREKEY, 0 = default wishlist of current user
|
|
|
875 |
*
|
876 |
* @return array|bool
|
877 |
*/
|
878 |
-
function tinvwl_get_wishlist_products( $wishlist_id = 0 ) {
|
879 |
$wishlist = tinv_wishlist_get( $wishlist_id );
|
880 |
if ( empty( $wishlist ) ) {
|
881 |
return false;
|
882 |
}
|
883 |
$wlp = new TInvWL_Product( $wishlist );
|
884 |
-
$products = $wlp->get_wishlist();
|
885 |
|
886 |
if ( empty( $products ) ) {
|
887 |
return false;
|
872 |
* Get wishlist products for default user wishlist or by ID or SHAREKEY
|
873 |
*
|
874 |
* @param int $wishlist_id by ID or SHAREKEY, 0 = default wishlist of current user
|
875 |
+
* @param array $data query parameters for get() method of TInvWL_Product() class.
|
876 |
*
|
877 |
* @return array|bool
|
878 |
*/
|
879 |
+
function tinvwl_get_wishlist_products( $wishlist_id = 0, $data = array() ) {
|
880 |
$wishlist = tinv_wishlist_get( $wishlist_id );
|
881 |
if ( empty( $wishlist ) ) {
|
882 |
return false;
|
883 |
}
|
884 |
$wlp = new TInvWL_Product( $wishlist );
|
885 |
+
$products = $wlp->get_wishlist( $data );
|
886 |
|
887 |
if ( empty( $products ) ) {
|
888 |
return false;
|
views/wizard/step-social.php
CHANGED
@@ -1,97 +1,88 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The Template for displaying wizard social step.
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package TInvWishlist\Wizard\Template
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit; // Exit if accessed directly.
|
11 |
-
}
|
12 |
-
|
13 |
-
?>
|
14 |
-
<div class="tinwl-inner">
|
15 |
-
<div class="row">
|
16 |
-
<div>
|
17 |
-
<div class="tinvwl-title-wrap">
|
18 |
-
<h1><?php esc_html_e( 'Share', 'ti-woocommerce-wishlist' ); ?></h1>
|
19 |
-
<div class="tinvwl-separator"></div>
|
20 |
-
</div>
|
21 |
-
|
22 |
-
<div class="tinvwl-desc"><?php esc_html_e( 'Allow people to share wishlists by adding social share buttons to Wishlist page.', 'ti-woocommerce-wishlist' ); ?></div>
|
23 |
-
|
24 |
-
<div class="form-horizontal">
|
25 |
-
<div class="form-group">
|
26 |
-
<?php echo TInvWL_Form::_label( 'social_facebook', __( 'Show "Facebook" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
27 |
-
<div class="col-md-6">
|
28 |
-
<?php echo TInvWL_Form::_checkboxonoff( 'social_facebook', $social_facebook_value ); // WPCS: xss ok. ?>
|
29 |
-
</div>
|
30 |
-
</div>
|
31 |
-
</div>
|
32 |
-
|
33 |
-
<div class="form-horizontal">
|
34 |
-
<div class="form-group">
|
35 |
-
<?php echo TInvWL_Form::_label( 'social_twitter', __( 'Show "Twitter" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
36 |
-
<div class="col-md-6">
|
37 |
-
<?php echo TInvWL_Form::_checkboxonoff( 'social_twitter', $social_twitter_value ); // WPCS: xss ok. ?>
|
38 |
-
</div>
|
39 |
-
</div>
|
40 |
-
</div>
|
41 |
-
|
42 |
-
<div class="form-horizontal">
|
43 |
-
<div class="form-group">
|
44 |
-
<?php echo TInvWL_Form::_label( 'social_pinterest', __( 'Show "Pinterest" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
45 |
-
<div class="col-md-6">
|
46 |
-
<?php echo TInvWL_Form::_checkboxonoff( 'social_pinterest', $social_pinterest_value ); // WPCS: xss ok. ?>
|
47 |
-
</div>
|
48 |
-
</div>
|
49 |
-
</div>
|
50 |
-
|
51 |
-
<div class="form-horizontal">
|
52 |
-
<div class="form-group">
|
53 |
-
<?php echo TInvWL_Form::_label( '
|
54 |
-
<div class="col-md-6">
|
55 |
-
<?php echo TInvWL_Form::_checkboxonoff( '
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
</div>
|
59 |
-
|
60 |
-
<div class="form-horizontal">
|
61 |
-
<div class="form-group">
|
62 |
-
<?php echo TInvWL_Form::_label( '
|
63 |
-
<div class="col-md-6">
|
64 |
-
<?php echo TInvWL_Form::_checkboxonoff( '
|
65 |
-
</div>
|
66 |
-
</div>
|
67 |
-
</div>
|
68 |
-
|
69 |
-
<div class="form-horizontal">
|
70 |
-
<div class="form-group">
|
71 |
-
<?php echo TInvWL_Form::_label( '
|
72 |
-
<div class="col-md-6">
|
73 |
-
<?php echo TInvWL_Form::_checkboxonoff( '
|
74 |
-
</div>
|
75 |
-
</div>
|
76 |
-
</div>
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
</div>
|
87 |
-
</div>
|
88 |
-
|
89 |
-
<div class="tinvwl-separator"></div>
|
90 |
-
|
91 |
-
<div class="tinvwl-nav tinv-wishlist-clearfix">
|
92 |
-
<div class="tinvwl-next">
|
93 |
-
<a class="tinvwl-skip" href="<?php echo esc_url( add_query_arg( 'step', absint( filter_input( INPUT_GET, 'step' ) ) + 1, set_url_scheme( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) ); // @codingStandardsIgnoreLine WordPress.VIP.SuperGlobalInputUsage.AccessDetected ?>" ><?php esc_html_e( 'Skip this step', 'ti-woocommerce-wishlist' ); ?></a>
|
94 |
-
<?php echo TInvWL_Form::_button_submit( 'nextstep', __( 'continue', 'ti-woocommerce-wishlist' ), array( 'class' => 'tinvwl-btn red w-icon round' ) ); // WPCS: xss ok. ?>
|
95 |
-
</div>
|
96 |
-
</div>
|
97 |
-
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The Template for displaying wizard social step.
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package TInvWishlist\Wizard\Template
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly.
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
14 |
+
<div class="tinwl-inner">
|
15 |
+
<div class="row">
|
16 |
+
<div>
|
17 |
+
<div class="tinvwl-title-wrap">
|
18 |
+
<h1><?php esc_html_e( 'Share', 'ti-woocommerce-wishlist' ); ?></h1>
|
19 |
+
<div class="tinvwl-separator"></div>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="tinvwl-desc"><?php esc_html_e( 'Allow people to share wishlists by adding social share buttons to Wishlist page.', 'ti-woocommerce-wishlist' ); ?></div>
|
23 |
+
|
24 |
+
<div class="form-horizontal">
|
25 |
+
<div class="form-group">
|
26 |
+
<?php echo TInvWL_Form::_label( 'social_facebook', __( 'Show "Facebook" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
27 |
+
<div class="col-md-6">
|
28 |
+
<?php echo TInvWL_Form::_checkboxonoff( 'social_facebook', $social_facebook_value ); // WPCS: xss ok. ?>
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="form-horizontal">
|
34 |
+
<div class="form-group">
|
35 |
+
<?php echo TInvWL_Form::_label( 'social_twitter', __( 'Show "Twitter" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
36 |
+
<div class="col-md-6">
|
37 |
+
<?php echo TInvWL_Form::_checkboxonoff( 'social_twitter', $social_twitter_value ); // WPCS: xss ok. ?>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="form-horizontal">
|
43 |
+
<div class="form-group">
|
44 |
+
<?php echo TInvWL_Form::_label( 'social_pinterest', __( 'Show "Pinterest" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
45 |
+
<div class="col-md-6">
|
46 |
+
<?php echo TInvWL_Form::_checkboxonoff( 'social_pinterest', $social_pinterest_value ); // WPCS: xss ok. ?>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<div class="form-horizontal">
|
52 |
+
<div class="form-group">
|
53 |
+
<?php echo TInvWL_Form::_label( 'social_whatsapp', __( 'Show "WhatsApp" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
54 |
+
<div class="col-md-6">
|
55 |
+
<?php echo TInvWL_Form::_checkboxonoff( 'social_whatsapp', $social_whatsapp_value ); // WPCS: xss ok. ?>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<div class="form-horizontal">
|
61 |
+
<div class="form-group">
|
62 |
+
<?php echo TInvWL_Form::_label( 'social_clipboard', __( 'Show "Clipboard" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
63 |
+
<div class="col-md-6">
|
64 |
+
<?php echo TInvWL_Form::_checkboxonoff( 'social_clipboard', $social_clipboard_value ); // WPCS: xss ok. ?>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<div class="form-horizontal">
|
70 |
+
<div class="form-group">
|
71 |
+
<?php echo TInvWL_Form::_label( 'social_email', __( 'Show "Share by Email" Button', 'ti-woocommerce-wishlist' ), array( 'class' => 'col-md-6 control-label' ) ); // WPCS: xss ok. ?>
|
72 |
+
<div class="col-md-6">
|
73 |
+
<?php echo TInvWL_Form::_checkboxonoff( 'social_email', $social_email_value ); // WPCS: xss ok. ?>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<div class="tinvwl-separator"></div>
|
81 |
+
|
82 |
+
<div class="tinvwl-nav tinv-wishlist-clearfix">
|
83 |
+
<div class="tinvwl-next">
|
84 |
+
<a class="tinvwl-skip" href="<?php echo esc_url( add_query_arg( 'step', absint( filter_input( INPUT_GET, 'step' ) ) + 1, set_url_scheme( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) ); // @codingStandardsIgnoreLine WordPress.VIP.SuperGlobalInputUsage.AccessDetected ?>" ><?php esc_html_e( 'Skip this step', 'ti-woocommerce-wishlist' ); ?></a>
|
85 |
+
<?php echo TInvWL_Form::_button_submit( 'nextstep', __( 'continue', 'ti-woocommerce-wishlist' ), array( 'class' => 'tinvwl-btn red w-icon round' ) ); // WPCS: xss ok. ?>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|