Bitrix rounding
Who has faced the problem, needs a hint, it should not be implemented, or on their side and suggest a solution. The problem is that at the final stage when calculating the cart, the price needs to be rounded, if using $basketItem->setField("CUSTOM_PRICE", "Y"); then the coupons are removed, the price can be left, but the information about the coupon is simply overwritten and it is unclear which coupon was applied. How can the rounded cost be preserved or an additional discount of 0.01 be added, who has faced this problem? What is the solution?
-
1 day40 USD
826 10 1 1 1 day40 USDThe problem you are describing is related to the fact that when using the method $basketItem->setField("CUSTOM_PRICE", "Y") in Bitrix (I assume we are talking about the 1C-Bitrix platform), the standard logic for applying discounts and coupons may be reset, as you are manually setting a custom price. This behavior is typical for a system where changing the price directly conflicts with the discount mechanism.
-
1 day25 USD
4926 88 0 1 day25 USDGood afternoon, Denis
Options:
1. Instead of CUSTOM_PRICE, try to modify the product price before the discount is applied. For example, use an event.
2. If you need to round the entire cart, not individual items, you can use the OnSaleOrderBeforeSaved handler.
-
1 day25 USD
748 26 1 1 day25 USDfeel free to contact us..no problem..................................................................................
-
1 day30 USD
3012 73 4 2 1 day30 USDGood day! I have some experience in this field!!!!!! Feel free to contact me!!!!
-
Использовать скидку вместо прямого округления
Вместо того чтобы задавать CUSTOM_PRICE, можно добавить программную скидку на 0.01 (или нужную дельту для округления). В Bitrix это можно сделать через создание временной скидки в рамках события (например, OnSaleBasketItemBeforeSaved) или через API скидок (CSaleDiscount). Это позволит сохранить стандартную логику купонов, так как вы не вмешиваетесь в цену напрямую.
Наиболее чистым решением будет использование программной скидки, так как это сохраняет целостность данных о купонах и не ломает стандартную логику. Если же вам важно именно округление через CUSTOM_PRICE, то стоит комбинировать с сохранением данных о купоне вручную (пункт 1). Попробуйте протестировать эти подходы на своей стороне, начиная с анализа событий и возможностей API скидок. -
Current freelance projects in the category PHP
Website auditTask for technical debugging of OpenCart 3 (ocStore). I need a fixed budget for the result, not hourly payment. List of tasks 1. Fixing 500 error: A conflict occurs when updating modifiers (likely between system/seo_package.ocmod.xml and unixml.ocmod.xml). It is necessary to… Content Management Systems, PHP ∙ 12 hours 12 minutes back ∙ 33 proposals |
Development of a single project based on the refinement and integration of 4 scriptsHello. I need to combine 4 scripts from different authors into a single environment. The composition includes a forum, a video portal, an article portal, and a classifieds board. I will provide the scripts. Detailed specifications are in the attached files. Please think about… PHP, Web Programming ∙ 13 hours 40 minutes back ∙ 26 proposals |
A WordPress site using the Kadence theme and Kadence Blocks.
225 USD
We need to create a website on WordPress using the Kadence theme and Kadence Blocks. There will be no online store (although it may be added in the future). We need a homepage and several internal pages. The graphics are already prepared, the layout structure is mostly defined,… Content Management Systems, PHP ∙ 17 hours 6 minutes back ∙ 31 proposals |
Development of 2 SEO-oriented websites for selling spare parts (ATVs and special equipment)Development of Two Specialized Websites for Selling Spare PartsGeneral Information It is necessary to develop two specialized websites: Spare parts for ATVs, UTVs, SSVs, and other similar equipment. Spare parts for special equipment. Existing company website:… PHP, Web Programming ∙ 1 day 14 hours back ∙ 67 proposals |
Looking for a white-label solution for a betting company for rent. |