drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 14:39:08
My quickbuy and detail link buttons are getting sucked up into the text of the actual product name (div.prodname) on the products.php pages. It is fine if the <div class="prodrating"></div> is there (even with no content). The issue I have, is that if there is no product rating, the buttons are covering the names, if the product has a review, everything is fine. If the product doesnt have a review, but I insert <div class="prodrating"></div> in the proper spot, the buttons dont cover up the name anymore. How do I get the <div class="prodrating"></div> div to display even if it has no content?
When it gets late at night, go to bed... try again tomorrow.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 15:47:53
or is there a way that if there are no current ratings for a product, to have the words "not rated yet" appear in the <div class="prodrating"></div> on the products.php page to allow for the <div class="prodrating"></div> div to appear?
When it gets late at night, go to bed... try again tomorrow.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 16:12:23
get something like this to work on products.php and not just proddetail?
$detailreviewnoratings='<div class="detailnoratings"><a href="#reviews"><img src="images/reviewcartgno.gif" style="vertical-align:middle;margin:0px;"><img src="images/reviewcartgno.gif" style="vertical-align:middle;margin:0px;"><img src="images/reviewcartgno.gif" style="vertical-align:middle;margin:0px;"><img src="images/reviewcartgno.gif" style="vertical-align:middle;margin:0px;"><img src="images/reviewcartgno.gif" style="vertical-align:middle;margin:0px;"><br>Login to Review!</a> </div>';
When it gets late at night, go to bed... try again tomorrow.
|
Marshall
Ecommerce Template Guru
USA
1916 Posts |
Posted - 02/11/2018 : 16:13:23
Without looking at the CSS, sounds like a float issue. Can you supply a URL?
Marshall CENLYT Productions - ms designs Affordable Web Design Custom Ecommerce Designs Responsive Websites Cenlyt.com
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 16:38:39
Riverside av dot com / index1 dot php
When it gets late at night, go to bed... try again tomorrow.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 16:41:05
Also, with the code above, the link does nothing when using dynamic tabs and the review tab is closed...is there a way to link to the review product page?
When it gets late at night, go to bed... try again tomorrow.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 16:55:43
should probably mention that it is at 480 pixels and smaller when hiding the description in order to clean everything up. With the <div class="prodratings></div> line added, everything is clean and it hurts nothing. The problem being that the <div class="prodratings></div> is only printed to the screen when there is a review, otherwise it is non-existent. By keeping <div class="prodratings></div> there continually, it is good. Is there a way to keep the <div class="prodratings></div> there and add its contents when a review is left?
Or to use the code above on the products.php page like it can be used on the product details page? Anything that I can do to take up the space beneath the name and above the buttons would be great.
When it gets late at night, go to bed... try again tomorrow.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 16:58:39
I could fix it I guess by adding positive margin to the name and negative margin to the reviews, but think that adding the no review code above or adding the div to be present regardless of reviews would make a smaller css file?
When it gets late at night, go to bed... try again tomorrow.
|
dbdave
ECT Moderator
USA
10468 Posts |
Posted - 02/11/2018 : 18:01:18
You could use Javascript to check if that div exists, and if not, add some css to overcome it. If you don't know how to that that, I may be able to whip something up.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 18:58:50
The div exists, but only when a review for the product exists. I temporarily am using css to combat it, but its padding the css file which is never good :) Does anyone know if we can use the no ratings code above on the products page?
When it gets late at night, go to bed... try again tomorrow.
|
dbdave
ECT Moderator
USA
10468 Posts |
Posted - 02/11/2018 : 19:34:15
quote: The div exists, but only when a review for the product exists.
 I repeat, You could use Javascript to check if that div exists, and if not, add some css to overcome it. If you don't know how to that that, I may be able to whip something up.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 23:22:58
Sure thing, Im open to help on this one!
When it gets late at night, go to bed... try again tomorrow.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/11/2018 : 23:25:05
Also, I would really like to use the no reviews code above om the products page... I have searched the forum and found no reference on how to do this... anyone point me in the right direction?
When it gets late at night, go to bed... try again tomorrow.
|
dbdave
ECT Moderator
USA
10468 Posts |
Posted - 02/12/2018 : 07:34:41
I had looked at the page you mentioned last night, but I did not see an example of the issue.
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/12/2018 : 08:45:45
I am using heavy css to temporarily fix the issue, and about 16 media breaks. Anyone know if we can use the noratings code above on the products page and not just details page?
I cant find a way to make the <div class="prodrating"></div> to be present when there is no product rating (which fixes the issue with no additional css and no harm to current lay outs)
If you go to the screens category, you will see 2 with no review, check out page source and compare to the product with a review... you will see the div isnt being written
When it gets late at night, go to bed... try again tomorrow.
|
dbdave
ECT Moderator
USA
10468 Posts |
Posted - 02/12/2018 : 09:06:11
Ok, I will take a look this evening.
It actually may be possible to solve all of the problems you mention with javascript. Javascript can make changes in the DOM when other languages can't. We can insert things that are not there in the original script. All with no hacking to the core files.
Edited by - dbdave on 02/12/2018 09:07:04
|
drivers
Ecommerce Template Expert
USA
890 Posts |
Posted - 02/12/2018 : 12:10:53
That sounds like a plan!
When it gets late at night, go to bed... try again tomorrow.
|
dbdave
ECT Moderator
USA
10468 Posts |
Posted - 02/12/2018 : 20:27:07
Ok, I think I have you a solution. You will want to put back the styling you had before I guess because we will be adding in the prodrating div for products where it does not exist. The way we are going to do this is use one of the custom fields. If you already have them all accounted for on the details page, we can actually use one on the products page anyway.  This assumes you are using the $productpagelayout= in your includes, and I suspect you are. So choose a custom field to use and put it right after the reviews - example $productpagelayout='productimage, productid, reviewstars, custom1, description, price'; Upload that and next, you need to be sure you have something in the admin on your products for the custom1 field. If there is no content, then it is hidden, just like the product ratings.  So go into your products and add this in the custom1 fields for all products - <span></span> (see tip at end of post) that's it. Just an opening and closing span tag. This assures that nothing will show for the custom1 field and it will not take up any space. BTW - You want be be sure that the custom1 div has no styling at all in your stylesheet, or anywhere. Now just open products.php in your editor and near the bottom on the page, before the closing </body> tag, (before any tracking, analytics, codes) add the following magic. <script> var x = document.getElementsByClassName("product"); var adddiv = ('<div class="prodrating">Add anything you want to show here unless it has an apostrophe in that case we need to escape it</div>'); var i; for (i = 0; i < x.length; i++) { var rtgck = x[i].innerHTML var rtg = rtgck.match(/prodrating/g); if (rtg == null){ document.getElementsByClassName("prodcustom1")[i].innerHTML = adddiv; }} </script> Whats going on there is we iterate through the product divs looking for that prodrating div and if it's not there, we make use of the custom1 and turn it into a prodrating div where you have added what you want there, replacing what I have in green. Give it a shot and let me know how you get along. Oh, another awesome thing - Some time back Vince added the ability to add custom database columns to the quick update in the admin. https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=109004 I just tested this with the custom field and it works great. Mind you I have .asp, but for .php it should be $customquickupdate="pCustom1"; in your includes. This will add the ability to fill in that custom field in a jiffy. 
Edited by - dbdave on 02/12/2018 20:59:02
|
|
|