• Resolved lazarev1985

    (@lazarev1985)


    It is necessary to get the value of the fields by id, how to do this in one query.
    Example
    id-1 price 5
    id-2 price 15
    id-3 price 25

    I need to get values for id 1 and 3

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    is this a relationship field? Are you in a loop? We need more information to help you with this question. Are you talking about post ID’s or some other kind of indication for id-1 and id-3?

    Thread Starter lazarev1985

    (@lazarev1985)

    I’m writing an online store. The product has an id and a price field. When a person orders goods, I create an array of id. Then using localStorage
    I transfer it to the basket. In the basket, I want to run a loop and get information about the product by id.

    Thread Starter lazarev1985

    (@lazarev1985)

    Example
    [pods name=”products” where=”id=45, 53, 68 ” ]

    [/pods]

    • This reply was modified 6 years, 6 months ago by lazarev1985.
    Plugin Contributor Jim True

    (@jimtrue)

    This would not be the ideal way to do that in a shortcode but the issue you’re having is the SQL. You need to use a SQL IN statement, ie where="ID in ('45', '53', '68')"

    We don’t have any e-commerce capabilities, etc, you’d be better off using a plugin specifically for e-commerce like WooCommerce for your online store. Why reinvent the wheel?

    Thread Starter lazarev1985

    (@lazarev1985)

    Thank you, it helped a lot. I want to understand the work of the plug-in Pods and use it in my projects, I can not stylize woocommerce to my layout. Thank you!!!

    Plugin Contributor Jim True

    (@jimtrue)

    No worries, glad that helped. Just wanted to make sure you knew that we don’t handle eCommerce, or payment gateways or anything of that kind ??

    Good luck!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Retrieving data by id’ is closed to new replies.