2 replies [Last post]
magnus's picture
Offline
Joined: 05/23/2008
Juice: 20
Was this information Helpful?

Hello,

I'm setting up a site that has no use of a detailed product view.

Is there a way to remove the link to the detail product view in the cart?

I tried to form_alter 'uc_cart_view_form' but the [title]['#value'] of each item is not modified to the value I wrote (e.g "test" instead of the <a href...>product name</a>)

thanks in advance,

--
magnus

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 850
Re: Remove links in cart

I have used some code before to do this...something like,

<?php
function your_module_form_alter($form_id, &$form) {
  if (
$form_id == 'uc_cart_view_form') {
    foreach (
$form['items'] as $key => $item) {
      if (!empty(
$item['title']['#value'])) {
       
$form['items'][$key]['title']['#value'] = "test";
      }
    }
  }
}
?>
Stanley Yeo's picture
Offline
Joined: 03/06/2011
Juice: 4
Re: Re: Remove links in cart

To retain the title, and only to remove the link...

<?php
function your_module_form_alter($form_id, &$form) {
  if (
$form_id == 'uc_cart_view_form') {
    foreach (
$form['items'] as $key => $item) {
      if (!empty(
$item['title']['#value'])) {
       
$form['items'][$key]['title']['#value'] = $item->title;
      }
    }
  }
}
?>