I am using contemplate

When my cart is empty, this link points to
$node->links['add_to_cart']['href'] to cart/add/nid

but if the item is in the cart then there is not value for $node->links['add_to_cart']['href']

instead the $node->links['add_to_cart']['title'] is now a link to

This item is in Your shopping cart.

can $node->links['add_to_cart']['href'] be the item that changes to reflect state?

Comments

socialnicheguru’s picture

Priority: Critical » Normal

ok so I did this to get around it. I did not know the function of
$node->links['add_to_cart']['html']

if (!($node->links['add_to_cart']['html'])) {

print $base_path.$node->links['add_to_cart']['href']" >
Purchse this product

} else {

print $node->links['add_to_cart']['title']

}