- π΅π±Poland sayco ToruΕ
It seems like the issue is related to the https://www.drupal.org/project/drupal/issues/2504115 β
I've figure out some sort of solution proposed here for a views module
https://www.drupal.org/project/drupal/issues/2504115 βwhich will allow us to access the original views_path that is sent over with the main request.
I've add my own implementation to the hook_preprocess_views_view, but for the commerce_cart module it could be more or less as follows:function commerce_cart_preprocess_views_view(&$variables) { $view = $variables['view']; if (strpos($view->storage->get('tag'), 'commerce_cart_form') !== FALSE) { $variables['rows']['footer'] = $variables['footer']; $variables['footer'] = ''; $request = \Drupal::requestStack()->getMainRequest(); $is_ajax_reload = $request->isXmlHttpRequest() && $request->request->get('_drupal_ajax') === '1'; if (FALSE === $is_ajax_reload) { return; } $variables['rows']['#action'] = $request->request->get('view_path'); } }
Seems to be working as expected now.
- π¨π³China lawxen
We have similar ajax problem when using commerce_ajax_atc when filer product name.
After some debug, I found it caused by this code
$form_state->setUserInput($view->getExposedInput());
in ViewsExposedForm
which missing trigger_element*** caused input of exposed views be replaced.Below is our tmp fix solution
/** * Implements hook_form_views_exposed_form_alter(). */ function MODULE_NAME_form_views_exposed_form_alter(array &$form, FormStateInterface $form_state, $form_id) { if ($form['#id'] == 'views-exposed-form-commerce-products-products') { /** @var \Drupal\views\ViewExecutable $view */ $view = $form_state->get('view'); $view_id = $view->id(); $view_display = $view->current_display; if ($view_id == 'commerce_products' && $view_display == 'products') { $form_state->setUserInput($_GET); } } }