PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

[CONTRIBUTION] Better order-steps template

30 replies to this topic
#1
Eihwaz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 154 posts
See the image attached to see the difference between original and modified versions.
The markup and css used are based on Cody Lindley's "CSS Step Menu" article, but I did my share of tweakings too :)
So, yeah, the advantages are:
Cross-browser compatible (I'm kind of guessing here, so don't take my word for it)
Uses sprites (one sprite, in fact, so your customer's browser will send one request versus 5.
Degrades nicely if images are disabled.

Here's what you should do to make it work:
Find your order-steps.tpl file in your shop's theme folder and completely replace it's markup with this:
order-steps.tpl:

{* Assign a value to 'current_step' to display current style *}
<!-- Steps -->



  • {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address' || $current_step=='login'}

    {l s='Summary'}

    {else}
    {l s='Summary'}
    {/if}





  • {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address'}

    {l s='Login'}

    {else}
    {l s='Login'}
    {/if}





  • {if $current_step=='payment' || $current_step=='shipping'}

    {l s='Address'}

    {else}
    {l s='Address'}
    {/if}





  • {if $current_step=='payment'}

    {l s='Shipping'}

    {else}
    {l s='Shipping'}
    {/if}




  • {l s='Payment'}


<!-- /Steps -->

Open your global.css file, find

/* steps (like order step) */

AND

/* Special style for block cart */

Replace css code between those two lines with the following:

/* steps (like order step) */
ul.step {
list-style: none;
width: 100%;
background-color: #fff;
height: 70px;
padding: 10px 0;
}
ul.step li{
position: relative;
height: 70px;
width: 20%;
list-style: none;
float: left;
background-image: url(../img/stepsSpr.gif);
background-repeat: repeat-x;
background-position: left -280px;
background-color: #0E96CC;
vertical-align: middle;
}
ul.step li ins {
display: block;
position: absolute;
top: 0px;
right: 0px;
width: 26px;
height: 70px;
background-image: url(../img/stepsSpr.gif);
background-repeat: no-repeat;
background-position: right top;
}
ul.step li.step_current ins{
background-color: #CD3C0F;
background-position: right -70px;
}
ul.step li.step_last_done ins{
background-color: #CCC30E;
background-position: right -140px;
}
ul.step li.step_done ins{
background-color: #CCC30E;
background-position: right -210px;
}
ul.step li.step_current{
background-position: left -350px;
background-color: #CD3C0F;
}
ul.step li.step_last_done, ul.step li.step_done{
background-position: left -420px;
background-color: #CCC30E;
}
ul.step li span a {
color: #fff;
}
ul.step li span{
position: absolute;
width:120px;
display:block;
left:5px;
top: 30px;
font-weight:bold;
color: #fff;
}
/* Special style for block cart */

Finally, put the stepsSpr.gif that I've attached to this post in your theme's directory img folder.

Attached Files



#2
Guest__*
  • Guests
Thanks Eihwaz
That is really good. Have a good time

#3
Eihwaz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 154 posts
Tesekkuerler :) (I know two words in turkish: "merhaba" and "tesekkuerler")
Does it work fine?
Because everyone seems to be a bit quiet, so I'm not really sure if people can get it to work using my instructions.

#4
Bruno Lévêque

    PrestaShop Fanatic

  • PrestaTeam
  • 1085 posts
Great work!

Moreover the code seems to be well-designed with CSS spriting ;)

Congrats!
Bruno LévêquePrestashop Co-founder (Co-fondateur)PrestaShop

#5
minirj01

    PrestaShop Addict

  • Members
  • PipPipPip
  • 578 posts
Hi Eihwaz,
...well done, your tip works fine and cute !!
(But your instructions concerning global.css are not so clear ; )
Thanks for your good idea.
Version 1.2.5 Finale / Thème perso / OVH 90Plan / Presta-Fan

#6
Eihwaz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 154 posts
Thank you all for responces, I'll try to keep theese little things coming.
I've also updated the instructions, so there should be no problems making it work anymore. I'll also post PSD file for the sprite, as soon as I find reliable and free file-hosting.

#7
mokijo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts
Thanks Eihwaz. Nicely done, cheers for sharing!

#8
21846657

    PrestaShop Fanatic

  • Moderators
  • 1139 posts
Wow, very nice breadcrumb-like steps with css sprite. Cheers!

* 欢迎访问PrestaShop官方中文论坛

* 搜索是你的朋友。提问之前请善用搜索引擎和论坛搜索。

* 未获得帮助?——请详述问题,提供PrestaShop版本、运行环境(Web Server/PHP/MySQL)、浏览器类型等必要信息。

* 如果问题解决了,请为你的帖子标题加上[已解决]。谢谢。

#9
rubensicko

    PrestaShop Apprentice

  • Members
  • PipPip
  • 29 posts
Hi all! In the last step (payment) I have 2 colors, red and blue (the last step should be all red i think). Help!

Thank you.

#10
Degsey

    PrestaShop Apprentice

  • Members
  • PipPip
  • 213 posts
In the last step for payment it should be all yellow and a red segment at the end.

#11
Rogerio Lima

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
In my store, the image is like that i have attached, is not look good, can you help me?

Attached Files



#12
Degsey

    PrestaShop Apprentice

  • Members
  • PipPip
  • 213 posts
It looks to me that you have downloaded the image as a thumbnail thats why it is not showing properly, it should be 26x490. It appears that you may have downloaded the image shown in the thread and not clicked on it to a new window and right click and copy it.

#13
Rogerio Lima

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts

From 1266172988:

It looks to me that you have downloaded the image as a thumbnail thats why it is not showing properly, it should be 26x490. It appears that you may have downloaded the image shown in the thread and not clicked on it to a new window and right click and copy it.


Yes that's right, now everything is ok. Tank You,
Best regards.

#14
Hedrad

    PrestaShop Apprentice

  • Members
  • PipPip
  • 166 posts
Thanks for this contribution.
In french : "login" is traduct by "identifiez-vous". The weight is too long ; so, in "ul.step li span", I do this : "font-size: 9px;"

Sorry for my poor english...

#15
snco

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts
Hello Eihwaz,

I like your solution and want to use it in my shop. But I want to make some changes on the image file. Is it possible to send me the .PSD file by email? (kotara4ko@gmail.com)

Thank you in advance
Alex

#16
snco

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts
I dealed with it...
http://stepcare.eu/shop/my-account.php


Thank you for your contribution !

#17
blk1

    PrestaShop Apprentice

  • Members
  • PipPip
  • 50 posts
snco I see you have 'Purchase without an account' on your website - is this a module you downloaded?

#18
Eihwaz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 154 posts
2 snco:
Hi! Sorry, I don't even have the psd file for it, I just did it as an example, saved directly to gif.
But I see you did a cool sprite yourself, very nice! :)

#19
snco

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts
Hi Eihwaz,

I am glad you like it. As I said in my previous post your contribution is also very nice and convenient.
Thanx again for that!

#20
snco

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts
Hello blk1,

Actually I found this one step checkout on the forum. It is a modification to existing prestashop ordering process, which allows the user to purchase without registration. I am attaching the files. In order to use it, you must replace the files from the archive with those on your store.

Good luck!

Attached Files