i am developing a multivendor shop and i want the vendors to post products from a Template page. i am using Advance custom fields to achieve this functionality. What i did by far is to create the page template and managed to display the form but i have some issue to validate the fields with the Product. i might need to create some functionalities ?
<?php
/**
* The template for displaying all pages.
* Template Name: Add Product Vendor
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Bober
*/
?>
<?php
acf_form_head();
get_header();
?>
<div id="content">
<?php
global $woocommerce;
acf_form(array(
$post_title = 'field_5a60022b402e2',
$post_categ = 'field_5a60028e402e3',
$post_descrip = 'field_5a600384402e4',
$post_img = 'field_5a6005e1402e7',
$post_price = 'field_5a61207ce5226',
/*'post_title' =>true,
'post_content' => true,*/
'uploader' => 'basic',
'post_id' => 'new_post',
'fields' => array($post_title, $post_descrip, $post_categ,$post_price, $post_img),
'new_post' => array(
'post_status' => 'draft',
'post_type' =>'product',
),
/*'fields' => array('field_5a60022b402e2', 'field_5a60028e402e3', 'field_5a600384402e4', 'field_5a6005e1402e7'),*/
'submit_value' => 'Add product'
));
?>
</div>
<?php get_footer(); ?>
At this point i was able to asign the title of the product and the content of by using the code below based on ACF form documentation.
'post_title' =>true,
'post_content' => true,
How do i assign the Title value, the description value, price value and image to the product post ? I don't necesary look for someone to provide me a code to replace, i want to know how to do it, give me some ideas, or where to read on how to do it.
Thank you in advance!