Coding Panda
Forum Replies Created
-
As long as the “name” field is in the table, you can add other fields and it should work.
I will make it work even the “name” field is not available. Hopefully, I have a new version released next week.
I need to look into it. For now, please create a “name” field and use a different label if necessary.
From your description, you can try to add a plain text field with “name” as its Name. That should solve the problem. If your Pods Framework is not up to date, please update it.
Screenshots:
🙂 I am glad that I can help. Thanks for the advice. I will improve it when I have time.
Good luck with your project.
Getting there. 🙂
We can allocate them to $product_names and loop the array:
$params = array( 'orderby' => 't.post_title DESC', 'limit' => 25, ); $product_pod = pods( 'product', $params ); $products = $product_pod->data(); foreach( $products as $product ){ $product_names = pods_field( 'product', $product->ID, 'product' ); foreach( $product_names as $product_name ){ echo $product_name['name'] . '<br/>'; } }No worries. If it is on the front page, we need to use
pods_field( 'product', $product_id, 'product' ).I don’t know how you fetch your products, but here is how I do it:
$params = array( 'orderby' => 't.post_title DESC', 'limit' => 25, ); $product_pod = pods( 'product', $params ); $products = $product_pod->data(); foreach( $products as $product ){ print_r( pods_field( 'product', $product->ID, 'product' ) ); }- This reply was modified 4 years, 5 months ago by Coding Panda.
Yes, that is the right stuff.
The field name you use for the repeater field is “product” instead of “product_name”, so we just need to update that in your single-product.php template.
<pre> <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); print_r(pods_field( 'product', get_the_ID(), 'product' )); } } ?> </pre>Since it is in the single-product.php template, you can just do this:
<pre> <?php print_r( pods_field( 'product' ) ); ?> </pre>Screenshots:
https://www.dropbox.com/s/s3uddmifz1rjzsz/tea-%E2%80%93-Panda-Pods-Repeater-Field.png?dl=0
Would you export the relevant pods and paste them here so I can investigate?
In case you don’t know how to export pods, please go to Pods Admin > Components and enable the Migrate:Packages component, then refresh the page and go to Pods Admin > Components > Migrate Packages and click Export.
Try this:
<div class="row"> <?php while(have_posts()): the_post(); print_r(pods_field( 'product', get_the_ID(), 'product_name' )); endwhile ?> </div>Is your template single_product.php? Or it is a template to list more than one product?
Based on the pod and field names you provided, it should be:
pods_field( 'products', $product_id, 'product_name' );Please replace $product_id with a product id. It should return an array of the product names.
Thanks for using the plugin.
Have you checked the “How to fetch data at the frontend” in the FAQs here: https://ww.wp.xz.cn/plugins/panda-pods-repeater-field/?
Let me know if it answers your question.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Output with ShortcodeHi @one3rdnerd I tried to build an Element accordion widget but it did not work well so it is not completed.
Anyway, there is no problem building a shortcode to output the repeat field data. Please use pods_field to fetch the data. I tested your shortcode and pods_field worked fine. 🙂
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Images Uploaded Doesn’t Show in PODS 2.8Hi @wparijat, I have fixed the issue. Please update the plugin and see if it works. Any problems, please let me know. Many thanks.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Images Uploaded Doesn’t Show in PODS 2.8@wparijat
Thanks for letting me know. I have figured out the problem. I will update the plugin ASAP.