Post by mystifier » Fri Jun 11, 2010 5:37 pm

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 ::) )

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by Qphoria » Fri Jun 11, 2010 8:08 pm

You can't float right unless you add a clearing div below it

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mystifier » Fri Jun 11, 2010 8:26 pm

Brilliant.

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

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by mystifier » Fri Jun 11, 2010 8:56 pm

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!

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by mystifier » Fri Jun 11, 2010 9:03 pm

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
Last edited by mystifier on Sat Jun 12, 2010 4:32 am, edited 1 time in total.

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by Qphoria » Fri Jun 11, 2010 10:08 pm

I'm not even sure what you've done.. got a screen shot?

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mystifier » Sat Jun 12, 2010 4:31 am

I put it up as a simple amendment in Extensions.

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by griya.celebes » Sat Jun 12, 2010 5:46 pm

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.. :)

Newbie

Posts

Joined
Sat May 22, 2010 11:23 am

Post by timdan » Sat Jun 12, 2010 8:15 pm

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

Newbie

Posts

Joined
Mon May 31, 2010 12:38 am

Post by mystifier » Sat Jun 12, 2010 8:45 pm

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.

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by mystifier » Sun Jun 13, 2010 7:58 pm

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?

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm
Who is online

Users browsing this forum: No registered users and 7 guests