Adding one list to another with checkboxes

When I add a “discount” to the database I want to specify which products the discount is associated with.

I have created a field in discounts called “list of products” and it allows me to add multiple products to the field.

However, in the admin interface, I’ve been trying to build a repeating group and I’ve added a checkbox to the group. When I add the discount to the discounts list I want it to just add the products that have the checkbox selected. Later if I edit the discount and uncheck some of them, I need it to remove them.
So far all I have been able to do is add the entire list of products to a new discount.
It’s important to note that when someone is checking out and they have added a product, I will need to check if the product is associated with that discount.

There must be a simple way to do this, can anyone please assist?

Pictured below is where I am at with it.

need to make it so that when the checkbox is checked you add that product to a list of products you will use to add to the discount…various ways to do it…could use a custom state or one of the plugins for lists

Thanks for that Bonton! I just found this video which is very useful (thanks Gaby). https://www.youtube.com/watch?v=yahP3RyVggY

I worry about using plugins as I don’t want anything in the app that I can’t fix as what I’m building is a replacement to an existing wordpress/woocommerce e-commerce site that we cant afford to have issues with.

This topic was automatically closed after 70 days. New replies are no longer allowed.