psynaptic Posted February 25, 2007 Posted February 25, 2007 I'm trying to hack the Add to Cart buttons in the product listing so that when a product has attributes it shows a 'View Details' instead of 'Add to Cart' button. I found a contribution that changes all Add to Cart buttons on pages other than product_info to View Details: View Details instead of Add to Cart However, I would really like to have the buttons switch between Add to Cart and View Details depending on if the product has attributes or not. I have tried doing the following in modules/product_listing.php: case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { $lc_text .= 'has attributes'; } else { $lc_text .= 'no attributes'; } This is an effort to find out if tep_has_product_attributes will work for what I want to achieve. Unfortunately, it just echos 'no attributes' whether the product has them or not. Does anyone know why it's not working? My Profile | Contribs I like most: 'On The Fly' Auto Thumbnailer, Active Countries, Header Tags Controller, Ultimate SEO URLs, UK Based osC, UK Postcode Validation, Open Featured Sets, UK Postcode Based Carrier Shipping
psynaptic Posted February 26, 2007 Author Posted February 26, 2007 If anyone need an answer to this: See this thread. My Profile | Contribs I like most: 'On The Fly' Auto Thumbnailer, Active Countries, Header Tags Controller, Ultimate SEO URLs, UK Based osC, UK Postcode Validation, Open Featured Sets, UK Postcode Based Carrier Shipping
Recommended Posts
Archived
This topic is now archived and is closed to further replies.