|
| 1 | +# Vendor Crud |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +A vendor is a person, company, or entity that sells goods or services. In the context of business |
| 6 | +and commerce, a vendor is often someone who supplies products or services to customers, either |
| 7 | +directly or through a distribution channel. Vendors can operate in various industries, providing |
| 8 | +a wide range of goods and services. |
| 9 | + |
| 10 | +## Understand Vendor |
| 11 | + |
| 12 | +Imagine you're organizing a big party. You need decorations, food, and drinks. |
| 13 | +Now, think of vendors as the different people or businesses you'd buy these things from. |
| 14 | + |
| 15 | +### Supplier (or Seller): |
| 16 | +This is like the person selling balloons, streamers, and other party decorations. |
| 17 | +They're providing the materials you need. |
| 18 | + |
| 19 | +### Manufacturer: |
| 20 | +Picture someone making custom-made cakes for your party. They take the ingredients |
| 21 | +(supplied by others) and create the final product. |
| 22 | + |
| 23 | +### End-User: |
| 24 | +That's you, the person throwing the party, using the products and services provided by |
| 25 | +vendors to make your event a success. |
| 26 | + |
| 27 | +## Features & Demos |
| 28 | + |
| 29 | +The ` Vendors` CRUD (Create, Read, Update, Delete) functionality offers a wide range of features, |
| 30 | +including the ability to display all Vendors. Furthermore, it provides bulk actions that allow you |
| 31 | +to delete multiple pieces of Vendors with a single click and update Vendors, offering the following features: |
| 32 | + |
| 33 | +- Create a New `Vendor` |
| 34 | +- Edit/Update the details of an already existing `Vendor`. |
| 35 | +- Clone `Vendor` details. |
| 36 | +- Autofill `Vendor` fields. |
| 37 | +- Sort the `Vendor` list in ascending/descending order. |
| 38 | +- Perform Bulk Actions to change the status, trash, or delete `Vendor`. |
| 39 | +- List All existing `Vendor`. |
| 40 | +- Filter the `Vendor` list by searching using different `fields`. |
| 41 | +- Filter the `Vendor` list by different status, including trashed `Vendor`. |
| 42 | +- Delete an existing `Vendor`. |
| 43 | +- Delete or temporarily trash an already existing `Vendor`. |
| 44 | + |
| 45 | + |
| 46 | +## Overview Of Vendor Crud |
| 47 | + |
| 48 | +First time when you interact with `Vendor` in `VaahStore`, it will appear like this: at the top, |
| 49 | +you'll find `Vendor ` name, along with options such as a `Create` button for adding new vendor, |
| 50 | +a `Reload` button for retrieving the entire list of data, and a `dropdown button` for creating multiple entries with a single click. |
| 51 | +And a left-side you can access all other crud like store, vendor etc. |
| 52 | + |
| 53 | + |
| 54 | +## Requirement to create a Vendor |
| 55 | + |
| 56 | +| Fields | | Descriptions | |
| 57 | +| ------------------- | ---- | -------------------------------------------- | |
| 58 | +| Name | | This field contains the name of the Vendor.| |
| 59 | +| Slug | | The slug is automatically generated based on the entered name.| |
| 60 | +| Store | | Select the store associated with the vendor.Initially set to the default store, you can change this as needed.| |
| 61 | +| Business Type | | Specify the type of the vendor's business. | |
| 62 | +| Approved By | | Select the staff member responsible for approving this vendor. | |
| 63 | +| Owned By | | Specify the owner of the vendor. | |
| 64 | +| Status | | Determine the status of the vendor using this field. | |
| 65 | +| Status Notes | | Provide additional notes explaining the decision for the selected status.| |
| 66 | +| Years in Business | | Enter the number of years the vendor has been in business.| |
| 67 | +| Services Offered | | Describe the services offered by the vendor in this field.| |
| 68 | +| Country Code | | Enter the country code associated with the vendor.| |
| 69 | +| Phone | | Enter the phone number of the vendor in this field.| |
| 70 | +| Email | | Enter the email address of the vendor.| |
| 71 | +| Address | | Enter the physical address of the vendor.| |
| 72 | +| Document Type | | Select the type of document under the business details form.| |
| 73 | +| Document Details | | Provide details related to the selected document type. | |
| 74 | +| Upload File | | Attach the file associated with the selected document type.| |
| 75 | +| Is Default | | Set this field to make the current vendor the default option for VaahStore. | |
| 76 | +| Auto Approve Product| | Enable this option if you want products associated with this vendor to be automatically approved without manual intervention. | |
| 77 | +| Is Active | | Activate or deactivate vendors using this field.| |
| 78 | + |
| 79 | + |
| 80 | +## Vendor Table |
| 81 | + |
| 82 | +The Vendor Table contains all the vendors registered in VaahStore. Using this table, you can |
| 83 | +search for any vendor in the list using the search filter. The table also provides you with the option |
| 84 | +to view and update the details of the vendors,exclusively accessible to those with the necessary permissions and roles. |
| 85 | + |
| 86 | +<img src="/images/vaahstore/Vendors/vendor-1.png"> |
| 87 | + |
| 88 | +::alert{type="warning"} |
| 89 | +NOTE |
| 90 | +Want to Know about Permissions And Roles: [Click Here](/vaahcms-2/the-basics/user-and-access/permissions) |
| 91 | +:: |
| 92 | + |
| 93 | +## Add product to vendor |
| 94 | + |
| 95 | + |
| 96 | +Once you have created a vendor, you can easily add products directly to the vendor. To do this, follow these steps: |
| 97 | + |
| 98 | +### Step 1. |
| 99 | +Look for the table that displays all the vendors in your system. This table provides a comprehensive list of vendors and their details. |
| 100 | +### Step 2. |
| 101 | +In the table, locate the `Product` column. Here, you will find the total count of products associated with each vendor. |
| 102 | + |
| 103 | +<img src="/images/vaahstore/Vendors/vendor-2.png"> |
| 104 | + |
| 105 | +### Step 3. |
| 106 | +To add a new product to a specific vendor, click on the `+` option under the `Product` column for that vendor. |
| 107 | + |
| 108 | +<img src="/images/vaahstore/Vendors/vendor-3.png"> |
| 109 | + |
| 110 | +### Step 4. |
| 111 | +Clicking on the `+` option will open the `Add Product` page. |
| 112 | + |
| 113 | +<img src="/images/vaahstore/Vendors/vendor-4.png"> |
| 114 | + |
| 115 | +### Step 5. |
| 116 | + |
| 117 | +On the `Add Product` page, you will find a dropdown menu that allows you to select and add a product to the vendor. |
| 118 | + |
| 119 | +<img src="/images/vaahstore/Vendors/vendor-5.png"> |
| 120 | + |
| 121 | +### Step 6. |
| 122 | + |
| 123 | +After selecting the desired product from the dropdown menu, it will be added to the vendor. |
| 124 | + |
| 125 | +### Step 7. |
| 126 | +All the added products will be displayed in a table below. You can make any necessary changes to the product details in the table. |
| 127 | + |
| 128 | +<img src="/images/vaahstore/Vendors/vendor-6.png"> |
| 129 | + |
| 130 | +### Step 8. |
| 131 | +Once you have made the desired changes, click on the "Save" button to save the changes and associate the product with the vendor. |
| 132 | + |
| 133 | +<img src="/images/vaahstore/Vendors/vendor-7.png"> |
| 134 | + |
| 135 | +## API |
| 136 | + |
| 137 | +### create |
| 138 | + |
| 139 | +#### URL |
| 140 | +```php |
| 141 | +POST <public-url>/public/api/store/vendors |
| 142 | +``` |
| 143 | + |
| 144 | +#### Request samples |
| 145 | + |
| 146 | +```php |
| 147 | +parameter = [ |
| 148 | + "name", // String |
| 149 | + "slug", // String |
| 150 | + "vh_st_store_id", // Id |
| 151 | + "approved_by", // Id |
| 152 | + "owned_by", // Id |
| 153 | + "taxonomy_id_vendor_status", // Id |
| 154 | + "status_notes", // String |
| 155 | + "is_default", // Boolean |
| 156 | + "auto_approve_products", // Boolean |
| 157 | + "is_active", // Boolean |
| 158 | +]; |
| 159 | +``` |
| 160 | + |
| 161 | +#### Response sample |
| 162 | + |
| 163 | +```php |
| 164 | +{ |
| 165 | + "status": "success", |
| 166 | + "messages": [ |
| 167 | + "Saved" |
| 168 | + ], |
| 169 | + "data": { |
| 170 | + ........... |
| 171 | + ........... |
| 172 | + ........... |
| 173 | + } |
| 174 | +} |
| 175 | +``` |
| 176 | + |
| 177 | +### Get List |
| 178 | + |
| 179 | +#### URL |
| 180 | +```php |
| 181 | +GET <public-url>/public/api/store/vendors?rows={number_of_rows} |
| 182 | +``` |
| 183 | + |
| 184 | +#### Response sample |
| 185 | + |
| 186 | +```php |
| 187 | +{ |
| 188 | + "success": true, |
| 189 | + "data": { |
| 190 | + ........... |
| 191 | + ........... |
| 192 | + ........... |
| 193 | + } |
| 194 | +} |
| 195 | +``` |
| 196 | + |
| 197 | +### Get Record |
| 198 | + |
| 199 | +#### URL |
| 200 | +```php |
| 201 | +GET <public-url>/public/api/store/vendors/{record_id} |
| 202 | +``` |
| 203 | + |
| 204 | +#### Response sample |
| 205 | + |
| 206 | +```php |
| 207 | +{ |
| 208 | + "success": true, |
| 209 | + "data": { |
| 210 | + ........... |
| 211 | + ........... |
| 212 | + ........... |
| 213 | + } |
| 214 | +} |
| 215 | +``` |
| 216 | + |
| 217 | +### Save Product |
| 218 | + |
| 219 | +#### URL |
| 220 | +```php |
| 221 | +POST <public-url>/public/api/store/vendors/product |
| 222 | +``` |
| 223 | + |
| 224 | +#### Request samples |
| 225 | + |
| 226 | +```php |
| 227 | +parameter = [ |
| 228 | + .......... |
| 229 | + 'same as create' |
| 230 | + .......... |
| 231 | + "products": { |
| 232 | + "can_update" // Boolean |
| 233 | + "id" // product id |
| 234 | + "product" // Id |
| 235 | + "status" // Id |
| 236 | + }, |
| 237 | +]; |
| 238 | +``` |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
0 commit comments