prinshaw Posted October 29, 2013 Posted October 29, 2013 Hello Everybody, I have a site shoppiiers.com and want o change the color of only particular product's name or price as in like FREE SAMPLE to RED color as present on the site. I have done it using directly <font color="RED"> from admin panel while assigning products name but the code is appearing on the site when we zoom the image and also on the TAB. Please give solution how to do it in the Stylesheet.css
Guest Posted November 7, 2013 Posted November 7, 2013 You need to add the style not only to your css stylesheet, but also assign it to the listing. Go to catalog/includes/modules/new_products.php This line is the one that shows all of the product info: $new_prods_content .= '<td width="33%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br />' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</td>'; so add your style to it: <a style="color:red;" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> ---OR-- <a class="color-red" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> and then add to your stylesheet: .color-red { color:red; } then you won't have to individually try to add it on every product, note that this change would only affect the new_products.php, if you wanted it sitewide you would need to add your style into the other files as well.
prinshaw Posted December 10, 2013 Author Posted December 10, 2013 Hey lost_in_normalcy thanks for ua guidance bt the thing is that i want to change only particular product name's font color or particular price tag's color. I have tried the above code but it assigns the same color to all the product name rather than any specific. So please give the solution.
multimixer Posted December 10, 2013 Posted December 10, 2013 Assuming the your product has id=13, you can add to your css following .productListingData a[href*="13"] {color: #f00;} This will change the colour on the product listing page for that product only My community profile | Template system for osCommerce - New: Responsive | Feedback channel
prinshaw Posted December 10, 2013 Author Posted December 10, 2013 hello multimixer, i have followiing link :- http://localhost/oscommerce2/catalog/product_info.php?products_id=30 so from this it appears dat my prod id is 30, but now i m not getting dat should i replace dis link with " * " in your above code or somethig else???
multimixer Posted December 10, 2013 Posted December 10, 2013 For products id = 30, you can use .productListingData a[href*="30"] {color: #f00;} This will work on the product listing page and make the product name red, unless you removed the class productListingData, in this case you need to adjust the selector My community profile | Template system for osCommerce - New: Responsive | Feedback channel
prinshaw Posted December 12, 2013 Author Posted December 12, 2013 hey multimixer, i have tried the above code but its not working... Plz giv the solution...
multimixer Posted December 12, 2013 Posted December 12, 2013 You free product has id=35 Remove the inline styling that you added and use the css rule, it is working fine. You don't have that rule added anywhere My community profile | Template system for osCommerce - New: Responsive | Feedback channel
Recommended Posts
Archived
This topic is now archived and is closed to further replies.