Page 1 of 1

Help!! Cant rename button.

Posted: Thu Feb 16, 2012 4:22 pm
by Xciso
Hi.
I will rename my cart button on product page.
If i do like this i think it should work but it dosnt work.

Code: Select all

<modification>

	<id>Add to Cart Button On Product Page for OpenCart 1.5.1.3</id>
	<version>1.0.0</version>
	<vqmver>2</vqmver>
	<author>xciso - xciso@sverige.nu</author>

	<file name="catalog/view/theme/gentle/template/product/product.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a>]]>
            </search>
            <add>
            	<![CDATA[<a id="button-cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a>]]>
            </add>
        </operation>        
	</file>
	
	<file name="catalog/language/swedish/swedish.php">
        <operation>
            <search position="before">
            	<![CDATA[$_['button_cart'] = 'Buy';]]>
            </search>
            <add>
            	<![CDATA[$_['button_add_to_cart'] = 'Buy Now!';]]>
            </add>
        </operation>        
	</file>
		
</modification>
And the page write out "Buy" But it should be "Buy Now!"
WHY? Thanks..

Re: Help!! Cant rename button.

Posted: Thu Feb 16, 2012 5:51 pm
by uksitebuilder
Would it not be easier to simply rename the language definition for 'Buy' to 'Buy Now' ?

Your code should work but you also need to pull your new language into the controllers for all the different pages

check your vqcache is creating the cache files affected by the above.

Re: Help!! Cant rename button.

Posted: Thu Feb 16, 2012 6:47 pm
by Xciso
I want to have another text on cart-button on product side.
Thats why i cant fix it with just rename.

Where in the controller section do i have to edit this?
Thanks!

Re: Help!! Cant rename button.

Posted: Thu Feb 16, 2012 6:54 pm
by uksitebuilder
If only on the product page

catalog/controller/product/product.php

find
$this->data['button_cart'] = $this->language->get('button_cart');

add after or replace with
$this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');

Re: Help!! Cant rename button.

Posted: Thu Feb 16, 2012 7:18 pm
by Xciso
It works!
Thanks uksitebuilder for the tip.

If anyone need this VQMOD just send a pm.