Page 1 of 1

1.4.8 Cart Module

Posted: Fri Jun 11, 2010 5:37 pm
by mystifier
Can anyone help me change the text links to buttons on the new Cart Module?

My $text_view and $text_checkout are set to 'Basket' and 'Checkout'

I changed ~/catalog/view/default/template/module/cart.tpl

From:
<div style="padding-top:5px;text-align:center;clear:both;"><a href="<?php echo $view; ?>">
<?php echo $text_view; ?></a> | <a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>

To:
<div style="text-align: center; margin-top: 10px; float:right">
<a href="<?php echo $view; ?>" class="button" style="text-decoration: none;"><span><?php echo $text_view; ?></span></a>
<a href="<?php echo $checkout; ?>" class="button" style="text-decoration: none;"><span><?php echo $text_checkout; ?></span></a>
</div>

Which looked encouraging but the box collapses when I use it (like most of my code ::) )

Re: 1.4.8 Cart Module

Posted: Fri Jun 11, 2010 8:08 pm
by Qphoria
You can't float right unless you add a clearing div below it

Re: 1.4.8 Cart Module

Posted: Fri Jun 11, 2010 8:26 pm
by mystifier
Brilliant.

I added <div class="clear"></div> after it and it works fine (but I won't pretend that I understand).

Re: 1.4.8 Cart Module

Posted: Fri Jun 11, 2010 8:56 pm
by mystifier
Okay, I give up...

It works except for the inital 'Add to Basket' so I altered ~catalog\controller\module\cart.php to:

output .= '<div style="padding-top:10px; text-align:center; clear:both; float: right">
<a href="<?php echo $view; ?>" class="button" style="text-decoration: none;"><span><?php echo $text_view; ?></span></a>
<a href="<?php echo $checkout; ?>" class="button" style="text-decoration: none;"><span><?php echo $text_checkout; ?></span></a>&nbsp;
</div><div class="clear"></div>';

..it is almost there except that the buttons are malformed with no link; when I refresh the page, everything is fine.

Grrrrr - I'm glad I'm not a real web-developer, it would drive me nuts!

Re: 1.4.8 Cart Module

Posted: Fri Jun 11, 2010 9:03 pm
by mystifier
Got it !!

$output .= '<div style="padding-top:10px;text-align:center; clear:both; float:right">
<a href="'. $view. '" class="button" style="text-decoration: none;"><span>'. $this->language->get('text_view') .'</span></a>
<a href="'. $checkout .'" class="button" style="text-decoration: none;"><span>' . $this->language->get('text_checkout') . '</span></a>&nbsp;
</div><div class="clear"></div>';

Two buttons... not bad for an hour's work. Should I contribute it as an Extension ;D

Re: 1.4.8 Cart Module

Posted: Fri Jun 11, 2010 10:08 pm
by Qphoria
I'm not even sure what you've done.. got a screen shot?

Re: 1.4.8 Cart Module

Posted: Sat Jun 12, 2010 4:31 am
by mystifier
I put it up as a simple amendment in Extensions.

Re: 1.4.8 Cart Module

Posted: Sat Jun 12, 2010 5:46 pm
by griya.celebes
please check in my site below:

www.ithinkipad.biz

after you click add to cart button on the product page, you'll see inthe sidebar of the site "TEXT_VIEW" and "CHECKOUT" button..

i want to asking, how i can change "TEXT_VIEW" button into Basket Button, like what the extension said.

http://www.opencart.com/index.php?route ... ion&page=6 <== this is what module i used. thanks.. need help.. :)

Re: 1.4.8 Cart Module

Posted: Sat Jun 12, 2010 8:15 pm
by timdan
mystifier, After change to your codes it works for the initial problem but when I click on view cart. I get this message "Sub-Total: Notice: Undefined variable: sub_total in C:\xampp\htdocs\opencart148\catalog\view\theme\mythem\template\checkout\cart.tpl on line 47"



griya.celebes, your cart should show view cart instead of text view. You go change to Basket Button in here.
catalog/language/english/module/cart.php. In cart.php you see $_['text_view'] = 'View Cart' change to this $_['text_view'] = 'Basket Button'. Good Luck

Re: 1.4.8 Cart Module

Posted: Sat Jun 12, 2010 8:45 pm
by mystifier
The text for the buttons is held in the standard file at:
catalog\language\english\module\cart.php

Sorry Timdan, I can't explain your problem. I don't have any problems with it... it will only work with v1.4.8 though; text_view didn't exist before then.

Re: 1.4.8 Cart Module

Posted: Sun Jun 13, 2010 7:58 pm
by mystifier
I have a bizarre problem with this when I upload it to a live webserver.

The delete box is missing and the buttons format is lost so that they no longer appear alongside one another.
When I refresh, the delete box appears and the buttons jump to a new (but still incorrect) position.

Basically:
- On localhost, looks perfect (all browsers including IE8)
- On live site, format problem in IE8 but fine in other browsers

If I capture HTML using 'View Source' from Localhost and Live Server, they are identical ?!?

If I restore the original v1.4.8 cart module, the delete button still disappears (live server only).

Any suggestions?