Zen Cart Logo
Forums / All Other Contributions/Addons / Shoppingcart/Freeship in Header support

Shoppingcart/Freeship in Header support

Views: 19,391

Results 101 to 120 of 181
12 Apr 2011, 20:40
#101
richard_tung avatar

richard_tung

New Zenner

Join Date:
May 2009
Location:
Toronto, Canada
Posts:
70
Plugin Contributions:
0

Shoppingcart/Freeship in Header support

Hi

I totally forgot about reading about that...
I've fixed that up and I've added text-align: center in my #cartHeader so all will be center... Just a few dress ups here and there but now I need to ad a link in between shipping qualify and the checkout button for a 'Some restrictions apply' link...

And then done... my boss likes it which is a :bigups:...

Thanks again for your help!!!!

12 Apr 2011, 20:54
#102
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

Looking good! Since you have subtle rounded corners on many of your freestanding boxes, you might want to do the same for this. In all modern browsers (not including IE8 and older) these declarations added to #cartHeader {} will do it:```
-moz-border-radius: .7em;
-webkit-border-radius: .7em;
border-radius: .7em;

12 Apr 2011, 21:20
#103
richard_tung avatar

richard_tung

New Zenner

Join Date:
May 2009
Location:
Toronto, Canada
Posts:
70
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

Hey... you are amazing.... thanks I just added that in...:clap:
I really need to figure out how to add that url ref. in tpl_cart_header.php for the 'Some restrictions apply' link.
I can't figure out to add a url in php.... :frusty:

Any ideas???

12 Apr 2011, 21:29
#104
richard_tung avatar

richard_tung

New Zenner

Join Date:
May 2009
Location:
Toronto, Canada
Posts:
70
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

or do I have to call it from another file that has the URL?

13 Apr 2011, 01:03
#105
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

What kind of page is your text on? If it is a define page or one that has its own pagename, you can use

<a href="/index.php?main_page=whatever" >Some restrictions apply</a>

If it is an ez-page, use

<a href="<?php echo zen_ez_pages_link(23) ?>" >Some restrictions apply</a>

where 23 is replaced by your ez-page id.

13 Apr 2011, 13:20
#106
richard_tung avatar

richard_tung

New Zenner

Join Date:
May 2009
Location:
Toronto, Canada
Posts:
70
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

Beauty... thanks
I was stumped with echo command and couldn't figure it out until this morning... I guess a fresh clear mind is all you need...
I got it working now and its complete...

For anyone that wants to see it in action here's the link:

http://store.printersparts.com/store/

Thanks again! :yes:

25 Apr 2011, 21:28
#107
kamelion0927 avatar

kamelion0927

Zen Follower

Join Date:
Dec 2009
Posts:
208
Plugin Contributions:
1

Re: Shoppingcart/Freeship in Header support

I'm trying to figure out how to hide the header cart on the shopping cart and checkout pages and after hours of combing the forums, haven't been able to come up with an answer. (I found a couple of similar questions, but they just said they "fixed it". Grrr!)

So far, I've tried adding

<?php    
  if ($this_is_shopping_cart) {
 echo TEXT_CART;
 }
 else{
require($template->get_template_dir('tpl_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_cart_header.php'); 
}
?>

in tpl_header.php and then defining TEXT_CART without text (a sad attempt at a workaround, I know) but the cart still displays on the shopping cart page.

I would REALLY appreciate any assistance that you can lend.

I'm using Zen Cart v. 1.3.9f
Site Link: theburningbutterfly.com/shop
Mods installed: pretty much every mod known to Zen Cart and then some

Thanks in advance!
Crystal

26 Apr 2011, 02:33
#108
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

The home page is the only one that has a $this_is_ variable tracking it. All other pages need to use something like

if($current_page_base != 'shoppingcart'){
  require($template->get_template_dir('tpl_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_cart_header.php'); 
} 
```"if $current_page_base is not equal to 'shoppingcart'... "
26 Apr 2011, 02:37
#109
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

For the whole set of pages, something like```php
if(!in_array($current_page_base, explode(',', 'shoppingcart,checkout_shipping,checkout_whatever,checkout_success'){
require($template->get_template_dir('tpl_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_cart_header.php');
}

26 Apr 2011, 03:58
#110
kamelion0927 avatar

kamelion0927

Zen Follower

Join Date:
Dec 2009
Posts:
208
Plugin Contributions:
1

Re: Shoppingcart/Freeship in Header support

Woot! Woot! Thanks so much! I would have never thought to use that statement.

After playing around with it a little, the statement that I used to make the Shopping Cart in the header not appear on the shopping cart and check out pages is:

<?php
  if (!in_array($current_page_base,explode(",",'shopping_cart,checkout,checkout_confirmation,fec_confirmation')) ) 
	require ($template->get_template_dir('tpl_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_cart_header.php');?>

I just put it in my tpl_header.php file where the original shopping cart code was.

Thanks again - you rock!

13 Jun 2011, 14:45
#111
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

rxalex - post your specific needs here and I will advise you.

13 Jun 2011, 15:38
#112
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

How do I re-align the box to be smaller vertically?

03 Jul 2011, 17:24
#113
xariessa avatar

xariessa

New Zenner

Join Date:
Jul 2009
Location:
California
Posts:
18
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

I looked all over in this thread and can't seem to find an answer for what I think is a very simple question. I want to change the default graphic that shows up in the header to "checkout" when an item is added to the cart. I thought I maybe needed to just change the "CHCKOUT" part of BUTTON_IMAGE_CHECKOUT in tpl_cart_header.php on this line to whatever image it is I want it to hit. But that does not work. How do I select a checkout logo that is just for my header cart??

<?php
if ($cart_count) { 
  echo '<div id="cartCheckout"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT) . '</a></div>';
}  ?>

Also, I would like to get rid of the "totals" in the cart completely. Again, I haven't found out how to do that. Any help?

06 Jul 2011, 00:54
#114
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

zen_image_button(BUTTON_IMAGE_CHECKOUT)

This uses the filename defined for BUTTON_IMAGE_CHECKOUT; to use another file without changing the regular button elsewhere, you would need to use a different constant name and define that constant to be the desired filename. Something like

zen_image_button(BUTTON_IMAGE_CART_HEADER_CHECKOUT)

and put a define in a language file like

define('BUTTON_IMAGE_CART_HEADER_CHECKOUT', 'yourbuttonimage.gif');

Pattern the define after the define for BUTTON_IMAGE_CHECKOUT.

31 Jul 2011, 14:41
#115
xariessa avatar

xariessa

New Zenner

Join Date:
Jul 2009
Location:
California
Posts:
18
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

Excellent - I was able to fix that! Thank you so much! :smile:

09 Sep 2011, 20:30
#116
helpme avatar

helpme

Totally Zenned

Join Date:
Apr 2007
Posts:
632
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

I made some adjustments to my site text and it threw my header off. Now my image for my cart is cut off on the right side. When something is in the cart it shows completely. Any suggestions? squishytushy.com
thanks!

10 Sep 2011, 01:59
#117
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

Odd... I can only get the cut-off border/image on the product info page.
You appear to have slightly different rules for product info and for other pages.
product info:
min?f=...2619730 (line 113)

#cartHeader {
background: url("/includes/templates/future_zen/images/cartheader.jpg") no-repeat scroll 0 0 transparent;
padding: 0 2em 1em 0;
position: absolute;
right: 2.9em;
top: 1em;

}

other pages:
min?f=...2619730 (line 113)

#cartHeader {
background: url("/includes/templates/future_zen/images/cartheader.jpg") no-repeat scroll 0 0 transparent;
padding: 0 2em 1em 0;
position: absolute;
right: 0;
top: 0.1em;

}
I don't yet know why or how this would be happening - that may take some digging, and minimized stylesheets are a real pain to sift through.

10 Sep 2011, 02:17
#118
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

I really can't see any reason for this to happen. In both cases, the same stylesheets are being used, and the location and surroundings of that rule look the same. It just has different position spacings for the two cases. Since I can't find anything else, I will guess that the css/js loader that minifies the files masks whatever is causing the difference, or maybe causes the difference itself.

02 Nov 2011, 14:59
#119
sudakoma avatar

sudakoma

New Zenner

Join Date:
Jul 2006
Posts:
83
Plugin Contributions:
0

Re: Shoppingcart/Freeship in Header support

Hi Glenn,

Great mod, thanks!

We only offer free shipping in the UK; can this module be changed so that the amount needed to qualify will only show in the box for UK customers and be hidden for those that don't get free shipping?

03 Nov 2011, 04:12
#120
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Shoppingcart/Freeship in Header support

Yes, with some new custom coding. You would need some code to detect where the customer is located; then you could switch the free shipping section on or off accordingly. User locale detection is not something I have worked with, so you would need someone to advise on how best to do that. If the user is logged in, it becomes easy to check if the address is in the UK.