A
A
Anto2020-05-19 17:47:43
1C-Bitrix
Anto, 2020-05-19 17:47:43

How is it possible to implement free shipping depending on the amount?

Good afternoon!

Tell me, there is a site on Bitrix, the Small Business edition, and you need to implement the following:
When adding a product to the cart, in the cart and on each page, a "reverse report" is kept of how much is missing before free delivery. As here - 5ec3f1285c082933194273.png
I searched the Internet for how to implement it, but I could not find it. Please tell kind people

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2020-05-19
@anton99zel

1. Create a cart rule:
/bitrix/admin/sale_discount_edit.php

spoiler
5ec4248be7366203222476.png

2. The output of a small basket is customizable (I don’t know how you implemented it), but something like this:
a. get the amount of items in the cart
spoiler
$result = Sale\Internals\BasketTable::getList(array(
    'filter' => array(
        'FUSER_ID' => Sale\Fuser::getId(), 
        'ORDER_ID' => null,
        'LID' => SITE_ID,
        'CAN_BUY' => 'Y',
    ),
    'select' => array('BASKET_COUNT', 'BASKET_SUM'),
    'runtime' => array(
        new \Bitrix\Main\Entity\ExpressionField('BASKET_COUNT', 'COUNT(*)'),
        new \Bitrix\Main\Entity\ExpressionField('BASKET_SUM', 'SUM(PRICE*QUANTITY)'),
    )
))->fetch();

b. Subtract from the amount from which free shipping comes the amount of goods in the basket
. Wrap it all in ajax for smoothness and beauty (This is a different topic)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question