• Resolved smipweb

    (@smipweb)


    I have a shop with woocommerce: every product as a producer. So I created a pods for producer.
    Now, I want to show, in each product, the producer’s details.
    The problem is: how to select the producer of the product?
    I mean:
    [pods name=”producer” where=”taxonomy_name.slug = ‘THIS PAGE'”]{@producer_address} <br/>{@producer_name} [/pods]

    where the slug “THIS PAGE” would be the producer. How I can “get” the slug of a specific product?
    Thank you

Viewing 13 replies - 16 through 28 (of 28 total)
  • Thread Starter smipweb

    (@smipweb)

    I mean..every product has only 1 producer, that’s why I didn’t understand it just print 3 times the same name.

    Thread Starter smipweb

    (@smipweb)

    Hello Jory,
    I didn’t understand, I mean: I did a relation from a product to a producer (1 product as just 1 producer).
    And it’s running well…there is just a producer’s problem. I can’t just tell to stop after 1 iteration?
    thanks

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @smipweb

    I’ll need to see more code and have more info to better understand what you did.
    Please share your full templates and other code you are using to create the view.

    Cheers, Jory

    Thread Starter smipweb

    (@smipweb)

    Ok, what can I show you?
    Because the code…it’s just the shortcode I put.
    Than, we added the relation for the product with the producer (by extending the post type with pods) and we do a custom taxonomy to create the producer

    Plugin Author Jory Hogeveen

    (@keraweb)

    Please share the following:

    – The full shortcode (latest version)
    – Where you are inserting this shortcode (where exactly, not just the page type but the actual location, eg. a field, a block, a textarea)
    – The Pod template (if used)
    – The link to the page so I can see the output.

    Thread Starter smipweb

    (@smipweb)

    That’s an exemple:

    https://terranostra.ch/product/uva-nera-senza-semi/

    The shortcode is after INFO PRODUTTORE: the producer listed 3 times is “DA CRI – Frutta..”.

    The code:

    [pods field="producer"] <b>{@producer_name}</b>
    {@producer_squared_logo}<br/><br/>
    
    {@producer_description_short} <span id="dots"></span>
    <span id="more" style="display: none;">{@producer_description_long}</span>
    <br/><br/>
    <button onclick="myFunction()" id="myBtn">Leggi di più</button>
    <br/><br/><b>Indirizzo :</b> <a href="https://www.google.com/maps/place/{@producer_address}" target="_blank" >{@producer_address}</a><br/>
    <b>Sito web:</b>  {@producer_website}
    <br/> {@producer_gallery}<br/>
    {@producer_personal_photo}
    [/pods]
    

    Do you need something else?
    thank you!!!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @smipweb

    First off, I think it’s best to wrap this code in a <div> element or something, this reads a lot easier :).

    Anyhow, from what I can see it all should be fine.

    Could you try to add use_current=1 to the shortcode?
    [pods use_current=1 field="producer"]

    It could be that in this context (because of the use of Elementor) Pods isn’t aware of the current object.

    Cheers, Jory

    Thread Starter smipweb

    (@smipweb)

    thank you Jory,
    I tried but nothing (tried also with “”).

    others suggestions?

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @smipweb

    Could you add the post ID in the template so I can check the value?
    Just place <!--{@ID}--> at the beginning so it’s hidden in the page code.

    Cheers, Jory

    Thread Starter smipweb

    (@smipweb)

    Hello,
    this is the page:https://terranostra.ch/product/aglio-secco/

    or I didn’t understand what do you mean..

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @smipweb

    I don’t think you understood. I wanted to make sure these 3 items are actual different items within WordPress because the content is exactly the same. Therefor if you add the object ID in the template you can simply see whether it is the same or not.

    In any case, the shortcode is correct, that isn’t your problem as far as I can tell.

    Could you try the code below?

    
    [pods field="producer"]
    <div id="producer-{@ID}">
    <b>{@producer_name}</b>
    {@producer_squared_logo}<br/><br/>
    
    {@producer_description_short} <span id="dots"></span>
    <span id="more" style="display: none;">{@producer_description_long}</span>
    <br/><br/>
    <button onclick="myFunction()" id="myBtn">Leggi di più</button>
    <br/><br/><b>Indirizzo :</b> <a href="https://www.google.com/maps/place/{@producer_address}" target="_blank" rel="noopener">{@producer_address}</a><br/>
    <b>Sito web:</b>  {@producer_website}
    <br/> {@producer_gallery}<br/>
    {@producer_personal_photo}
    </div>
    [/pods]
    
    • This reply was modified 1 year, 10 months ago by Jory Hogeveen.
    Thread Starter smipweb

    (@smipweb)

    Ah,ok,i see,but the ID is always the same…you can check 🙁

    Plugin Author Jory Hogeveen

    (@keraweb)

    Then you have some other issue, it looks like this post is simply added three times, could that be correct?
    Maybe enable “custom fields” (WordPress core metabox) and check if you can see such issues within the metadata.

    Custom Fields

    Also please check for plugin conflicts:
    https://docs.pods.io/faqs/plugin-theme-conflicts/

    Cheers, Jory

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘Pods related specific to the page’ is closed to new replies.