I
I
Igor2020-01-10 22:20:55
1C-Bitrix
Igor, 2020-01-10 22:20:55

Pass Bitrix SKU value?

Good afternoon.
Tell me how to transfer the SKU by reference? to open a trade offer of the color that was sent in the link?
Like /catalog/p/element_code/sku_code/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2020-01-11
@peretc001

In the standard catalog complex component template, such a URL is not supported, but can be done via the get parameter.
In the IB settings of trade offers, you can write the following:
URL of the detailed view page: #PRODUCT_URL#?oid=#ELEMENT_ID#, and add processing in the catalog.element component template

$oid = intval($_REQUEST["oid"]);
if ($oid > 0) {
    foreach ($arResult['JS_OFFERS'] as $key => $jsOffer) {
        if ($jsOffer["ID"] == $oid) {
            $arResult['OFFERS_SELECTED'] = $key;
            break;
        }
    }
}

If the template is standard or based on it, then it should help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question