WooCommerce Blocks – Cart button text
-
Hello,
I am trying to change the “proceed to checkout” text in the WooCommerce blocs – Cart page. The page editor does not seem to allow that. Any hints on how I can change this text? any hooks or filters that can help? This text must be located somewhere I guess.Sam
-
I have the same problem. Any one?
Hi there @skhalaf09 and @dvoy!
What you described requires some custom CSS code or a PHP code snippet indeed. Both are outside of the scope of our support.
To help you out, I found this article describing the CSS approaches that hopefully, you can apply:
– https://css-tricks.com/swapping-out-text-five-different-ways/
Just in case, you can read through this short guide to get more comfortable with CSS code and be able to make changes even yourself: https://cssworkshop.wordpress.com/
Lastly, here are some helpful posts that will help you customize your site with CSS:
– https://dailypost.wordpress.com/2013/07/25/css-selectors/
– https://dailypost.wordpress.com/2013/06/21/css-intro/
– https://dailypost.wordpress.com/2013/08/29/css-matched-rule-pane/
– https://en.support.wordpress.com/custom-design/how-to-find-your-themes-css/Finally, it would be great to have you add your ideas to the Ideas Board, which is where developers go to look for future plugin features and improvements.
I hope that’s helpful and points you in the right direction.
Thanks @zdenys
To be honest, I am surprised by the tight limitations to customize or change anything in WC Blocks. It is a really cool enhancement but the fact that you can almost change nothing is absurd to me.
Now, CSS is possible but comes with a cost. We were hoping for a way to tweak that through php (as we do for 99% of the WC/wordpress functionality). Are there any hints on where to start, where to find this text, hooks or filters..etc? you do not need to provide the exact code snippet.. just pointers would be greatly appreciated.Thanks
SamAnd actually, I don’t think CSS alone works anyway. The link you provided are more of examples to handle changing a button when a certain event occurs( ex. Rename button when button is clicked). This is completely different.
Also, if you think of this from a translation perspective, isn’t this text supposed to be translatable by translation plugins? Then where is this text coming from?Thanks,
SamThis works for me but not in IE browser
span.wc-block-components-button__text {
visibility: hidden;
}span.wc-block-components-button__text::before {
content: “Proceed to Registration”;
}span.wc-block-components-button__text::before {
visibility: visible;
position: absolute;
top:16px;
bottom:0;
margin:auto;
margin-left:-10px;
color:#FFF;
}Thanks @dvoy
That’s the cost I was referring to when it comes to handling things like this with CSS. it is not the most ideal way, might affect performance, and most importantly, might raise browser compatibility issues. I have seen others having the same issue with IE. Not to mention that IE sucks anyway.I am still hoping someone can provide some PHP hints.
Sam
Even Loco Translate does not seem to find this text! Not sure why this is made so uncustomizable!
Yeah, true! Tight limitations to customize or change anything in WooCommerce Blocks.
I also tried Loco Translate plugin but its not working. I guess I have to stop using WC Blocks for now.Translating WooCommerce Blocks can be a little difficult at the time being indeed. You can view some more info in a previous forum post: https://www.ads-software.com/support/topic/how-to-translate-woocommerce-blocks/
Keep in mind that this is still in the very early stages, so expect to see these issues worked out in the future.
Joey,
I understand all you said, but still, it makes no sense to make this whole plugin a black box on an open source platform. People use wordpress, Woocommerce and their plugins because it is open source and can be customized easily. I assume WC Blocks have followed the same code standards and methods as WP/WC (i.e. hooks, filters..etc.) so there must be some way for users to make changes while you work on enhancing the overall functionality.I still do not understand how a plugin in 2021 does not allow for a simple change like changing a label from X to Y.. we are not talking about changing logic or functionality.. just labels and such! We are so disappointed as we are about to go live with our site, and had this cart page created a while ago and got used to it, and now that we want to only change the label of one button we are being told we either live with it or replace the whole plugin at this late stage!
Also, any hints on where to find the plugin folder in WP ? I go to wp-content >> plugins but I can’t find wc blocks.. it this also a secret that you guys can’t share with users?
@skhalaf09 I think I may know where the confusion stems from. WooCommerce Blocks is a feature plugin that is published on www.ads-software.com for exposing both in progress work on new blocks plus improvements to existing blocks that already exist in WooCommerce core.
It appears to me that you are only only getting use of the blocks that are included in WooCommerce core releases (which is why you don’t see this plugin in your
wp-contents/plugins
folder).It’s unclear to me though as I read through this issue how you are seeing the Cart block (if that’s what the requests pertain to) since the Cart and Checkout blocks aren’t supposed to be available without the feature plugin installed. Would you be able to share a screenshot of what exactly you are trying to modify? There may be some additional confusion that hopefully we can sort out here.
Hi Darren,
So I do have the WC blocks plugin installed (sorry it does not seem I can attach screenshots here, so I copied/pasted what I see in installed plugins):
WooCommerce Blocks
Deactivate
WooCommerce blocks for the Gutenberg editor.
Version 4.2.0 | By Automattic | View detailsThen I created a cart page and used the Cart block.
I am asking for were the plugin actually is installed so I can give it a try and see if I can find the code responsible for rendering the “proceed to checkout” button and adjust that, makes sense ?The plugin is installed in the same place all WordPress plugins are installed (
wp-content/plugins
). You can also find the source code on our public GitHub repository.Currently the text you are referring to cannot be changed easily via any filters in PHP because it is rendered via JavaScript (the forum post linked to earlier has some info on that). I understand your frustration regarding that but please understand the Cart and Checkout blocks are still in preview (which is why they are released in this feature plugin) and our team is continually working on them to improve them and provide customization options as well as extensibility for extension developers. We are gathering feedback from folks such as yourself to get insight into what are the most in demand features to help us prioritize our efforts.
Thanks Darren.
So underwp-content/plugins
, what folder name should I look at? because I don’t seem to find it.
If we update the js files themselves, wouldn’t that “temporarily” fix this issue until this is fixed/handled in next releases ?
- The topic ‘WooCommerce Blocks – Cart button text’ is closed to new replies.