You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/readme.txt
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,9 @@ On settings page you can define a number. If location stock value will be less t
160
160
161
161
162
162
== Changelog ==
163
+
= 2.7.3 =
164
+
- Fix: Default stock available at notice will only display the associated locations which are enabled. [Thanks to Villa Bafo][12/06/2024]
165
+
163
166
= 2.7.2 =
164
167
Fix: PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given. [Thanks to @araundu][12/06/2024]
//$data['stock_locations_product_page_notice'] = apply_filters('slw_product_stock_location_notice', 'STOCK_QTY available at LOCATION_NAME'); //12/02/2024
345
345
346
346
347
347
@@ -392,19 +392,19 @@ public function enqueue_frontend()
$meta_obj = $wpdb->get_row('SELECT COUNT(*) AS total_locations FROM '.$wpdb->prefix.'postmeta pm WHERE pm.post_id="'.esc_sql($product_id).'" AND pm.meta_key LIKE "_stock_at_%" AND pm.meta_value>0');
404
-
$wc_product = wc_get_product($product_id);
405
-
406
-
$terms = slw_get_locations();
403
+
$meta_obj = $wpdb->get_row('SELECT COUNT(*) AS total_locations FROM '.$wpdb->prefix.'postmeta pm WHERE pm.post_id="'.esc_sql($data['product_id']).'" AND pm.meta_key LIKE "_stock_at_%" AND pm.meta_value>0');
$product_variations_ids = $wpdb->get_results("SELECT ID AS variation_id FROM $wpdb->posts WHERE post_parent IN ($product_id) AND post_type='product_variation'");
428
+
$product_variations_ids = $wpdb->get_results("SELECT ID AS variation_id FROM $wpdb->posts WHERE post_parent IN (".$data['product_id'].") AND post_type='product_variation'");
0 commit comments