Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fahadmahmood8 committed May 22, 2024
2 parents 6345908 + 7322f33 commit b1a19fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,6 @@ On settings page you can define a number. If location stock value will be less t


== Changelog ==
= 2.6.5 =
- Fix: PHP Fatal error due to wp_error [Thanks to Joseph Coello][13/04/2024]
- New: Stock status will be captured during checkout and it will always remain same for the old orders, fresh stock values won't reflect for old orders. [22/05/2024]
- Fix: https://github.com/fahadmahmood8/stock-locations-for-woocommerce/issues/93 [Thanks to Salvatore Messina & joaoaviz][22/05/2024]

= 2.6.5 =
- Fix: https://github.com/fahadmahmood8/stock-locations-for-woocommerce/issues/154 [Thanks to coello101][01/04/2024]
- Fix: https://wordpress.org/support/topic/no-effect-when-preferred-location-is-selected/ [Thanks to @adeyinkabadmus][01/04/2024]

= 2.6.4 =
- Fix: Make STOCK_QTY available at LOCATION_NAME string translatable. [Thanks to @michaelw90][12/02/2024]

Expand Down
13 changes: 4 additions & 9 deletions src/stock-locations-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');


global $wc_slw_data, $wc_slw_pro, $wc_slw_premium_copy, $slw_plugin_settings, $slw_gkey, $slw_api_valid_keys, $slw_crons_valid_keys, $slw_widgets_arr, $slw_wc_stock_format, $slw_theme_name, $slw_order_id;
global $wc_slw_data, $wc_slw_pro, $wc_slw_premium_copy, $slw_plugin_settings, $slw_gkey, $slw_api_valid_keys, $slw_crons_valid_keys, $slw_widgets_arr, $slw_wc_stock_format, $slw_theme_name;

$slw_wc_stock_format = get_option('woocommerce_stock_format');
$slw_gkey = get_option('slw-google-api-key');
Expand All @@ -36,9 +36,6 @@
define( 'SLW_PLUGIN_DIR', dirname( __FILE__ ) );
define( 'SLW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

//$slw_order_id = ((is_admin() && isset($_GET['page']) && $_GET['page']=='wc-orders' && isset($_GET['action']) && $_GET['action']=='edit' && isset($_GET['id']) && is_numeric($_GET['id']))?$_GET['id']:0);


$wp_theme_installed = wp_get_theme();
$slw_theme_name = esc_html( $wp_theme_installed->get_stylesheet());

Expand Down Expand Up @@ -112,7 +109,7 @@

class SlwMain{
// versions
public $version = '2.6.5';
public $version = '2.6.4';
public $import_export_addon_version = '1.1.1';

// others
Expand Down Expand Up @@ -283,8 +280,7 @@ public function enqueue_frontend()

$term_id = (int)(is_archive()?get_queried_object_id():0);
$term_id = is_numeric($term_id)?$term_id:0;
$term_link = ($term_id?get_term_link($term_id):'');
$term_link = (!is_wp_error($term_link)?$term_link:'');


$data = (is_array($this->plugin_settings)?$this->plugin_settings:array());
$data['slw_location_selection'] = get_option('slw-location-selection', 'no');
Expand All @@ -307,9 +303,8 @@ public function enqueue_frontend()
$data['out_of_stock'] = __('Out of stock', 'woocommerce');
$data['in_stock'] = __('In stock', 'woocommerce');
$data['backorder'] = __('Available on backorder', 'woocommerce');
$data['max_available_qty_msg'] = __('Maximum available quantity has already been added to the cart.', 'woocommerce');
$data['currency_symbol'] = get_woocommerce_currency_symbol();
$data['slw_term_url'] = $term_link;
$data['slw_term_url'] = ($term_id?get_term_link($term_id):'');
$data['slw_term_id'] = $term_id;
$data['slw_term_add_to_cart_url'] = $data['slw_term_url'].'?stock-location='.$data['slw_term_id'].'&add-to-cart=';
$data['stock_location_selected'] = ((isset($woocommerce->session) && $woocommerce->session->has_session())?$woocommerce->session->get('stock_location_selected'):0);
Expand Down

0 comments on commit b1a19fb

Please sign in to comment.