ricardometring
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Change ‘Add to Cart’ button based on product tagHi there,
You can use the
woocommerce_product_add_to_cart_text
filter to edit the text for the Add to cart button, and use the WP functionhas_term
to check if a product has a specific tag. For example:add_filter( 'woocommerce_product_add_to_cart_text', 'change_add_to_cart_text', 10, 1 ); function change_add_to_cart_text( $default ) { global $product; // Check if product has tag "foo". if ( has_term( 'foo', 'product_tag', $product->id ) ) { $default = 'Add "foo" to cart'; } return $default; }
To customize this, you would edit
foo
with the tag name, andAdd "foo" to cart
with the button text.I hope this helps.
Best,
RicardoForum: Plugins
In reply to: [WooCommerce] Product Title Too Big on MobileHi there,
It looks like your theme provides a fixed size for the product title.
This can be fixed with some custom CSS. Under Customize > Additional CSS, you can add the following code:
?/* Change size of product title on mobile screens */ @media screen and (max-width: 767px) { .product_title { font-size: 2rem; } }
I based the maximum size of 767px on the other mobile changes on the page you provided.
?
If you’d like to learn more about CSS, I highly recommend using the free tutorials at w3schools. Here, you can find the basics of selectors (how to target the right element on the page), and properties (how to change the element on the page).Forum: Plugins
In reply to: [WooCommerce] “Add to cart” different versionsHi there,
Thanks for contacting WooCommerce support.
To clarify, what type of customization are you trying to accomplish?
It looks like you wanted the text to be the same as the default text. If you’re trying to customize the appearance of the buttons. I’d suggest using CSS.
If you’d like to change the button text, I’d suggest using a different filter. This way you can check the product type before displaying a different text:
add_filter( 'woocommerce_product_add_to_cart_text', 'change_add_to_cart_text', 10, 1 ); function change_add_to_cart_text( $default ) { global $product; $product_type = $product->get_type(); if ( 'simple' === $product_type ) { $default = 'Add to cart'; } else if ( 'variable' === $product_type ) { $default = 'Select options'; } return $default; }
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] PIX InstallmentsHi there,
I’ve shared this request with our dev team, but at the moment we can’t provide any deadlines or whether this will be even supported.
Additionally, there’s an open issue on GitHub to add support for PIX. You can subscribe to it and get notified of any updates:
https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2433
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] Status do pedido n?o atualiza via boletoOlá,
Obrigado por entrar em contato com o suporte do WooCommerce Stripe.
O problema é que quando o Stripe confirma o pagamento o status do pedido ainda permanece como “pagamento pendente”.
Isso n?o deveria acontecer. Eu suspeito que seu site ainda n?o esteja com webhooks configurados corretamente. Você pode confirmar se é isso?
Os webhooks do Stripe devem notificar seu site quando um pedido for aprovado, neste caso o boleto pode demorar até 72h úteis para aprovar, e ent?o seu site deve receber uma notifica??o automática e alterar o status do pedido.
Siga as instru??es neste link para saber como configurar os webhooks: https://woocommerce.com/document/stripe/#webhooks
Espero ter ajudado!
Forum: Themes and Templates
In reply to: [Storefront] Search for products and pages in one search boxHi there,
In order to do that, you’ll need to change the product search widget from WooCommerce. Storefront uses that widget through the
get_product_search_form()
function. The HTML can be changed by using a filter. Like so:add_filter( 'get_product_search_form', 'get_custom_product_search_form', 10, 1 ); /* * Overrides WooCommerce default product search form. * * @param string $form Form default HTML markup. * * @return string */ function get_custom_product_search_form( $form ) { $form = str_replace( '<input type="hidden" name="post_type" value="product" />', '', $form ); return $form; }
Basically, this filter will remove the
post_type
input, resulting in a general search on the website.Note: Searching for other types of posts, not only products, will change the search results appearance in Storefront.
I hope this helps.
Best,
RicardoHi there,
It looks like what you’re trying to accomplish may require some theme customization. Unfortunately, we’re not able to offer support for theme customization, but we can point you in the right direction.
I’d recommend contacting one of the services on our Customizations page: https://woocommerce.com/customizations/.
That being said, there might be an alternative way of accomplishing this by creating your own custom pages and adding products based on category using the “Products by Category” block.
You can learn more about WooCommerce Blocks here: https://woocommerce.com/document/woocommerce-blocks/
Alternatively, you can use the
products
WooCommerce shortcode, and display products by category, then you can link these custom pages on your Navigation menu so that customers would be able to locate them easily.I hope this helps.
Best,
RicardoForum: Plugins
In reply to: [WooCommerce] HOW do we RENAME the “RELATED PRODUCTS” title?Hi there,
To change a translatable string, you may either use a plugin such as Translate Words to change the string directly, or use a filter:
add_filter( 'gettext', 'translate_woocommerce_strings', 10, 3 ); function translate_woocommerce_strings( $translated, $untranslated, $domain ) { if ( ! is_admin() && 'woocommerce' === $domain && 'Related products' === $translated ) { $translated = 'You may also like...'; } return $translated; }
You may add this filter with a plugin such as Code Snippets.
Forum: Plugins
In reply to: [WooCommerce] How to change the default ROLE of WoocommerceHi there,
You may use the following filter to create WooCommerce users with a “Subscriber” role.
This code can be added yo your website using a plugin such as Code snippets.
add_filter( 'woocommerce_new_customer_data', 'woocommerce_new_customer_data_set_role' ); /** * Function for woocommerce_new_customer_data filter hook. * * @param array $customer_data An array of customer data. * * @return array */ function woocommerce_new_customer_data_set_role( $customer_data ){ $customer_data['role'] = 'subscriber'; return $customer_data; }
Note: Roles are used to determine what type of access a user should have across the website. Changing a user role may impact their experience with WooCommerce and/or third-party plugins. Test this on a staging site before applying the code to a production environment.
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] wc-stripe-blocks-integration problemHi there,
It looks like you’re using the latest version of WooCommerce and the Stripe Payment Gateway.
Can you confirm if the error started recently, or before you updated WooCommerce or Stripe to the latest versions?
If the problem happened before update, I recommend clearing the site cache and testing again.
This could also be a conflict with another plugin. I recommend going through the following troubleshooting:
https://docs.woocommerce.com/document/how-to-test-for-conflicts/
If you still need help with this, please share any fatal errors found under WP Admin → WooCommerce → Status → Logs – copy and paste in your reply.
Best,
RicardoThis should be fixed in WooCommerce Payments 4.3.0 in our next release on June 15th.
Forum: Plugins
In reply to: [WooPayments: Integrated WooCommerce Payments] Unable to style field labelsHi @jrvanstone,
Are you referring to a style change from the previous checkout experience to the new checkout experience?
I see that you’re using the new WooCommerce Payments checkout experience (early access).
Here’s how to disable it: https://woocommerce.com/document/payments/additional-payment-methods/#how-to-revert-to-the-old-experience
Let us know if that fixes it.
@stagezero we’re sorry about the trouble! We’ve spotted the issue a few hours after the release and have deployed a fix.
Please update the plugin.
Best,
RicardoForum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] Static icons not showing on 5.6.2Thanks for the feedback and apologies for the inconvenient change.
This change was mainly introduced because of the (early access) new checkout experience, which can offer multiple Stripe payment methods under the same payment gateway option on the checkout page.
Other than the inconsistency with that, we also had another issue where the icons would appear misaligned in different templates, because of the amount of icons, hence the first change where we introduced the rotating credit card brands, which were consistent with the new checkout experience.
We’re taking your feedback into consideration for the next releases.
For now, I would recommend @jkohlbach’s alternative to bring the icons back. Here’s a snippet for all the credit card brands:
function add_credit_card_gateway_icons( $icon_string, $gateway_id ) { if ( 'stripe' === $gateway_id ) { $icon_string = '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/visa.svg" class="stripe-visa-icon stripe-icon" alt="Visa" />'; $icon_string .= '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/mastercard.svg" class="stripe-mastercard-icon stripe-icon" alt="Mastercard" />'; $icon_string .= '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/amex.svg" class="stripe-amex-icon stripe-icon" alt="American Express" />'; $icon_string .= '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/discover.svg" class="stripe-discover-icon stripe-icon" alt="Discover" />'; $icon_string .= '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/diners.svg" class="stripe-diners-icon stripe-icon" alt="Diners" />'; $icon_string .= '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/jcb.svg" class="stripe-jcb-icon stripe-icon" alt="JCB" />'; } return $icon_string; } add_filter( 'woocommerce_gateway_icon', 'add_credit_card_gateway_icons', 10, 2 );
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] bug when card id/source id is empty@derher, the issue was re-introduced in 5.6.0, but was recently fixed in 5.6.2. Can you please confirm which version you’re using?
Best