Support » Plugin: YITH Event Tickets for WooCommerce » button reads “read more” should be “add to cart”

  • Resolved dands.contact

    (@dandscontact)


    when I creare a ticket product the “add to cart” button reads “read more” instead of “add to cart”
    please help

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi @dandscontact,

    Event Tickets don´t have an official Hebrew traduction. Seems that your website is loading a woocommerce-he.po file that overwriting the ‘הוסף לסל‘ (Add To Cart) text. Please try to find this file an open it with .po editor (Poedit for example). Find the text and check if wrong. If the text is wrong, you can fix it and replace the file.

    Please try it and let me know.
    Regards.

    Hello @yithemes
    thank you for your response, I am working on translaiting your plugin to Hebrew, the problume is not just the text, but the wole layout of the page
    please see the followin link, it holds two pictures
    first is defined as a ticket with your wonderful plugin
    the second is defined as a regular product
    https://imgur.com/a/9BhBr
    you can clearly see that the two pages look diffaret

    Thanks for you time

    Plugin Author YITHEMES

    (@yithemes)

    Hi @dandscontact,

    Looking your website we have seen that you are using Wipi framework. Checking this code framework we fund this part of code…:

    wipi\classes\class-fl-theme-woocommerce.php:223

    /**
    * Translate cart button text
    * @return string
    */
    public static function cart_button_text() {
    	global $product;
    
    	$product_type = $product->product_type;
    
    	switch ( $product_type ) {
    		case 'external':
    			return __( 'Buy product', 'wipi' );
    			break;
    		case 'grouped':
    			return __( 'View products', 'wipi' );
    			break;
    		case 'simple':
    			return __( 'Add to cart', 'wipi' );
    			break;
    		case 'variable':
    			return __( 'Select options', 'wipi' );
    			break;
    		default:
    			return __( 'Read more', 'wipi' );
    		}
    	}

    This method gets the current product type and return specific strings depending from type. On our case, our product it´s a ticket-event, for this reason you are getting always ‘Read more’. Wipi theme always overwrite our default text.

    We see that Wipi uses woocommerce_product_single_add_to_cart_text filter to override the strings. You can reuse to overwrite your custom strings…:

    Add the following code in your functions.php from your active theme or from your customization plugin.

    
    if ( ! function_exists( 'set_single_add_to_cart_text' ) ) {
        function set_single_add_to_cart_text ($text_button) {
        global $product;
    
        $product_type = $product->product_type;
    
        switch ( $product_type ) {
    	case 'external':
    		return __( 'Buy product', 'your-text-domain' );
    		break;
    	case 'grouped':
    		return __( 'View products', 'your-text-domain' );
    		break;
    	case 'variable':
    		return __( 'Select options', 'your-text-domain' );
    		break;
    	default:
    		return __( 'Add to cart', 'your-text-domain' );
    		}
        }
    }
    add_filter('woocommerce_product_single_add_to_cart_text', 'set_single_add_to_cart_text', 98);

    This should be keep the ‘Add to Cart’ string on your product page.

    Please try it and let me know.
    Regards.

    unfortunately its not working

    Plugin Author YITHEMES

    (@yithemes)

    Hi @dandscontact,

    It´s really strange, we have made some tests with Wipi Framework and our local installation works fine. Please check that you are adding the snippet on the current functions from active theme. Probably another plugin or theme be overwriting the code.

    If the problem still happening, we advise you to contact the team that has developed Wipi Framework. We can only ensure the proper functioning of our plugins with WooCommerce.

    Regards.

    I will contact WIPI developer,
    thank you very much for you efforts

    Best wishes

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘button reads “read more” should be “add to cart”’ is closed to new replies.