Skip to content
Discussion options

You must be logged in to vote

Hello @ceeckhout

A good approach for it would be to create you custom field, let's call it vendor/backpack/crud/fields/select_with_shipping_costs.blade.php.

It could start as a copy of the relationship select, but then you add a bit of javascript, that when the supplier is selected, it will send an ajax request to some endpoint you created with the selected supplier, you will do the needed calculations and return the results. Again, use javascript to display/update them when supplier changes.

That way you will keep the default relationship select from backpack untouched and able to be reused in other cruds where you don't need that functionality. Also you could then use this custom field …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jcastroa87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants