diff --git a/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs b/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs
index 8c5adf5..c041551 100644
--- a/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs
+++ b/Nop.Plugin.Misc.AuctionPlugin/Components/AuctionPublicViewComponent.cs
@@ -127,9 +127,12 @@ public class AuctionPublicViewComponent : NopViewComponent
auctionId = valami.Id;
}
+ var productToAuctionId = await _auctionService.GetProductToAuctionByAuctionIdAndProductIdAsync(auctionId, productDetailsModel.Id);
+
productBidBoxViewModel.WidgetZone = widgetZone;
productBidBoxViewModel.BasePrice = productDetailsModel.ProductPrice.OldPriceValue;
productBidBoxViewModel.CurrentPrice = productDetailsModel.ProductPrice.PriceValue;
+ productBidBoxViewModel.ProductToAuctionId = productToAuctionId.FirstOrDefault().Id;
productBidBoxViewModel.AuctionId = auctionId;
productBidBoxViewModel.CustomerId = customer.Id;
productBidBoxViewModel.ProductId = productDetailsModel.Id;
diff --git a/Nop.Plugin.Misc.AuctionPlugin/Content/Js/MgMessageHandler.js b/Nop.Plugin.Misc.AuctionPlugin/Content/Js/MgMessageHandler.js
index 226cb05..ceb6f54 100644
--- a/Nop.Plugin.Misc.AuctionPlugin/Content/Js/MgMessageHandler.js
+++ b/Nop.Plugin.Misc.AuctionPlugin/Content/Js/MgMessageHandler.js
@@ -39,9 +39,16 @@
"hideMethod": "fadeOut"
});
$('.toast-success').css("background-color", "#4caf50");
+
+ const publicProductBidBox = document.getElementById("publicProductBidBox");
+ if (publicProductBidBox) {
+ refreshPublicBidBox(data);
+ }
+
},
auctionUpdateAlternate: function (data) {
const widgetPriceElement = document.getElementById("WidgetPrice");
+
if (widgetPriceElement) {
widgetPriceElement.textContent = data.bidPrice; // Update the price
console.log(`WidgetPrice updated to: ${data.bidPrice}`);
@@ -49,20 +56,25 @@
console.warn("Element with ID 'WidgetPrice' not found in the DOM.");
}
},
- auctionUpdate: function (data) {
- // Refresh the ViewComponent using AJAX
- $.ajax({
- url: '/Auction/RefreshAuctionWidget', // Controller endpoint
- method: 'GET',
- success: function (response) {
- //$('#auction-widget').html(response); // Update the DOM element
- console.log("Auction widget refreshed!");
- },
- error: function (error) {
- console.error("Error refreshing auction widget:", error);
- }
- });
- },
+ //auctionUpdate: function (data) {
+ // // Refresh the ViewComponent using AJAX
+ // $.ajax({
+ // url: '/Auction/RefreshAuctionWidget', // Controller endpoint
+ // type: 'POST',
+ // contentType: 'application/json',
+ // data: JSON.stringify({
+ // WidgetZone: data.WidgetZone,
+ // ProductId: data.ProductId
+ // }),
+ // success: function (response) {
+ // //$('#auction-widget').html(response); // Update the DOM element
+ // console.log("Auction widget refreshed!");
+ // },
+ // error: function (error) {
+ // console.error("Error refreshing auction widget:", error);
+ // }
+ // });
+ //},
// Add more handlers as needed
default: function (data) {
diff --git a/Nop.Plugin.Misc.AuctionPlugin/Hubs/Messages/BidNotificationMessage.cs b/Nop.Plugin.Misc.AuctionPlugin/Hubs/Messages/BidNotificationMessage.cs
index da733f3..34d05f1 100644
--- a/Nop.Plugin.Misc.AuctionPlugin/Hubs/Messages/BidNotificationMessage.cs
+++ b/Nop.Plugin.Misc.AuctionPlugin/Hubs/Messages/BidNotificationMessage.cs
@@ -6,6 +6,11 @@ using System.Threading.Tasks;
namespace Nop.Plugin.Misc.AuctionPlugin.Hubs.Messages
{
+
+ ///