-foreach ($entityProducts as $product)
+foreach ($entityProducts as $basketXmlId => $entityProduct)
, и после 76-й добавить так:'TYPE' => $productData['TYPE'] ?? null,
+ 'XML_ID' => $basketXmlId,
if (
isset($basketItemsStoreQuantity[$basketId])
&& !isset($basketItemsStoreQuantity[$basketId][$storeId])
)
{
continue;
}
тоесть доп поле в бд для шаблона программ
потом просто в основной шаблон подставить плейсхолдер, который подтянет шаблон программ?
<?php
$student = Student::with('studentprograms')->find(\request('student_id'));
$programText = '';
$programTemplate = StudentProgramTemplate::first()->body;
foreach ($student->studentprograms as $program) {
$programPlaceholders = [
'[nazvaniye_programmy]' => $program->program->name,
'[vid_obucheniya]' => $program->study_type,
'[vsego_chasov]' => $program->program_period,
'[DATA_S]' => $program->date_start ? Carbon::parse($program->date_start)->format('Y-m-d') : '',
'[DATA_PO]' => $program->date_finish ? Carbon::parse($program->date_finish)->format('Y-m-d') : '',
'[nomer_diploma]' => $program->diploma_number,
'[data_diploma]' => $program->diploma_date ? Carbon::parse($program->diploma_date)->format('Y-m-d') : '',
];
$programText .= str_replace(array_keys($programPlaceholders), array_values($programPlaceholders), $programTemplate);
}
$mainPlaceholders = [
'[FIO_1]' => $student->name,
'[data_rojdeniya]' => $student->birthday,
'[pasport]' => $student->passport,
'[INN]' => $student->inn,
'[SNILS]' => $student->snils,
'[Dokument]' => $student->diplom_place,
'[Nomer_diploma]' => $student->diplom_number,
'[Data_diploma]' => $student->diplom_date,
'[Adres]' => $student->registration_address,
'[Telefon]' => $student->phone,
'[E-mail]' => $student->email,
'[student_programs]' => $programText,
];
$originalTemplate = PortfolioTemplate::first()->body;
$finalOutput = str_replace(array_keys($mainPlaceholders), array_values($mainPlaceholders), $originalTemplate);
?>
foreach ($student->studentprograms as $program)
крутить только второй шаблон. <script> ... </script>
, раскиданная по странице, должна быть не просто императивным кодом, а именно постановкой колбэков в очередь исполнения.async function init(){
instance = await WebAssembly.instantiate(await load('...wasm...'),{env:env})).instance;
instanceTwo = await WebAssembly.instantiate(await load('...wasm...'),{env:env})).instance;
// ....
}
/bitrix/cache
/bitrix/managed_cache
/bitrix/stack_cache
Сами папки должны остаться.