WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] How to add a product via frontend in woocommerce? (41 posts)

  1. selvendran p
    Member
    Posted 1 year ago #

    Am working on a project, my client want to allow users (customers) to create a product after loging.

    We are using woocommerce plugin.Is there any hook or shortcode available to add a product via frontend in woocommerce.

    Or any other ideas. Please reply

    Thanks

    P.Selvendran

  2. GideonKimani
    Member
    Posted 1 year ago #

    Interested in the same. Any ideas on this?

  3. selvendran p
    Member
    Posted 1 year ago #

    Hi GideonKimani

    Am searching this in very long and lost my time to find a correct answer.There is no plugins and extensions. But Finally i am decide that am going to use wp-user-frontend plugin to upload the product from front end.
    http://wordpress.org/extend/plugins/wp-user-frontend/

    But need to customize this plugin as your wish to upload product.
    Any help reply me.

    Thanks
    P.Selvendran

  4. sk
    Member
    Posted 1 year ago #

    Hey selvendran p,

    I'm using the plugin you mentioned and it works for adding simple products provided you just want to add a title, description and images. I can't get it to post to a category yet but I've only been working with the free plugin for a few hours.

    It works great so far!

  5. selvendran p
    Member
    Posted 1 year ago #

    Hi renegadesk

    You need to customize that free plugin. The plugin displays the default post category. So that you want to change the code to list you product category.

  6. sk
    Member
    Posted 1 year ago #

    Yeah that's true. I'm almost committed to purchasing the premium version as it looks great. Just working out if I should go for it or get WP Types Toolkit instead.

    Have you had any progress with adding products via front end?

  7. selvendran p
    Member
    Posted 1 year ago #

    oh ok ok nice. I have completed the progress with adding products Via front end.

  8. sk
    Member
    Posted 1 year ago #

    That's great selvendran p!

    Care to explain to others how you did it? Would be excellent to have a working solution available for others that are looking.

  9. selvendran p
    Member
    Posted 1 year ago #

    Yes renegadesk,

    Am ready to explain that. Am waiting for some one asking to me. because now am busy with another work..

  10. sk
    Member
    Posted 1 year ago #

    ok cool, well I'm asking :)

    When you get a chance it would be great if you could let us know how you did it.

  11. selvendran p
    Member
    Posted 1 year ago #

    ok well renegadesk,

    The first thing is the plugin have the short code to display add post and edit post and list post pages. you should follow that to display you pages to add product and edit products.

    And also the plugin support the custom post type.

    so for example you goto create a page, name like "Add product" and put the short code in that page as
    [wpuf_addpost post_type="product"]

    Now you go to add post via front end and go to check in admin. your added content displays under the woocommerce products.

  12. sk
    Member
    Posted 1 year ago #

    Thanks selvendran p. I have got that far. You mentioned earlier about post category not using product categories? Do you have a fix for that so you can pick product categories from the front end?

  13. selvendran p
    Member
    Posted 1 year ago #

    Yes renegadesk

    That is correct. If you want to display product categories you need to edit this file wpuf-add-post.php in plugin at the line

    wp_dropdown_categories( 'show_option_none=' . __( '-- Select --', 'wpuf' ) . '&hierarchical=1&hide_empty=0&orderby=name&name=category[]&id=cat&show_count=0&title_li=&use_desc_for_title=1&class=cat requiredField&exclude=' . $exclude );

    Replace with

    wp_dropdown_categories( 'show_option_none=' . __( '-- Select --', 'wpuf' ) . '&hierarchical=1&hide_empty=0&orderby=name&name=category[]&id=cat&show_count=0&taxonomy=product_cat&echo=1&&title_li=&use_desc_for_title=1&class=cat requiredField&exclude=' . $exclude );
  14. martinjesus
    Member
    Posted 1 year ago #

    Hi selvendran p,

    Thanks for your last message! That works perfect for showing the product categories on the ADD POST form.

    But if some product category is selected, it is not saved in the product when posting it.

    Could you please inform us what we should change in order to save the product category in the product?

    Thanks in advance for your help!

  15. selvendran p
    Member
    Posted 1 year ago #

    Hi martinjesus,

    The plugin not store the product category correctly. Because the plugin made by only the post type categories. But woocommerce uses the product_cat as taxonomy. so we need to store our selected category.

    So need to add some code in the wpuf-add-post.php file at after

    if ( wpuf_get_option( 'allow_cats' ) == 'on' )
     {
                $post_category = $_POST['category'];

    Add the code below

    $subCategory = get_term_by( 'slug', $cn, 'product_cat' );
    			$mainCategory = get_term_by( 'id', $subCategory->parent, 'product_cat',ARRAY_A );
    $parid = $mainCategory['parent'];
    $tid = $mainCategory['term_taxonomy_id'];
    $mid = $mainCategory['term_id'];

    Then use this $parid , $tid, $mid to set post term.

  16. karthik7
    Member
    Posted 1 year ago #

    hi ,selvendran p
    I have doubt in plugin customization .. can you help me..

  17. martinjesus
    Member
    Posted 1 year ago #

    Hi selvedran p,

    Thank you for the information of your last post! But I have not been able to make it work correctly, because I am not an expert.

    I do not know what to do with the $parid , $tid or $mid variables. How do I tell wordpress that the product category selected must be added as the product categoty for the new product that I am creating?

    Thanks in advance for your super-help! :)

  18. korabd
    Member
    Posted 1 year ago #

    anyone help on adding attributes via wp user frontend

  19. Raul Illana
    Member
    Posted 1 year ago #

  20. sk
    Member
    Posted 1 year ago #

    Great resources @raulillana the tutsplus tutorial would be the ideal way to go for the devs.

  21. varazdat atanyan
    Member
    Posted 1 year ago #

    Hello can you help me, How can I add a field price

    Thanks

  22. sk
    Member
    Posted 1 year ago #

    Hey @varazdat-atanyan, from what I've seen this is not built in. You would have to write custom code to achieve this.

  23. JB26
    Member
    Posted 1 year ago #

    anyone figure out how to get it to post to product_cat without
    http://wordpress.org/extend/plugins/wp-user-frontend ?

  24. ahikmahin
    Member
    Posted 1 year ago #

  25. Chelo Fernandez
    Member
    Posted 1 year ago #

    Hi!
    I've created a site using WordPress 3.5.1, Woocommerce 2.0.3 and WP User Frontend 2.1.5 Pro

    But I have a great problem!!

    I created a form where both general insert wordpress fields (title, description ...) as WooCommerce attribute fields.

    Then I created a new page called "Add Product" and inserted the form on this page was created.

    I did a test. Everything worked properly. Established in the entry form was a type "product" not "post" and I created it as "product", but ...

    When I visualize the product catalog not see this entry!

    I note that the post Quick View product appears on visivilidad "ocult" when default when you give high a product from the visivilidad backend is marked as "Catalog & search".

    For the product can finally be seen in the store, you must enter the product edition and press the update button.

    But this action does not work, since the products are uploaded by users of the site and never enter the backend.

    Is there any way to fix this problem?

    Thank you very much in advance. It is a very important problem, as we have assembled all this failing system.

  26. chetankm
    Member
    Posted 1 year ago #

    I also need plugin for same and i find this WPstore Frontend in [link removed - this forum is not for posting links ] This solve some of my problem.

  27. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    @Chelo Fernandez - For help with WooCommerce, please post on the plugin's forum here:

    http://wordpress.org/support/plugin/woocommerce#postform

    This thread is not likely to be seen by the developers and it's already marked resolved.

  28. Marcelo Mika
    Member
    Posted 1 year ago #

    use this plugin, works perfect.

    http://wordpress.org/plugins/wp-user-frontend-reloaded/

    ajax has a failure, but in normal mode or check boxes works perfectly from the frontend.

    Now we have to find a way to enter custom fields

    eg, Price

  29. Marcelo Mika
    Member
    Posted 1 year ago #

    @Chelo Fernandez

    It could be that you have marked as private draft or pending

    Change it in the plugin settings

    tab "FRONTEND POSTING"

    Set "Post Status" - PUBLISH - (Default status after user submits post to post)

  30. Lofar
    Member
    Posted 1 year ago #

    @Marcelo Mika
    It seems like the reloaded plugin is exactly what I need for the site I am building, but I also would like to have my custom fields (price etc) mapped to the product itself when adding it.
    Have you had any further progress getting this to work?

Topic Closed

This topic has been closed to new replies.

About this Topic