[SOLVED] Hoe WooCommerce knop tekst te veranderen

Andrei Iordache

Andrei Iordache

WordPress Ontwikkelaar

🚀 Ik help mensen online gevonden te worden. WordPress Ontwikkeling, Web Vitals, Beveiliging en Onderhoud.

Hoe verander je “Toevoegen aan winkelwagen” naar “Nu kopen” WooCommerce knop tekst

 

Hallo! Vandaag zal ik je leren hoe je de WooCommerce “Toevoegen aan winkelwagen” knop tekst kunt veranderen in “Nu kopen” of wat je maar wilt. Hiervoor hebt u ten minste twee mogelijkheden:

MAAK EERST EEN VOLLEDIGE BACKUP VAN UW SITE. NU!

OK, ervan uitgaande dat je een volledige backup van je site hebt gemaakt, om de “Toevoegen aan winkelwagentje” knop tekst te veranderen in “Nu kopen / Bestellen / Mij inhuren / enzovoort”, moet je de volgende PHP code toevoegen aan je thema:

// Change the Add To Cart Button Text on the Product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' ); 
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' ); 
}

// Change the Add To Cart Button Text on the Product Archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' ); 
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}

Optie 1: Het veranderen van de WooCommerce knop tekst van het hoofdthema:

WP-Dashboard -> Verschijning -> Hoofdthema (de actieve) -> Thema editor -> (zoek het functions.php bestand) -> Voeg de PHP code van hierboven toe aan de onderkant van de functions.php pagina -> Sla het bestand op.

Als de verandering niet lijkt te verschijnen, probeer dan uw browser cache op te schonen.


Optie 2: Het veranderen van de WooCommerce Toevoegen aan winkelwagentje knop tekst van het Child Theme (veiligste methode):

Dit is de veiligste methode, want telkens als u het thema dat u gebruikt op uw WordPress site update, zullen de configuraties die u op uw site heeft toegepast nog steeds aanwezig zijn. Als u tweaks op het hoofdthema toepast, kunt u die tweaks verliezen zodra u het bijwerkt.

Ervan uitgaande dat je het Child Theme hebt geactiveerd, ga naar: WP-Dashboard -> Appearance -> Child Theme (het actieve) -> Theme editor -> Functions.php (in feite denk ik dat dit het enige bestand is dat je zou moeten zien op het child theme) -> Voeg de PHP code toe.


Kan de Child Theme Editor niet vinden in het Dashboard

Als u de functions.php niet kunt vinden vanuit het admin dashboard, kunt u het volgende proberen:

Ga naar cPanel -> File Manager -> Publieke HTML (of de map waar de bestanden van uw WordPress site zijn opgeslagen) -> WP Inhoud -> Thema’s -> Thema-map (het beste is om naar de Child_Theme_Folder te gaan) -> Je zou de
functions.php
daar. Open met een editor, plak de bovenstaande code en sla het op.

Dien uw gastpost in

Vorig bericht
Hoe LinkedIn Premium Account opzeggen in 5 eenvoudige stappen
Volgend bericht
[SOLVED] WooCommerce Mini Cart niet bijwerken
Lusi StudiosLusi Studios
15:32 22 Jun 22
Andrei did an amazing job! He helped in a very rushed time and he excelled at everything. Thanks again!
I am grateful and I would to thank Websites Seller for their support in site recovery and site transfer. Websites Seller just saved my business. Thank you!
Wouter GhysensWouter Ghysens
11:52 10 Sep 21
Looking for a Wordpress transfer from site A to site B, I found back Andrei from Wesites Seller on Google.He was very proactive in his approach, came with hundreds of ideas and lifetime experiences from other migrations. He knows the wordpress, the hosting and php database as the back of his pocket.And we worked out this migration very smooth. Together we solved it, and myself and my business are very pleased with his approach.100% recommendation & kudo's from out of Belgium!
Ioachim CiobanuIoachim Ciobanu
18:39 14 Jul 21
Websites Seller built my resume site. Deliverables were quickly completed, and I was asked for my feedback at each stage of development. All feedback I gave was implemented in a short time.Another great thing is that he comes with smart solutions, regarding stuff which I didn't initially think of (site security, Google site speed optimization and so on). Basically, he was great, staying in touch, keeping me updated and paid attention to what was most important for my site.Overall, I am very happy with the work done. I highly recommend this developer!
K CollinsK Collins
09:11 19 May 21
I needed help with website speed - to improve my core web vitals - without compromising the usability of my site. Andrei was extremely responsive, proactive and fast. And more importantly, he increased by website speed. Highly recommend him, and I will be using him going forward on all my projects.
js_loader

Dien uw gastpost in

Diensten

WordPress Website Maintenance Services

WordPress Onderhoudsdiensten

WordPress website onderhoudsdienst die cloud back-ups, noodhulp, wekelijkse website updates, snelheid en nog veel meer biedt.

sally

WordPress Migratie Service

Zet uw WordPress website veilig over naar een nieuwe locatie voor $75. … Migreer uw website naar de nieuwe host.

lawyer-office

Advocaat Web Design

Wij zijn gespecialiseerd in website ontwerp, internet marketing en SEO voor advocaten en juristen in heel Europa en de VS.