There is a problem. There is a form for adding goods to the cart, and if the goods were added from the detailed product, there should be a redirect to the basket, if the goods were added from the categories, the redirect should be to the current category. How to arrange a check url, from which came rekvest? ps How to customize the appearance of IntegerField forms?

  • 2
    First, the referrer, but it is not always available. Secondly, nothing should prevent you from adding additional data in the code that executes the query that adds the item to the basket (for example, this is the most url) - andreymal
  • Well, pass an extra digit to the url - zero or one depending on which template the form is being made from (a detailed product or category template), and check if the zero has arrived, then redirect it there, if there is one, then there it is. The method may be a crutch, but it’s easy to implement (I don’t know how it’s different) - fedotsoldier

0