Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Text indication of progress in shopping process - Question

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-18-2005, 12:58 PM
 
jb5ep jb5ep is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: U.K.
Posts: 65
 

Default Text indication of progress in shopping process - Question

I'm trying to implement a kind of 'poor man's ezCheckout'(!) in my XC install. This just consists of a text description of where you are in the shopping process (nowhere near as flexible or as thorough as Jon's mod, but i'm keen to learn a bit more about XC's inner workings..)

I've added the following to the top of my /customer/home_main.tpl (haven't created any new lang items yet, cos i'm lazy..)

Code:
{if $main eq "catalog"} <P class="mainheading">Shop (step 1 of 7)</P> {elseif $main eq "product"} <P class="mainheading">Shop (step 1 of 7)</P> {elseif $main eq "ezupsell"} <P class="mainheading">Recommendations (step 2 of 7)</P> {elseif $main eq "cart"} <P class="mainheading">Checkout (step 3 of 7)</P> {elseif $main eq "anonymous_checkout"} <P class="mainheading">Your details (step 4 of 7)</P> {elseif $main eq "checkout"} <P class="mainheading">Payment method (step 5 of 7)</P> {elseif $payment_data.payment_method ne ""} <P class="mainheading">Payment details (step 6 of 7)</P> {elseif $main eq "order_message"} <P class="mainheading">Your order is confirmed (step 7 of 7)</P> {/if}

And...(amazingly), - this all works fine, until you get to 'Step 6' (which is the 'enter payment details' page.) This page has the $main of 'checkout' which is effectively the same as my previous 'step'

QUESTION: What would my {elseif} statement need to look like in order for me to identify that the customer is on the 'Payment details' page (the one that calls /customer/main/payment_cc.tpl)

Hope that makes sense.....

Cheers,
JB
__________________
X-Cart 4.0.17
ezUpsell
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Linux
Reply With Quote
  #2  
Old 05-18-2005, 02:38 PM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

Try this (not tested):
Code:
{elseif $smarty.get.paymentid ne "" and $smarty.get.mode eq "checkout"}
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #3  
Old 05-19-2005, 10:37 AM
 
jb5ep jb5ep is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: U.K.
Posts: 65
 

Default

Zaja,

Many thanks - works a treat. All I had to do in addition was change the order of a couple of the statements. For any folk who are interested, here's the code i'm using to determine where the customer is in the selling process. Guess you could also use images rather than text:

Add this to the top of /customer/home_main.tpl :

Code:
{* JB - Hack to display progress - start *} {if $main eq "catalog"} <P class="mainheading">Shop (step 1 of 7)</P> {elseif $main eq "product"} <P class="mainheading">Shop (step 1 of 7)</P> {elseif $main eq "ezupsell"} <P class="mainheading">Recommendations (step 2 of 7)</P> {elseif $main eq "cart"} <P class="mainheading">Checkout (step 3 of 7)</P> {elseif $main eq "anonymous_checkout"} <P class="mainheading">Your details (step 4 of 7)</P> {elseif $smarty.get.paymentid ne "" and $smarty.get.mode eq "checkout"} <P class="mainheading">Payment details (step 6 of 7)</P> {elseif $main eq "checkout"} <P class="mainheading">Payment method (step 5 of 7)</P> {elseif $main eq "order_message"} <P class="mainheading">Your order is confirmed (step 7 of 7)</P> {/if} {* JB - Hack to display progress - end *}
Cheers,
__________________
X-Cart 4.0.17
ezUpsell
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Linux
Reply With Quote
  #4  
Old 07-06-2005, 01:12 PM
 
jb5ep jb5ep is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: U.K.
Posts: 65
 

Default

Quick update on this:

1. Create a tpl for each 'step' in the process

2. Create progress_bar.tpl (substituting the include with your correct path).

Code:
{if $main eq "catalog"}{include file="customer/main/progress_bar_step0.tpl"} {elseif $main eq "product"}{include file="customer/main/progress_bar_step1.tpl"} {elseif $main eq "ezupsell"}{include file="customer/main/progress_bar_step2.tpl"} {elseif $main eq "cart"}{include file="customer/main/progress_bar_step3.tpl"} {elseif $main eq "anonymous_checkout"}{include file="customer/main/progress_bar_step4.tpl"} {elseif $smarty.get.paymentid eq "" and $smarty.get.mode eq "checkout"}{include file="customer/main/progress_bar_step5.tpl"} {elseif $main eq "checkout"}{include file="customer/main/progress_bar_step6.tpl"} {elseif $main eq "order_message"}{include file="customer/main/progress_bar_step7.tpl"} {else} {/if}

3. Call progress_bar.tpl from your customer/home.tpl using something like this:

Code:
{if $main eq "catalog" and $current_category.category eq ""}<td></td> {else}{include file="customer/main/progress_bar.tpl"}{/if}

Cheers,
__________________
X-Cart 4.0.17
ezUpsell
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Linux
Reply With Quote
  #5  
Old 11-17-2005, 07:06 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Many, many, many thanks for this, this mod works perfectly!

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #6  
Old 11-17-2005, 02:50 PM
 
jb5ep jb5ep is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: U.K.
Posts: 65
 

Default

No problem! - glad to see other folk using it. I think 4.1.0 has a more integrated version of a progress bar, so that might be worth keeping an eye on, too.

Cheers,
__________________
X-Cart 4.0.17
ezUpsell
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:38 PM.

   

 
X-Cart forums © 2001-2020