Hi I can not figure out how you change the checkout link on the cart block to href=/cart. I know the checkout is created in the shopping cart (commerce order) view by the Footer with Commerce Line Item: Line Item Summary by checking Checkout for links. But in Kickstart 2.0 the link is some how changed to /cart where when I use in my view on I am getting /checkout. I likes to have it go to /cart to. Any help would be great. Thank you.

Comments

theo_’s picture

Status: Active » Fixed

We have a hook for that :), it's called hook_commerce_line_item_summary_link_info($links).

Then you just need to implement the hook and do whatever you want with line item summary links even change the checkout link to the cart, like we did there.

Status: Fixed » Closed (fixed)

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

paultrotter50’s picture

So for anyone else trying to achieve this in your custom .module code you write something like the code below. This code changes the link to point at the start of the checkout process rather than the cart view itself:

/**
* Implements hook_commerce_line_item_summary_link_info_alter().
* Change link destination/href of checkout link
*/
function YOUR_MODULE_NAME_commerce_line_item_summary_link_info_alter(&$links) {
  // Link checkout button to the cart.
  if (isset($links['checkout'])) {
    $links['checkout']['href'] = 'checkout';
  }
}

Obviously changing YOUR_MODULE_NAME to the short name of your module