Tagged: x
-
AuthorPosts
-
June 26, 2016 at 5:43 pm #1060470
Hi, First of all awesome theme, I absolutely love it!
I’m trying to change the ‘Add to cart’ button text when the product is added through essential grid, they use link to add it to the cart, like this: http://web.timanity.se/funktioner/?add-to-cart=526
I used a code to change but it doesn’t work, here’s the code:
add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text'); function woo_custom_cart_button_text() { foreach( WC()->cart->get_cart() as $cart_item_key => $values ) { $_product = $values['data']; if( get_the_ID() == $_product->id ) { return __('Redan Tillagd', 'woocommerce'); } } return __('Add to cart', 'woocommerce'); }
Thank you in advance!
best regards,
TimmyJune 26, 2016 at 9:25 pm #1060737Hello Timmy,
Thanks for writing in! The code will only work in changing the button text upon loading the page. The add to cart button text change that you wanted will require JS event triggers upon clicking on add to cart button. As this is all custom development, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.
Thank you for your understanding.
June 27, 2016 at 1:07 am #1060932No problem, I’ll figure it out 🙂
Thank you!
June 27, 2016 at 1:17 am #1060948You’re welcome.
If you need anything else we can help you with, don’t hesitate to open another thread. -
AuthorPosts