All the Little Things

Posts: 146
Joined: 11/10/2007
Bug Finder

I'm starting this topic so we can post the little simple things that customers expect to see in a shopping cart. Like if the cart is empty add a "Go Shopping Link" and how to configure things that will make your customers shopping experience a peace of cake.

Hopefully some of these posts will make it into a Core Ubercart release.

I will start with the easiest.

1.) In uc_cart at line # 1177

You will see

// Returns the text displayed for an empty shopping cart.
function theme_uc_empty_cart() {
  return '<p>'. t('There are no products in your shopping cart.') .'</p>';
}

Change to:

// Returns the text displayed for an empty shopping cart.
function theme_uc_empty_cart() {
return '<p>'. t('There are no products in your shopping cart. <a href="catalog"> <u>Go Shopping</u></a>') .'</p>';
}

--

Give and you will receive, you will be given much. Pressed Down, Shaken together, Running Over, it will spill into your lap.

Posts: 151
Joined: 08/07/2007
AdministratorNot Kulvik

How about:

Change to:

// Returns the text displayed for an empty shopping cart.
function theme_uc_empty_cart() {
return '<p>'. t('There are no products in your shopping cart. <a href="catalog"> <u>Continue Shopping</u></a>') .'</p>';
}

It is a little change, but we are talking about little things Smiling
Peace,
Andy

Posts: 5379
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I'll also mention that b/c that's a theme function, you can override it in your theme's template.php so you don't have to hack the core module.

Posts: 146
Joined: 11/10/2007
Bug Finder

Thanks guys, I was looking into that same function after I posted.. I'm used to hard coding... I guess I need to get out of that habit and use the available functions ehhh.

To Ryan: The reason I started this Topic was in hopes that the simple obvious things could be added into Core with the overides.

Give and you will receive, you will be given much. Pressed Down, Shaken together, Running Over, it will spill into your lap.

--

Give and you will receive, you will be given much. Pressed Down, Shaken together, Running Over, it will spill into your lap.

Posts: 146
Joined: 11/10/2007
Bug Finder

Ok Folks here is the correct way to do it without modding the Core. Put this code in your current themes template file

function phptemplate_uc_empty_cart() {
return '<p>'. t('There are no products in your shopping cart. <a href="catalog"> <u>Continue Shopping</u></a>') .'</p>';
}

Give and you will receive, you will be given much. Pressed Down, Shaken together, Running Over, it will spill into your lap.

--

Give and you will receive, you will be given much. Pressed Down, Shaken together, Running Over, it will spill into your lap.