rstepos Posted February 8, 2010 Share Posted February 8, 2010 if( _SHOW_PRICES && $auth['show_prices'] ) { $data[$row][] = $product['product_price']; } $data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">' . ps_product::image_tag( $product['product_thumb_image'] ) . '</a>'; $data[$row][] = $product['product_s_desc']; if( $product['has_addtocart'] ) { $data[$row][] = $product['form_addtocart']; } else { $data[$row][] = '<a href="'.$product['product_flypage'].'" title="'.$product['product_name'].'">' <div style="background-image:url(./~ladolcev/components/com_virtuemart/themes/default/images/add-to-cart_blue.jpeg);background-repeat:no-repeat;height:27px;width:140px;font-weight:bold;padding-left:7px;padding-top:5px; </div> } $row++; } this is what i have entered but i dont seem to be getting anywhere?! any ideas to get this working? Quote Link to comment Share on other sites More sharing options...
Adam Posted February 8, 2010 Share Posted February 8, 2010 .. Where are you wanting to go? Quote Link to comment Share on other sites More sharing options...
rstepos Posted February 8, 2010 Author Share Posted February 8, 2010 basically my issue is with the <div section after else i want an image displayed to the right of each entry that will be pulled from the database but i keep getting a multitude of errors displayed. This image will be clicked upon by vistors to the site which will take them to a product details page. any help will be very much appreciated!! Quote Link to comment Share on other sites More sharing options...
brainstorm316 Posted February 8, 2010 Share Posted February 8, 2010 I know this may be a really stupid answer, it may just be the fact that this forum only allows a certain width of post... but ... <div style="background-image:url(./~ladolcev/components/com_virtuemart/themes/default/images/add-to-cart_blue.jpeg);background-repeat:no-repeat;height:27px;width:140px;font-weight:bold;padding-left:7px;padding-top:5px; isn't closed... should be: <div style="background-image:url(./~ladolcev/components/com_virtuemart/themes/default/images/add-to-cart_blue.jpeg);background-repeat:no-repeat;height:27px;width:140px;font-weight:bold;padding-left:7px;padding-top:5px;"> Quote Link to comment Share on other sites More sharing options...
rstepos Posted February 9, 2010 Author Share Posted February 9, 2010 completely missed the > to close the div but unfortunately im now getting Parse error: syntax error, unexpected T_STRING in /home/ladolcev/public_html/components/com_virtuemart/themes/default/templates/browse/includes/browse_listtable.tpl.php on line 61 which is that same div line Quote Link to comment Share on other sites More sharing options...
Adam Posted February 9, 2010 Share Posted February 9, 2010 That's because you're closing the string on the previous line. Move the single quote on the end of the previous line to after </div> followed by a semicolon. Quote Link to comment Share on other sites More sharing options...
rstepos Posted February 9, 2010 Author Share Posted February 9, 2010 thanks mr adam that solved the error but the image is not displaying on the page once it loads i am now wondering if it is because this is generating a html table to display the data?? completely no idea here is a screen shot of what i now have basically i am looking for the image to be displayed to the right of the first three products as the must be customised thanks again guys this has to be one of the best forums Quote Link to comment Share on other sites More sharing options...
Adam Posted February 9, 2010 Share Posted February 9, 2010 That's because you're div tags are empty. If you were to force white space with you should see it appear. Would an <img /> tag not be better suited here though? Quote Link to comment Share on other sites More sharing options...
rstepos Posted February 9, 2010 Author Share Posted February 9, 2010 i'm kind of flying blind here, this is my first real go at php, how would i go about implementing an /img tag? sorry for the lame question!! :-\ Quote Link to comment Share on other sites More sharing options...
Adam Posted February 9, 2010 Share Posted February 9, 2010 This is now a HTML error, not PHP. The reason your image isn't showing is because you're applying it as a background image in a empty div - which because it's empty isn't showing. You can 'force' it to display by adding in whitespace with (remember normal whitespace is ignored by default in HTML). As I was saying however, a normal HTML image tag seems like it would be better suited here. Quote Link to comment Share on other sites More sharing options...
rstepos Posted February 9, 2010 Author Share Posted February 9, 2010 mr adam you are the man, have now got the image displaying simply using the img tag only issue is that it is a little further to the right than the add to cart images but i suppose i could edit the white space to make it longer in photoshop or something. I'll give it a go and report back but thanks again Quote Link to comment Share on other sites More sharing options...
rstepos Posted February 9, 2010 Author Share Posted February 9, 2010 :D mr adam thanks!!! problem solved, would never have got there without your help man thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.