Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug #173800 fix: When we click on fix databse button for vendor migra… #146

Open
wants to merge 1 commit into
base: release-1.5.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/com_tjvendors/site/events/vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ public function onAfterVendorSave($vendorDetails, $isNew)
/* New Vendor is created */
case true:
/* Send mail on Vendor create */
$this->tjvendorsMailsHelper->onAfterVendorCreate((object) $vendorDetails);
if ($vendorDetails['notify_vendor'])
{
$this->tjvendorsMailsHelper->onAfterVendorCreate((object) $vendorDetails);
}
break;

/* Vendor is editted */
case false:
/* Send mail on Vendor edit */
$this->tjvendorsMailsHelper->onAfterVendorEdit((object) $vendorDetails);
if ($vendorDetails['notify_vendor'])
{
$this->tjvendorsMailsHelper->onAfterVendorEdit((object) $vendorDetails);
}
break;
}

Expand Down
6 changes: 6 additions & 0 deletions src/com_tjvendors/site/models/vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ public function save($data)
$data['other_city'] = '';
}

// Flag to notify the vendor on profile update/create
if (isset($data['notify_vendor']) === false)
{
$data['notify_vendor'] = 1;
}

// To check if editing in registration form
if (!empty($data['vendor_id']))
{
Expand Down