mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
set default store for product, purchase set last store purchased if available or use product default (#672)
This commit is contained in:
@@ -140,7 +140,16 @@ if (Grocy.Components.ProductPicker !== undefined)
|
||||
function(productDetails)
|
||||
{
|
||||
$('#price').val(productDetails.last_price);
|
||||
Grocy.Components.ShoppingLocationPicker.SetId(productDetails.last_shopping_location_id);
|
||||
|
||||
if (productDetails.last_shopping_location_id != null)
|
||||
{
|
||||
Grocy.Components.ShoppingLocationPicker.SetId(productDetails.last_shopping_location_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.ShoppingLocationPicker.SetId(productDetails.default_shopping_location_id);
|
||||
}
|
||||
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
|
||||
{
|
||||
Grocy.Components.LocationPicker.SetId(productDetails.location.id);
|
||||
|
Reference in New Issue
Block a user