backdrop-contrib / ubercart

A flexible but easy-to-use e-commerce system for Backdrop.
https://backdropcms.org/project/ubercart
GNU General Public License v2.0
4 stars 10 forks source link

Subtotal in /cart/checkout/review "Cart" Area Controlled via GUI option? #505

Open ProfessorGram opened 1 month ago

ProfessorGram commented 1 month ago

Hello Everyone,

Has anyone else noticed this in:

sites/all/modules/ubercart/uc_cart/uc_cart_checkout_pane.inc

As:

/**
 * Displays the cart contents for review during checkout.
 */
function uc_checkout_pane_cart($op, $order, $form = NULL, &$form_state = NULL) {
  switch ($op) {
    case 'view':
       $contents['cart_review_table'] = array(
         '#theme' => 'uc_cart_review_table',
         '#items' => $order->products,
         '#weight' => variable_get('uc_pane_cart_field_cart_weight', 2),
      );
      return array('contents' => $contents, 'next-button' => FALSE);

    case 'review':
      //$review[] = theme('uc_checkout_pane_cart_review', array('items' => $order->products));
      $review[] = theme('uc_cart_review_table', array('items' => $order->products, 'show_subtotal' => FALSE));
        return $review;
  }
}

In the above function, a strange little bit of commenting controls how the cart contents are tallied in my Ubercart REVIEW ORDER page.

      //$review[] = theme('uc_checkout_pane_cart_review', array('items' => $order->products));
      $review[] = theme('uc_cart_review_table', array('items' => $order->products, 'show_subtotal' => FALSE));

But I have since discovered that there is at least ONE other option missing:

      //$review[] = theme('uc_checkout_pane_cart_review', array('items' => $order->products));
      //$review[] = theme('uc_cart_review_table', array('items' => $order->products, 'show_subtotal' => FALSE));
      $review[] = theme('uc_cart_review_table', array('items' => $order->products, 'show_subtotal' => TRUE));

A question. Instead of being hard coded and controlled using selective commenting applied to the codebase, why not turn this into an Administration GUI element? Wouldn't this be better implemented as a check box in the Ubercart configuration area at:

/admin/store/settings/checkout

In a new vertical tab - modeled, perhaps, on that which already exists to control elements of the "Payment pane"?

g.