Post by Xciso » Thu Feb 16, 2012 4:22 pm

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

Active Member

Posts

Joined
Fri Jul 15, 2011 5:20 am

Post by uksitebuilder » Thu Feb 16, 2012 5:51 pm

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.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Xciso » Thu Feb 16, 2012 6:47 pm

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!

Active Member

Posts

Joined
Fri Jul 15, 2011 5:20 am

Post by uksitebuilder » Thu Feb 16, 2012 6:54 pm

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');

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Xciso » Thu Feb 16, 2012 7:18 pm

It works!
Thanks uksitebuilder for the tip.

If anyone need this VQMOD just send a pm.

Active Member

Posts

Joined
Fri Jul 15, 2011 5:20 am
Who is online

Users browsing this forum: Semrush [Bot] and 6 guests