Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / Moving Add to Cart selections to top of product page?

Moving Add to Cart selections to top of product page?

Locked

Started by kismetdesign on 22 Jul 2009, 2:15 AM · Views: 3,202

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
22 Jul 2009, 2:15 AM
#1
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #1 by kismetdesign

I'm wondering how to move my Add to Cart options from the bottom of my product page template up to the top. If you'd like to check the page out, you can see it at http://tinyurl.com/nosvkr . (I shortened it for you.) Ideally, I'd like to move the selections & attributes from the bottom up to right under the Release Date.

Thanks for any help!

-KismetDesign :smile:

22 Jul 2009, 4:24 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #2 by niccol

It is a relatively simple edit of tpl_product_info_display.php. This is a really well commented file, so I am sure that you'll find the right blocks of code to move - and where to move them to.

Any problems, just reply here and we'll have a look.

On the default version of this file it is lines 89-143 that get moved. Slot them back in around line 75. But I suspect yours is not a default version.

Nick
iszent.com

26 Jul 2009, 12:47 AM
#3
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #3 by kismetdesign

Well, I've done a ton of design & extra development work on this template that I started with, because of my client's specifications. I'm hoping by the time we launch I'll have a whole lot more experience with Zen Cart and be able to give back in the forums here. :smile:

You said to edit the tpl_product_info_display.php

I've got four of those, 2 located in my includes folder, one in my main cart folder, and one in my edit_cart folder. I'm assuming I need to change one of the files in the includes folder?

Thanks for your help! I really appreciate it. :P

26 Jul 2009, 1:03 AM
#4
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #4 by kismetdesign

Okay, I found the right file.

I moved the two modules that I needed, up to the top of the page, but.... take a look at how it is now ??? http://tinyurl.com/nosvkr

It moved the 'Please Choose' up to the right place, but the rest of it has moved down the page. I wanted everything right underneath. :blink:

Hoping this can be fixed :smile:

26 Jul 2009, 9:29 AM
#5
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #5 by niccol

Oh, yes, oops - should have thought about that.

It has to do with the way the elements are positioned using floats. I am not sure how much you know / want to know about positioning so if you want the long explanation just ask.

In the source code of your page you will see:

<!--bof Attributes Module -->
<div id="productAttributes">
<h3 id="attribsOptionsText">Please Choose: </h3>

<div class="wrapperAttribsOptions">
<h4 class="optionName back">eBook Format</h4>
<div class="back">
<input type="checkbox" name="id[1][45]" value="45" id="attrib-1-45" /><label class="attribsCheckbox" for="attrib-1-45">Adobe Digital Editions</label><br />
<input type="checkbox" name="id[1][16]" value="16" id="attrib-1-16" /><label class="attribsCheckbox" for="attrib-1-16">Microsoft Reader</label><br />
<input type="checkbox" name="id[1][25]" value="25" id="attrib-1-25" /><label class="attribsCheckbox" for="attrib-1-25">Mobipocket Reader</label><br />

</div>
<br class="clearBoth" />
</div>

<br class="clearBoth" />

</div><!--eof Attributes Module -->

<!--bof Add to Cart Box -->

<div id="cartAdd">

It is the <br class="clearBoth" /> that are causing the text to be pusshed down below the image ( which is floated left on the page).

We need to edit them.

In tpl_modules_attributes.php find:

<div class="wrapperAttribsOptions">
<h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
<div class="back"><?php echo "\n" . $options_menu[$i]; ?></div>
<br class="clearBoth" />

</div>
<?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
    <div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
<?php } ?>

<?php
if ($options_attributes_image[$i] != '') {
?>
<?php echo $options_attributes_image[$i]; ?>
<?php
}

?>
<br class="clearBoth" />
<?php
    }
?>

You need to change the two <br class="clearBoth" /> (red) to <br/>.

Have a look and see what that does.

It is probably needed / a good idea to change the two blue 'back' to 'attrib-back' this will disable them for the time being but will allow us the option of re-instating them later.

You may want to test this on a page with multiple attributes if you have any:smile: The problem you might have is that the text wraps around the image in a weird way. If this is the case then it probably makes sense to change the image from the left of the page to the right of the page. This isn't hard to do. Let me know!

Hope this helps

Nick
iszent.com

26 Jul 2009, 3:01 PM
#6
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #6 by kismetdesign

I'm going to attach a screenshot of what my code looks like on the product listing. It doesn't look like what you wrote above, but the second item of code you posted does....

So I changed the second one anyway, hoping it would help... uploaded it... no change.

Should I try changing the code in the first file to what you wrote and see what happens? I am backing up my original files, FYI. :smile:

KismetDesign :P

26 Jul 2009, 3:44 PM
#7
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #7 by niccol

OK the first code was what is being output to the browswer ( got by view source in firefox) It is there to show you which elements in the page we are trying to get rid of. (It is actually taken from your page so I know its the right one)

If you are having layout problems always look at the source code of the page. In firefox it is view>>>page source. In IE it is something similar but I can't remember exactly what.

The second block of code was taken from a default version of tpl_module_attributes.php. I'd be surprised if your version of this file was majorly different.

Make the changes to tpl_module_attributes.php that I have suggested and let me know and I will have a look at the page.

Nick
iszent.com

26 Jul 2009, 3:47 PM
#8
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #8 by niccol

And do you know that on this page you say that Walter Cronkite is a accomplished chef, pastry chef and baker.

Which he may have been. It would be nice to think so. But I think you mean Russel.

Nick
iszent.com

26 Jul 2009, 3:49 PM
#9
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #9 by niccol

And yes, you can put the attributes and buy now under the image but you are going to have a similar issue with the floats and the clear:both s.

Nick
iszent.com

27 Jul 2009, 5:01 PM
#10
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #10 by kismetdesign

Obviously I had made that change before my morning coffee had settled in. LOL. It's fixed now.

I did make the changed you suggested to the tpl_modules_attributes, and had already uploaded those changes when I took that screenshot I sent over to you.

Sounds like it might be a style sheet issue? I do know about the view page source code, and I also use firebug to target code. Sometimes it works out well, sometimes not so well.

Ah... I'm really hoping there is still a way to fix this so that the attributes are right up underneath of the 'Please Choose' text. :(

If you can't help me though, I'll completely understand. You've already gone well enough out of your way to get me this far. :smile:

27 Jul 2009, 5:04 PM
#11
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #11 by kismetdesign

Here's that screenshot I should have attached above.

27 Jul 2009, 7:36 PM
#12
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #12 by niccol

Yes missed some of the floats. OOOOOPS.

First one is:

.wrapperAttribsOptions { display:block;
        float: left;
		margin: 5px 0em;
		padding:5px 0 5px 0;
		width:100%;
        }

Take the float:left out to leave:

.wrapperAttribsOptions { display:block;
		margin: 5px 0em;
		padding:5px 0 5px 0;
		width:100%;
        }

Then you are going to see that you are in a bit of a mess! But no worries add this rule to the bottom of the stylesheet:

#productDescription{clear:both:}

Screenshot attached:smile: I think I might know what you are going to ask next ! :D

Nick
iszent.com

27 Jul 2009, 8:37 PM
#13
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #13 by kismetdesign

Isn't there some way to just magically make your screenshot into my code? ha ha ha :cool:

Well, I did the changes to my stylesheet.css and then uploaded it, and nothing happened. I'll try clearing my cache to see if that helps, but I'm not getting it to look any different than it did before. :(

27 Jul 2009, 8:40 PM
#14
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #14 by kismetdesign

I take that back, I just checked it in IE and in Firefox. In Firefox it works (sort of other than a couple other formatting issues). In IE it doesn't seem to work at all.

very very interesting!

27 Jul 2009, 8:58 PM
#15
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #15 by niccol

which ie.

I should have thought about that. IE is not great with floats sometimes - let me have a look.

Nick
iszent.com

27 Jul 2009, 9:07 PM
#16
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #16 by niccol

Sorry, I also made a typo.

It should read:

#productDescription{clear:both;}

Nick
iszent.com

27 Jul 2009, 9:14 PM
#17
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #17 by niccol

OK try this in IE and firefox.

First change my typo to :

#productDescription{clear:both;}

Then change the other block of stylesheet to:

.wrapperAttribsOptions { display:block;
		margin: 5px 0em;
		padding:5px 0 5px 0;
        }

Tell me how you get on.

Nick
iszent.com

27 Jul 2009, 10:33 PM
#18
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #18 by kismetdesign

Interestingly enough, it works in IE with 7, but not with the earlier browser versions. I've got it up in 3 different browsers right now. Ideally, it would view nicely in most browsers. Have you run into this issue before?

28 Jul 2009, 7:42 AM
#19
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Post #19 by niccol

Well, microsoft did a lot of work on Internet Explorer 7 to try and get it to conform a bit better to the W3C guidelines, so, no, I am not surprised that we have a problem with IE6.

IE6 is a bit of a nightmare. Read http://www.positioniseverything.net/explorer.html for a few of the problems with IE explorer. Most web designers can't wait for the day that we can stop thinking about IE6 but at the moment it still has something like 15% market share approximately so we are not there yet. Hopefully, the release of IE8 will help kill it.

I'd try a couple of things:

  1. Define the widths of all floating elements. So, set a width for the div that contains the image.

#productMainImage{width:180px;)

  1. When I said change the name of certain things (in post 5 of this thread) to attrib-back I may have been wrong. Change all the attrib-back to something else for the time being. Maybe 'eagle'. I wonder if IE6 is picking up the word 'back' - its a long shot but worth doing.

I'll have a look at it again today. I was on my laptop yesterday so didn't have access to a proper version of IE6. Fault finding will be easier today.

Nick
iszent.com

28 Jul 2009, 6:03 PM
#20
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #20 by kismetdesign

It looks like I might need to come up with a different creative solution, like putting in the attributes/options differently or something. Hmmm... Or someone could just hand me a magic wand!

I did everything you said to do. I think it must be IE6's fault. I'm going to take the time now to read over the article you sent to me and then check back a little later.

Oh, and Good Morning to you! :smile:

-KismetDesign