Hello, eglaw.
Thanks again for your module.
Problem:
information about the PVT table summary is displayed only in the footer of the form, but not in the bottom panel. The output in the panel would be more logical, because with large orders, it is important to see the final figures of the order before your eyes.
I tried to implement this as follows:
in "commerce_pvt/src/Plugin/views/area/TableSummary.php" in function "viewsForm" rewrite following rows:
$form['footer'] = [
'#type' => 'container',
'#weight' => 100,
];
$form['footer']['summary'] = [
'#type' => 'item',
'#markup' => $markup,
'#prefix' => '<div class="order-total-line">',
'#suffix' => '</div>',
];
to these ones:
// $form['footer'] = [
// '#type' => 'container',
// '#weight' => 100,
// ];
$form['actions']['summary'] = [
'#type' => 'button',
'#attributes' => [
'disabled' => TRUE,
'class' => ['order-total-line'],
],
'#value' => $markup,
];
Everything works, but this, IMHO, is another crutch. Is it possible to get the same effect in a more correct way?
best regards,
savage
Comments
Comment #2
savage1974 commentedComment #3
eglawHi,
first-thing-first you can always HOOK_form_alter in a custom module/theme and move, break, alter form-elements as you wish, without any further interventions.
Then, i don't quite understand what you mean with:
bottom panel => $form['actions'] ? If yes, then why should the table summary go there? It's not an action, but a simple markup, therefor i separated them into 2 different containers.
Yet again:
Just make the footer area of the form somehow scrollable in Fixed position with CSS inside your theme, or alter the form twig template and move it elsewhere...
Also, remember that the FormView (a drupal core view rendered as a Form) is not as simple and straightforward as a SimpleView (which shows data).

Cheers
Comment #4
savage1974 commentedHello, eglaw
Thank you for your answer.
1. css styles (via position: absolute)- not a variant at all. I "played" with it and the result was bad
2. "information about the PVT table summary is displayed only in the footer of the form, but not in the bottom panel." - see pic. 1
3. HOOK_form_alter - agree with you. I used a tip from the atricle and went easy. I'll make a hook and write the code here.
best regards
Comment #5
eglawAnyway - that's Theming questions ... it's nowhere near the modules functionality's concern.
So based on these observations the only thing (maybe) is to add a checkbox on table summary configuration form to make it sticky or something like that... and that'll be a feature request (which i am not ready to make right now).
You can propose the solution into a patch, i'll gladly look into it and merge if so.
Peace, #staysafecovid19
Comment #6
maximkashubaI suggest adding a new block `Commerce PVT summary` which can be placed anywhere on the page.
It provides the same summary data of the product variations added to the cart and has its own config. it is updated via ajax too the same as the cart block.
Here is my patch.
Comment #8
eglawThx for patch
Comment #9
eglaw