Skip to content

Commit

Permalink
Check user before canceling subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Jun 11, 2024
1 parent 2854980 commit 5833db6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public function __clone()
*/
public function cancel( string $id ) : \Aimeos\MShop\Subscription\Item\Iface
{
$item = $this->manager->getItem( $id );
$item = $item->setDateEnd( $item->getDateNext() )
$item = $this->getObject()->get( $id );
$item = $item->setDateEnd( $item->getDateNext() ?: date( 'Y-m-d' ) )
->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_CANCEL );

return $this->manager->saveItem( $item );
Expand Down

0 comments on commit 5833db6

Please sign in to comment.