Author Topic: *V Urgent* Browse styling problem *** PLEASE HELP!***  (Read 6394 times)

strebblo

  • Beginner
  • *
  • Posts: 25
*V Urgent* Browse styling problem *** PLEASE HELP!***
« on: January 16, 2009, 13:04:17 pm »
Hi Everyone

I really need some help with this quite urgently, so that I have enough time to finish the rest of the site.

The issue seems to be that the items when you either list all products or look at items in their categories, they display differently to the way I thought I'd styled them in the CSS.

They were fine a few weeks ago, then I started styling other parts of the site, and when I came to look at the way the items were listed, they were styled ...strangley!
I'm not sure when it happened, or what I've changed to make the difference, but I can't seem to change it back.


The way it should be (items listing) is:

Item image in top left of the 'box', then the price in top right, THEN description below these, followed by the price and add to cart buttons.

Now, somehow, even though the image comes first in the php code, the item description is at the top and I can't get back the nice even layout I had before.

Please look here:

http://bm-camping.co.uk/jvmc/index.php?orderby=product_cdate&DescOrderBy=DESC&Itemid=1&option=com_virtuemart&page=shop.browse&category_id=&manufacturer_id=0&keyword=&keyword1=&keyword2=


Please try and help if you can, I'm DESPARATE to get this sorted and the site has to go live in less than 2 weeks, so I am panicking now!

I can happily post up any code that is needed, I think I just need someone to point out the offending code - I'm sure it's been over ridden somewhere by conflicting code.

Many thanks - Fred

Dave Withnall

  • Beginner
  • *
  • Posts: 47
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #1 on: January 19, 2009, 12:30:23 pm »
Your code does not output the content as you describe.
It comes out as Title, Price, Description, Image, Rating, AddToCart

Secondly, you are using id tags for styling when you should be using classes. Ids are for unique elements on your page only.

You have some bizarre floats & margins in your css, and the css is declared incorrectly. You are missing closing } on some of the elements.

Change your code so that image comes out before description and use css like this

.browseProductTitle { width: 100%; }
.browsePriceContainer {width: 49%; border: 0; margin: 0; padding: 0; float: right; }
.browseProductImageContainer {width: 49%; border: 0; margin: 0; padding: 0; float: left;}
.browseProductDescription {width: 100%; margin: 0;}
.browseRatingContainer {width: 100%; text-align: center; }

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #2 on: January 19, 2009, 12:36:07 pm »
Firstly, a huge thanks Dave, this is a pretty sparse forum!!

Would you mind checking back? I'll have a good look through my code and make some changes as you suggest, I'll post back here this eveing if I get anywhere, or get stuck.

Thanks again - a fresh pair of eyes makes a big difference ;)

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #3 on: January 21, 2009, 12:52:44 pm »
That did do something, but I think that as I started off with a joomla skeleton template that came with css, plus all of the cr*p that VM shoves in there, I'm on to a bit of a loser here.

I think I'll just have to strip the code right back to basics and almost start again. I cannot believe how much mess and crud there is in there... :(
Why on earth is there CSS strewn throughout the VM code? Why the hell isn't everything located in one place?? Grr!!
Granted, I couldn't do better at the moment, but then I'm not writing and offering this for general consumption.

Thanks for the help, though I don't think I'll be using VM again after this project... this has not been a good experience for me.

Dave Withnall

  • Beginner
  • *
  • Posts: 47
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #4 on: January 21, 2009, 13:01:33 pm »
I've had the same thoughts on numerous occasions.
Everytime I've used Joomla/VM I've started from scratch. It's just easier than trying to adapt the existing bits.

Unfortunately I haven't found a cart/cms combo that works as well as this.

If you find one I wouldn't mind knowing about it.

D.

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #5 on: January 21, 2009, 13:04:02 pm »
Well I'm glad I'm not on my own there then!!
That makes me feel a bit better - thanks..

Fred

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #6 on: January 21, 2009, 13:17:52 pm »
I am right in thinking that "browse_1.php" is the file with the code that relates to the item layout pages, aren't I?

It seems that the image/description and other bits have moved around! Unless I looked at a different file (that looked the same as this?!) it has changed somehow!

Well I've put the order as:

Title
Image container
Price container
Product container
Rating container
Add2cart container

Does that seem right? I'll try and move them around a bit.

Cheers

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #7 on: January 21, 2009, 13:31:19 pm »
Infact in addition to the above, if that IS the right page, when I take my n00b glasses off, I can see that all of the divs are ID's! That may be why I'm having some trouble?

hellodave

  • Jr. Member
  • **
  • Posts: 100
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #8 on: January 21, 2009, 13:35:23 pm »
Well, ID`s are ok sometimes :)
The rule is, if there is only 1 of it on the page, use ID, if there are more than one, use class. Hope that helps.
currently working with -
Joomla 2.5.8
VM 2.0.18a

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #9 on: January 21, 2009, 13:55:16 pm »
Good advice it seems - annoying that this is the virgin VM code though.
In your opinions, should I keep the "browseProductContainer" DIV as an ID, and all the rest (in this file) as classes?

As below (browse_1.php):

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
 
?>

 <div id="browseProductContainer">
       
       
        <div class="browseProductTitle">
<a title="<?php echo $product_name ?>" href="<?php echo $product_flypage ?>">
            <?php echo $product_name ?></a>
        </div>

        <div class="browseProductImageContainer">
        <script type="text/javascript">//<![CDATA[
        document.write('<a href="javascript:voclass window.open(\'<?php echo $product_full_image ?>\', \'win2\', \'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,wclassth=<?php echo $full_image_wclassth ?>,height=<?php echo $full_image_height ?>,directories=no,location=no\');">');
        document.write( '<?php echo ps_product::image_tag$product_thumb_image'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ?></a>' );
        //]]>
        </script>
        <noscript>
            <a href="<?php echo $product_full_image ?>" target="_blank" title="<?php echo $product_name ?>">
            <?php echo ps_product::image_tag$product_thumb_image'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ?>
            </a>
        </noscript>
        </div>

        <div class="browsePriceContainer">
            <?php echo $product_price ?>
        </div>
        <div class="browseProductDescription">
            <?php echo $product_s_desc ?>&nbsp;
            <a href="<?php echo $product_flypage ?>" title="<?php echo $product_details ?>"><br />
<?php echo $product_details ?>...</a>
        </div>
       
        <div class="browseRatingContainer">
        <?php echo $product_rating ?>
        </div>
<br />
        <div class="browseAddToCartContainer">
        <?php echo $form_addtocart ?>
        </div>

</div>

Dave Withnall

  • Beginner
  • *
  • Posts: 47
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #10 on: January 21, 2009, 14:10:18 pm »
Replace it with a class.
Each product that shows up in a category listing is contained within a browseProductContainer. id's are only for unique page items.

Nirm

  • Contributing Developer
  • Full Member
  • *
  • Posts: 919
    • Me, My Work and I
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #11 on: January 21, 2009, 14:14:37 pm »
Dave

Quote
Unfortunately I haven't found a cart/cms combo that works as well as this.
If you find one I wouldn't mind knowing about it.

You may want to look at www.magentocommerce.net, however, learning curve is steep!
A lot of questions are answered in the VM 1.1 User Manual please read it before asking questions.
-------------------------------------
http://www.nirmoysomaia.com

hellodave

  • Jr. Member
  • **
  • Posts: 100
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #12 on: January 21, 2009, 14:18:16 pm »
Yeah I agree with Mr Withnall, they all need to be classes.
Unless you only have one product on your browse page!
currently working with -
Joomla 2.5.8
VM 2.0.18a

strebblo

  • Beginner
  • *
  • Posts: 25
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #13 on: January 21, 2009, 14:24:10 pm »
hmm.. did that, and it made no difference, so I checked, and I hadn't even written CSS for it yet.

Did a quick check to see if it was referenced anywhere else, and surprise, surprise - it's nestled with a load more CSS that refers to this page in
Code: [Select]
"..\components\com_virtuemart\themes\default\theme.css"!!

Typical VM I'm finding..
no wonder it was giving strange results. Good God this makes your head hurt



Dave
Quote
Unfortunately I haven't found a cart/cms combo that works as well as this.
If you find one I wouldn't mind knowing about it.
You may want to look at www.magentocommerce.net, however, learning curve is steep!


As opposed to VM!!?!
Will have a look for next time - Thanks.

Dave Withnall

  • Beginner
  • *
  • Posts: 47
Re: *V Urgent* Browse styling problem *** PLEASE HELP!***
« Reply #14 on: January 21, 2009, 15:49:59 pm »
I have to say one of the more annoying things VM does is the way it switches between MVC & old style html/php coding.

Take the checkout process for instance.

You start off fine with the shop.cart template which loads one of the basket templates.

But the next stage dumps you straight into the admin component stuff which gets updated. That follows through up until the thankyou page which jumps back to the templates.

Things like that, along with the css assigned directly to page elements in the code, are incredibly frustrating. As soon as you change it, you pretty much lose your ability to upgrade.

Meh, enough whinging.