At the moment the module is not compatible with Commerce Cart View Override module(https://www.drupal.org/project/commerce_cart_view_override)
because module use a fix form_id "views_form_commerce_cart_form_default" for identify the cart view and some settings are not apply for my custom view cart.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

segi’s picture

Component: General » Quantity module
Status: Active » Needs review
FileSize
845 bytes

Here is my patch.

segi’s picture

Issue summary: View changes
segi’s picture

Ok, I missed something here is the updated patch.

5n00py’s picture

Can you post some form id's that commerce extra should handle?

Or way to reproduce this issue.

  • 5n00py committed 8c2e750 on 7.x-1.x authored by segi
    Issue #2512610 by segi, 5n00py: Compatibility with Commerce Cart View...
5n00py’s picture

Status: Needs review » Fixed

Thank you for patch, I have been tested it, works perfectly.
Committed.

segi’s picture

Yes, here it is a code snippet which gives back the option list for admin page, where you can choose the custom cart view.

<?php

foreach (views_get_all_views() as $view_name => $view) {
    if ($view_name != 'commerce_cart_form' && strpos($view_name, 'commerce_cart_form_') !== 0) {
      continue;
    }

    if ($view->base_table == 'commerce_order' && !empty($view->display['default']) &&
        !empty($view->display['default']->display_options['arguments'])) {

      $first_arg = reset($view->display['default']->display_options['arguments']);
      if (strpos($first_arg['id'], 'order_id') === 0) {
        $options[$view_name] = isset($view->human_name) ? check_plain($view->human_name) : $view_name;
      }
    }
  }

?>

So every views which start with the following machine name "commerce_cart_form_".

I hope it will help to you understand the problem.

5n00py’s picture

Yes. I already see this code ))) Tanks for the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.