• Resolved ggtech

    (@ggtech)


    Hi! Your plugin is amazing, I just want to know how I can translate the “Download Now” and “No Downloads Available” texts.

    Also willing to know if theres is an “automatic” way to add this buttons directly to the single product page of all products.

    Right now im able to add your shortcode “[woocommerce-my-downloads-button id=PRODUCT_ID]” at the product excript so the buttons are shown on the product page but i need to manually change the ID for each product.

    Is there a way to do this automatically with any kind of code snippet?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Matt Pramschufer

    (@mattpramschufer)

    The download now and no download available strings are set in the Settings screen for the plugin. If you goto Admin->Settings->My Downloads Shortcode for WooCommerce you should see the fields there.

    As for an automatic way to insert the product id, currently there is no way to do that. If you wanted to modify the plugin code you could change the function my_downloads_button_shortcode where it says $id = (int) $atts[‘id’]; you could change that to be
    global $product;
    $id = $product->get_id();

    And then it will automatically pull the product ID of the page they are viewing.

    Thread Starter ggtech

    (@ggtech)

    Thanks for your amazing support, just to get you right with the code

    Im able to add “[woocommerce-my-downloads-button id=PRODUCT_ID]” shorcode at the product page, theres no problem with that with 2 different ways:

    1.- Add it at the single page with elementor pro
    2.- Add it at the product description / excript

    So no matter what, im able to place the shortcode. Which way do you recommend me to do it?

    Now having the shortcode there, all i need is to edit the plugin and replace “$id = (int) $atts[‘id’];”

    with this:

    global $product;
    $id = $product->get_id();

    Here comes an extra question, if i do this change to the code, the shortcode im adding at the product page (with elementor or at the product description) will remain the same? Or do i need to add a different shortcode?

    Thread Starter ggtech

    (@ggtech)

    Thanks! I got it to work now, you are amazing ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translate buttons’ is closed to new replies.