• Resolved tlouwet

    (@tlouwet)


    Hi,

    Loving the plugin so far, though got an issue
    Tried searching it left and right, but couldn’t find anything

    The URLs written in the description of variable products (text per variable) won’t link to myweb.com/fr/page instead of myweb.com/page for example (website I’m working on is behind maintenance mode).

    I tried the next few setups:
    a href=”https://www.myweb.com/page/”>Page</a
    a href=”https://www.myweb.com/page”>Page</a
    a href=”/page/”>Page</a

    If I use it in the base language it’s all good (redirected to https://www.myweb.com/nl/page/ from https://www.myweb.com/page/ ), though the moment I use the link in another language it will redirect to the base language of that page (as URL stays hhtp://www.myweb/page/ for example).

    The URLs do get adjusted for non-variable products though, so the issue I’m having is specifically with variable products.

    • This topic was modified 6 years ago by tlouwet.
    • This topic was modified 6 years ago by tlouwet.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Cristian Antohe

    (@sareiodata)

    Hi,

    All variables should contain links in the original language and we’ll convert them to the correct language once you change it.

    However, if that’s displayed via javascript (I’m assuming they are), it won’t work. We don’t yet have support for that.

    Is this the case?

    Thread Starter tlouwet

    (@tlouwet)

    Hi,

    thanks for the quick response.

    I’ve tried a plenitude of different themes to see if it’s because of a custom way my theme handles variable products, but the issue persisted throughout. Could ofcourse still be that all the ones I tried did it through java.

    They all had the description per variable in variable product under:
    > div summary entry-summary
    > form variations_form cart (woocommerce github link)
    > div single_variation_wrap (gets called in above mentioned github linked php)
    > div woocommerce-variation single_variation
    > div woocommerce-variation-description
    > p (for the text)
    > a ref (for the links, these links don’t get changed)

    And for normal products under:
    > div summary entry-summary
    > form woocommerce-product-details__short-description
    > p (for the text)
    > a ref (for the links, these links get changed)

    Not sure if above mentioned helps at all. Php/css/js is rather new to me.

    Is woocommerce calling it the same way for every theme?
    If not, is there a known theme I could swap to that would make this work?

    I’ve tried using the trp_lanuage shortcode, and while it doesn’t write out the shortcode visually, it doesn’t hide the links of other languages, so sadly not something that could fix it.

    Thanks for your time.

    Thread Starter tlouwet

    (@tlouwet)

    An yep, seems to be loaded in dir single-product/add-to-cart/variation.php with

    <script type=”text/template” id=”tmpl-variation-template”>
    <div class=”woocommerce-variation-description”>{{{ data.variation.variation_description }}}</div>
    <div class=”woocommerce-variation-price”>{{{ data.variation.price_html }}}</div>
    <div class=”woocommerce-variation-availability”>{{{ data.variation.availability_html }}}</div>
    </script>
    <script type=”text/template” id=”tmpl-unavailable-variation-template”>
    <p><?php _e( ‘Sorry, this product is unavailable. Please choose a different combination.’, ‘woocommerce’ ); ?></p>
    </script>

    Thread Starter tlouwet

    (@tlouwet)

    And found a semi-solution

    For some reason, without “/”, it gets the correct language redirect though stays on the same page (ofcourse).

    Solution I found around this was
    href=”name-of-page” or href=”name-of-product”, which results in “www.domain.com/fr/products/current-product/name-of-product” for example.
    And while that page/product doesn’t exist ofcourse, wordpress will redirect it to what it found to exist.

    Not perfect, but does do what was wanted!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Variable products Woocommerce’ is closed to new replies.