V
V
Vyacheslav2020-12-17 17:44:42
1C-Bitrix
Vyacheslav, 2020-12-17 17:44:42

How to make different payments for different products in the Bitrix online store?

In one store there are 2 types of goods, and it is necessary that they do not intersect in one order. How to do it?

For example:
1. Souvenirs
2. Services

Cart rules:
- If the user puts only "Souvenirs" into the cart , then at the last Step it will be offered to pay via online (bank acquiring), the cart amount at the payment step corresponds to the cart amount.

- If the user puts only "Services" in the basket , then at the last Step it will be proposed to proceed to payment to another online (address in the URL link), the application is sent accordingly from the basket to the manager, for manual control of the payment status .... well, or something like that so...

- If the user puts in the cart"Souvenirs" and "Services" , then it will NOT work to send and pay for an application from the basket, and for example a message is displayed, like ... "Souvenirs" and "Services" cannot be in the same order, create two different orders.

I tried to create an alternative, to limit the type of payment by the amount of the order. A souvenir is usually cheaper than a service ... and if a service was in the basket, then the order could be placed without payment and only in cash ... but this option is not suitable, since goods can also be charged for a large amount ...

Tell me if there is a solution how to separate payment for types of goods, but so that the user's order history is saved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2020-12-18
@anton99zel

Vyacheslav , the solution here is simple,
set a section for each product.
create two types of delivery, specify a section for a specific delivery in the restrictions
(formally, the delivery may not differ, it is important to link the section to the type of delivery)
-
Create Payments, and already in them you can make a restriction on the type of delivery.
Those. only those goods that are Souvenirs will become available for payment (because they belong to their delivery type). It will be the same for other sections, such as Services.
Next: we hang a check in the site template:
If there is a product in the cart, we will get its category. If we are on the page of another product, then we will compare these two categories. If they are the same, then we show the "Buy" button, otherwise we block it with the text "It is impossible because ....."
Now, in order to buy different products and make different payments, you need to make separate orders, the history will be in the profile, as you wanted. ...
Well, and a few screenshots on the example of the Russian Post and the Paypal payment system

spoiler
5fdcda94b14ca636103535.jpeg
5fdcda9b1efcb095842378.jpeg

The screenshot shows that certain products from the Accessories section are linked to Mail delivery, and in payment systems payment is set only for goods whose delivery is included in the Mail type.
--
You can get the current user's cart like this:
use Bitrix\Sale;
$basket = Sale\Basket::loadItemsForFUser(Sale\Fuser::getId(), Bitrix\Main\Context::getCurrent()->getSite());

What could be easier?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question