I installed Custom Press and I created a field for

Hi,

I installed Custom Press and I created a field for a webshop plugin (WP Marketplace) I`m using.
The field is for the product quantity. I made it as a custom field. It is working fine in the backend (attachment 2 ) when I`m editing a product and also I can display the field on the product page on the frontend (attachment 1).

This is a multi vendor plugin and it allows users to edit their product on the frontend. And my question is how can i create an input text field, where users can update the number of quantity, like the price field (attachment 3)

My website url is: http://www.yourhotelmarket.com/
Under My Shop tab you can see the add product tab (you either need to register or I can create an account for you. The website is still in testing face, so feel free to register and upload anything)

  • Michelle Shull

    Hi there, Cecilia!

    CustomPress isn't going to be your best option here, because we don't have a way to connect the quantity to WPMarketplace, so it won't decrease your stock as products are purchased, you'd have to do that manually.

    I downloaded the plugin itself and took a look at the code, it's a bit difficult to untangle how they're handling stock management from looking at the code. I noticed there were a few support threads about adding quantity support to the front end, but they appear to be unanswered. It also looks like the plugin is officially only compatible to WP 3.8, so it may be outdated, as well. (This isn't definitive proof, the devs may have simply forgotten to check a box when they updated, but it may be a clue.)

    Typically, we'd refer you to the plugin's support team, or perhaps an independent developer, to help you get front-end quantity support that works like it should, but let me see if our second line support team can help here. The support threads for the plugin aren't filling me with confidence you'll get the answers you need there. If this can be fixed up for you relatively quickly, our second level team may be able to help. It can sometimes take a little longer to hear from that team, they work on our most complex issues, but you should get a reply as soon as possible.

    If it's super-critical, I can point you to our jobs board, the devs who bid for jobs there are independent, they don't work for us, but I know there are some really talented folks working there.

    Thanks for your question!

  • Cecilia

    Hi,

    Thanks for the quick reply.

    Im so sorry I forgot to mention a quite important thing. The quantity field doesnt have to be linked to any stock. My website will be just a platform to connect sellers and buyers, but the actual transaction won`t happen there. So the quantity field is just simply an information only field and if the seller feels that he found buyers for 50 items out of 200, then he can manually modify it.

    And I know, I`m using a not supported, not really well maintained plugin, but unfortunately this was the only plugin I could find (free or not free) that has this kind of front end management options.

    So will it be possible to put that field there? It is not urgent, I can wait, I just need to know if it is possible or not. Otherwise I need to look for another plugin and start over.

    Thanks in advance,
    Cecilia

  • Hoang Ngo

    Hi @Cecilia,

    I hope you are well today.

    For the backend, you can create the quantity field by going to CustomPress->CustomFields->Add new field, and in the Post Type field, please check the wpmarketplace.
    From now, when you visit the edit/add product page, this will auto show up. For the frontend, we will need to add a little bit code to make it work.

    Please add this code to your theme functions.php or use mu-plugins

    add_filter('wpmp_frontend_metabox', 'wpmp_frontend_metabox_quantity');
    function wpmp_frontend_metabox_quantity($product_id)
    {
        $field_id = 'YOUR_FIELD_ID';
        ?>
        <div class=&quot;well well-sm&quot;>
            <input type=&quot;text&quot; class=&quot;ct-field ct-text&quot; name=&quot;<?php echo $field_id ?>&quot; id=&quot;<?php echo $field_id ?>&quot; value=&quot;<?php echo get_post_meta($product_id,$field_id,true) ?>&quot;>
        </div>
    <?php
    }

    Please replace the YOUR_FIELD_ID with your actual custom field ID. Please check my screenshot for more info :slight_smile:

    If you have any issues please don't hesitate to let us know so we can assist.

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.