duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/simple-commerce
Other
143 stars 34 forks source link

Creating an order removes all groups from user. #1063

Closed sbrow closed 2 months ago

sbrow commented 2 months ago

Description

I have a super user whom is a member of the "Employees" group. Whenever I create an order for them, all the groups are removed from my user.

image

Steps to reproduce

  1. Install plugin
  2. Configure plugin to use users as customers
<?php

// config/simple-commerce.php

return [

  // ...

   'content' => [
        'customers' => [
            'repository' => \DuncanMcClean\SimpleCommerce\Customers\UserCustomerRepository::class,
            // 'collection' => 'users',
        ],

        'orders' => [
            'repository' => \DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository::class,
            'collection' => 'orders',
        ],

        'products' => [
            'repository' => \DuncanMcClean\SimpleCommerce\Products\EntryProductRepository::class,
            'collection' => 'products',
        ],
    ],
];
  1. Create a group and add your user to it.
  2. Make an order.

Environment

Environment Application Name: Development Site Laravel Version: 10.47.0 PHP Version: 8.2.13 Composer Version: 2.6.5 Environment: local Debug Mode: ENABLED URL: ppn.test Maintenance Mode: OFF

Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED

Drivers Broadcasting: log Cache: statamic Database: mysql Logs: stack / single Mail: smtp Queue: sync Session: file

Simple Commerce Currencies: USD Gateways: Dummy Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\UserCustomerRepository Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository Shipping Methods: Free Shipping Tax Engine: DuncanMcClean\SimpleCommerce\Tax\Standard\TaxEngine

Statamic Addons: 7 Antlers: runtime Sites: 1 Stache Watcher: Enabled Static Caching: Disabled Version: 4.56.1 PRO

Statamic Addons duncanmcclean/guest-entries: 3.2.0 duncanmcclean/simple-commerce: 6.1.0 ppn/sc-checkout: dev-master ppn/sc-subscriptions: dev-master sbrow/banner: dev-master statamic/seo-pro: 5.4.4 stefangalescu/statamic-heroicons: 2.1.1