How to make a comparison table between CPT Product with Custom Fields

Support General How to make a comparison table between CPT Product with Custom Fields

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #35546
    Nikola VladimirovNikola Vladimirov
    Participant

    Hello,

    I am building a product catalog website avoiding Woocommerce like wildfire.

    It has no e-commerce functionality like user profiles, carts, checkouts etc., just plain products with custom fields. I'm using Oxygen Builder, if that's of any relevance.

    I want to be able to add the products to a comparison table "cart" of sorts and when that cart is viewed to display the products side by side with their custom fields, and I'm thinking of Metabox favorite posts might be able to do the trick to some extent.

    Why am I doing this instead of going the Woocommerce way? Simple answer - custom tables, less bloat from unrequired functionality, less plugins, etc.

    Any pointers on how to achieve that?

    I've seen that Toolset has something similar, and I found a plugin to compare CPTs, but it doesn't look trustworthy. Keep in mind that I have limited PHP knowledge.

    Thanks

    #35547
    Nikola VladimirovNikola Vladimirov
    Participant

    Okay, MB Favorite posts is the thing that will do the trick.

    Now, the question is how do I make it display the products' fields in a repeater...Is there a way to query the favorites area in the advanced query editor and get the fields so I can build the side by side comparison instead the table view?

    Thanks

    #35571
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The frontend dashboard does not support customizing the table to display custom fields of listing posts. You can follow this topic to create your own dashboard with coding https://support.metabox.io/topic/duplicate-dashboard-shortcode/

    If you have limited knowledge about coding, you can create a service request here https://metabox.io/contact/. Our developer will help you to create custom code as your requirements for a small extra fee.

    #35640
    Nikola VladimirovNikola Vladimirov
    Participant

    I see. Thank you very much. I will try to do it and learn a thing or two then 🙂

    #35644
    Nikola VladimirovNikola Vladimirov
    Participant

    Alright, I've been reading this: https://docs.metabox.io/mb-favorite-posts/#data in relation to this post here: https://support.metabox.io/topic/mb-favorite-posts-customization/

    But I can't seem to make it output the posts custom fields that are assigned to it.

    Should I use meta_query?

    What am I missing?

    Is there a snippet that I can use?

    There are 5 field groups, primarily text fields and number fields. No repeaters.

    #35645
    Nikola VladimirovNikola Vladimirov
    Participant

    This is what I'm adding to the code:

    <?= esc_html(rwmb_the_value($marka)) ?>
    in posts.php

    Still doesn't display the custom field value.

    #35672
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can pass the variable $post_id to the helper function in the loop to get the field value.

    $marka = rwmb_meta( 'field_id', '', $post_id );
    echo $marka;
    #43122
    TonyTony
    Participant

    I was looking to do the very same thing, is this possible?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.