Re: Shoppingcart/Freeship in Header support
Hi Glenn,
I had previously asked you about this in post 2:
Very cool mod! Great, absolutely great readme file with clear and precise instructions and info - and here is the bonus, its not a text file!
The only thing that I would like to customize about it is, I would like to format it into 2 columns. The first column being the # of items on the first row and the second row, the Total Price. On the second column on the first row is where I want to place the View Cart button.
Can I do that via css? How? I'm a bit of a novice when it comes to css, so if someone can provide some example code, awesome!
-----------------------------------------------------------------
I took the code from post 4 and placed it in the file as you instruct. I changed the image name to that of mine. Now, however, it breaks the site, nothing under the header area, just white space!
Can you take a look at my code and see if you can spot my error:
PHP Code:
<div id="cartCount">
<?php
$cart_count = $_SESSION['cart']->count_contents();
echo ($cart_count? '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '" title="' . CART_HEADER_TITLE . '">':'') . CART_HEADER_IN_CART_PRE . $cart_count . (($cart_count == 1)? CART_HEADER_IN_CART_SINGULAR: CART_HEADER_IN_CART_PLURAL) . ($cart_count? '</a>': '');
?>
</div>
<?php if ($cart_count) {
$_SESSION['cart']->get_products();
$basket_total = $_SESSION['cart']->show_total();
echo '<div id="cartTotal">' . CART_HEADER_TOTAL . $currencies->format($basket_total) . '</div>' ;
} ?>
<?php echo '<a id="cartButton" href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '" title="' . CART_HEADER_TITLE . '"><img src="button_checkout.png" /></a>'); ?>
Re: Shoppingcart/Freeship in Header support
Hi Glenn,
Last post is solved, just had to put php tags in the right place.
I have since continued to customize it a bit and am trying to place my 'Go to Checkout' button at the top of the 2nd column and then to place a 'Checkout' button directly below that.
I thought I had the right code for the 'Checkout' button, but it is not appearing :(
Here is the code, the last line is the line I added for the new 'Checkout' button:
PHP Code:
<div id="cartCount">
<?php
$cart_count = $_SESSION['cart']->count_contents();
echo ($cart_count? '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '" title="' . CART_HEADER_TITLE . '">':'') . CART_HEADER_IN_CART_PRE . $cart_count . (($cart_count == 1)? CART_HEADER_IN_CART_SINGULAR: CART_HEADER_IN_CART_PLURAL) . ($cart_count? '</a>': '');
?>
</div>
<?php if ($cart_count) {
$_SESSION['cart']->get_products();
$basket_total = $_SESSION['cart']->show_total();
echo '<div id="cartTotal">' . CART_HEADER_TOTAL . $currencies->format($basket_total) . '</div>' ;
} ?>
<?php echo '<a id="cartButton" href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '" title="' . CART_HEADER_TITLE . '"><img src="button_checkout.gif" /></a>'; ?><!--view cart button-->
<?php echo '<a id="cartButton" href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" title="' . HEADER_TITLE_CHECKOUT . '"><img src="button_buy_now.gif" /></a>'; ?><!--checkout button-->
NOTE: I will be renaming them 'View Cart' and 'Checkout'
Re: Shoppingcart/Freeship in Header support
Hi Glenn,
Please disregard posts 21 and 22, I was able to fix it.
The one thing that has me stumped however, is how to have the buttons align evenly in the 2nd column (aligned at the top). And one last thing, currently the 2 buttons are on separate lines by use of 2 <br /> tags. Do you know how I could separate them by using css instead of <br /> tags?
This is a great mod - I hope its included in ZC 2.0!
Please feel free to PM me for a link to the site, its not officially open for business yet so its down to the public.
Re: Shoppingcart/Freeship in Header support
Would there be a way to always have 'Sub-Total' display with '$0.00' if there is nothing in the cart? For example, when a customer first appears on the site for the first time OR its been more than 30 days since they lasted visited the site.
Re: Shoppingcart/Freeship in Header support
To remove the condition on showing the total, just comment out the two lines shown:
PHP Code:
<?php if ($cart_count) {
$_SESSION['cart']->get_products();
$basket_total = $_SESSION['cart']->show_total();
echo '<div id="cartTotal">' . CART_HEADER_TOTAL . $currencies->format($basket_total) . '</div>' ;
} ?>
PHP Code:
<?php //if ($cart_count) {
$_SESSION['cart']->get_products();
$basket_total = $_SESSION['cart']->show_total();
echo '<div id="cartTotal">' . CART_HEADER_TOTAL . $currencies->format($basket_total) . '</div>' ;
//} ?>
If you want to send a link, I'll look at your styling to align the buttons.
You shouldn't have two <a id="cartButton" elements; they need different ids, both for valid code and to be able to style them separately.
Re: Shoppingcart/Freeship in Header support
Good stuff.
I tried to put 2 ids but with no success :(
Please PM when you have a few minutes to look at the styling. I have my site 'down for maintenance' as its not officially open yet.
Re: Shoppingcart/Freeship in Header support
For the 2 buttons, I tried using #viewCart and #checkout as ids but couldn't seem to make it work. Any ideas?
Re: Shoppingcart/Freeship in Header support
Ok, making some progress here. Was able to separate the ids for the 2 buttons, now #viewCart and #checkout work - just need the styling help!
Remember, just PM when you have a few minutes. Oops looking at the clock, I have to step away for a few hours. Should be back around 8pm (Im on the east coast as well) or so. If not, I'll look for you tomorrow. Thanks.
Re: Shoppingcart/Freeship in Header support
Thanks for a great module!! I did find a typo in the CSS that I spent lots of time pulling my hair out over and thought I would bring it up here to maybe save others some time!
on line #749 has a ) instead of a } to close the line.
Wrong:
Corrected:
Thanks again!!
-Christopher
Re: Shoppingcart/Freeship in Header support
Thanks for mentioning that - I'll get it into the original file so it is fixed when I next update the mod.