Problem/Motivation

Most of the templates provided by Drupal commerce are ok out of the box.

But some need overrides for proper Bootstrap integration.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Grimreaper created an issue. See original summary.

grimreaper’s picture

Status: Active » Needs work
Related issues: +#3345265: details and fieldsets form elements

Not merging yet.

I need to test with multiple coupons.

Also fieldset/details theming is already in a dedicated #3345265: details and fieldsets form elements.

grimreaper’s picture

CSS needed on the login/register step for checkboxes.

grimreaper’s picture

Checkout progress:

Before:

After:

grimreaper’s picture

grimreaper’s picture

Assigned: grimreaper » pdureau
Status: Needs work » Needs review
StatusFileSize
new48.25 KB
new8.09 KB
new97.37 KB

Cart block:

Empty cart message:

Checkout layout, especially sidebar with card and coupons:

In addition to my comment https://git.drupalcode.org/project/ui_suite_bootstrap/-/merge_requests/8....

To add 2 classes to the "Go back" link in the checkout. I had to override a plugin, and so to put it in a module, so not possible to contrib it back... Here is the code for the record/example:


declare(strict_types = 1);

namespace Drupal\rockinghop_commerce\Plugin\Commerce\CheckoutFlow;

use Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault as CommerceMultistepDefault;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link;

/**
 * Add classes to previous link.
 *
 * As this is a plugin and the link is rendered early, not possible to alter it
 * in the theme.
 *
 * @CommerceCheckoutFlow(
 *     id = "multistep_default",
 *     label = "Multistep - Default",
 * )
 */
class MultistepDefault extends CommerceMultistepDefault {

  /**
   * {@inheritdoc}
   */
  protected function actions(array $form, FormStateInterface $form_state): array {
    $actions = parent::actions($form, $form_state);

    $steps = $this->getSteps();
    $next_step_id = $this->getNextStepId($form['#step_id']);
    $previous_step_id = $this->getPreviousStepId($form['#step_id']);
    $has_next_step = $next_step_id && isset($steps[$next_step_id]['next_label']);
    $has_previous_step = $previous_step_id && isset($steps[$previous_step_id]['previous_label']);

    if ($has_next_step && $has_previous_step) {
      $label = $steps[$previous_step_id]['previous_label'];
      $options = [
        'attributes' => [
          'class' => [
            'link--previous',
            'btn',
            'btn-link',
          ],
        ],
      ];
      $actions['next']['#suffix'] = Link::createFromRoute($label, 'commerce_checkout.form', [
        'commerce_order' => $this->order->id(),
        'step' => $previous_step_id,
      ], $options)->toString();
    }

    return $actions;
  }

}

grimreaper’s picture

Also, details and fieldsets, will have to be handled in the dedicated issue.

pdureau’s picture

Assigned: pdureau » grimreaper
Status: Needs review » Reviewed & tested by the community

I didn't test with local instance, but the live demo you showed me today was OK.

  • Grimreaper committed 9567f4a9 on 5.0.x
    Issue #3355673 by Grimreaper, pdureau: Drupal Commerce support
    
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks!

Merged.

Status: Fixed » Closed (fixed)

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