v1.5.7d Adding Products from vendor API
Working on a new site. As part of that I've made a new admin menu item that allows the user to enter a vendor SKU or a manufacturer's part number and use a vendor API to find a product skeleton.
I have all that part working and have all the product info sitting in $_POST fields ready to be processed on the "Is this the one?" confirmation screen.
What I would really like to do with this is pass the $_POST over to collect_info.php and allow it to handle the editing and actual product insertion. I think I see how to bypass collect_info and go to preview_info, but I'd rather not do it that way.
Can I do this or will I have to settle for preview_info?
Re: v1.5.7d Adding Products from vendor API
I think you should review how collect_info handles the data to pre-populate the fields when you use the Back button on the preview_info page.
Then duplicate that action with your custom insert button to load the same fields in collect_info, to be able to review it before inserting it.
Re: v1.5.7d Adding Products from vendor API
Thanks torvista.
I ended up looking at how preview_product handled the "Back" button, and the URL I ended up on when calling collect_php in various circumstances.
This form header was the answer I was looking for..
Code:
<?php echo zen_draw_form('product', FILENAME_PRODUCT, 'cPath=' . $cPath . '&action=new_product', 'post', 'enctype="multipart/form-data" class="form-horizontal"'); ?>
After getting the visible and hidden values I want to appear on collect_info into $_POST of course.