K
K
konstantinnikiforov2020-07-02 09:39:56
1C-Bitrix
konstantinnikiforov, 2020-07-02 09:39:56

Product availability status in 1C-Bitrix, how to change in the template?

Colleagues, I'm not a programmer, but now I'm faced with the task of interfering with the template code, so I came here.
In the product card there is a status of product availability. In the catalog configuration settings, the ability to sell goods with zero balances is enabled. In this case, in Bitrix the product status is always "in stock" and this is correct. However, my client needs to make it so that when the balance is zero, the status "Delivery from a remote warehouse" is shown and at the same time it is possible to order goods.
At the moment, the template has the following code:

if($arOffer["CAN_BUY"]) {
  echo $arParams["MESS_SHOW_MAX_QUANTITY"]." ";
  if($offerMeasureRatio && (float)$arOffer["CATALOG_QUANTITY"] > 0 && $arOffer["CATALOG_QUANTITY_TRACE"] === "Y" && $arOffer["CATALOG_CAN_BUY_ZERO"] === "N") {
    if($arParams["SHOW_MAX_QUANTITY"] === "M") {
      if((float)$arOffer["CATALOG_QUANTITY"] / $offerMeasureRatio >= $arParams["RELATIVE_QUANTITY_FACTOR"]) {
        echo $arParams["MESS_RELATIVE_QUANTITY_MANY"];
      } else {
        echo $arParams["MESS_RELATIVE_QUANTITY_FEW"];
      }
    } else {
      echo $arOffer["CATALOG_QUANTITY"];
    }
  }
} else {
  echo $arParams["MESS_NOT_AVAILABLE"];
}


can anyone suggest how to do this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question