Remove Product Import guide page

This commit is contained in:
Matt-Yorkley
2018-07-15 20:48:12 +01:00
parent da344adbcd
commit f344b7893d
7 changed files with 0 additions and 290 deletions

View File

@@ -4,12 +4,6 @@ module Admin
class ProductImportController < Spree::Admin::BaseController
before_filter :validate_upload_presence, except: %i[index guide validate_data]
def guide
@product_categories = Spree::Taxon.order('name ASC').pluck(:name).uniq
@tax_categories = Spree::TaxCategory.order('name ASC').pluck(:name)
@shipping_categories = Spree::ShippingCategory.order('name ASC').pluck(:name)
end
def import
# Save uploaded file to tmp directory
@filepath = save_uploaded_file(params[:file])

View File

@@ -1,69 +0,0 @@
- content_for :page_title do
Product Import Guide
- content_for :page_actions do
%div.toolbar{ 'data-hook' => "toolbar" }
%ul.actions.header-action-links.inline-menu
%li
= button_link_to 'Back to Import', main_app.admin_product_import_path
= render partial: 'spree/admin/shared/product_sub_menu'
.product-import-introduction
%h5 Spreadsheet Columns
= render 'admin/product_import/guide/columns'
%h5 Weight, volume, or single items
%p
When creating a product you can specify a number of options. If the product is measured
by weight, unit_value should be set to a number and unit_type should be set to either
g for grams, Kg for kilograms, or T for tonnes.
%p
For items such as liquids, the unit_type can be ml for millilitres, L for litres or
Kl for kilolitres.
%p
For other items that are sold in different units such as "a bunch of carrots", you can
enter 1 for units, leave unit_type blank, and enter a name in the variant_unit_name
column such as "loaf" or "bunch".
%h6 Example spreadsheet data:
= render 'admin/product_import/guide/units'
%h5 Product Variants
%p
Variants are distinguished by the units and display_name fields and grouped by product name.
The example below shows a salad that comes in 500g and 750g variants, and a cake that comes in
multiple flavours.
%h6 Example spreadsheet data:
= render 'admin/product_import/guide/variants'
%h5 Category Values
%p
Listed below are the available Product categories, as well as Tax and Shipping categories.
%h6 Product Categories
- @product_categories.each do |pc|
%span.category= pc
%h6 Tax Categories
- @tax_categories.each do |tc|
%span.category= tc
%h6 Shipping Categories
- @shipping_categories.each do |sc|
%span.category= sc

View File

@@ -1,100 +0,0 @@
%table.product-import-columns
%thead
%tr
%th Column Title
%th Required
%th Examples
%th Description
%th Notes
%tbody
%tr
%td
%strong name
%td Yes
%td Potatoes
%td The name of the product
%td
%tr
%td
%strong supplier
%td Yes
%td Pennylane Farm
%td The name of the product's supplier
%td
%tr
%td
%strong category
%td Yes
%td Vegetables
%td The product category
%td See below for a list of available categories
%tr
%td
%strong on_hand
%td Yes
%td 15
%td The amount currently in stock
%td
%tr
%td
%strong price
%td Yes
%td 2.50
%td The price of the product
%td
%tr
%td
%strong units
%td Yes
%td 750
%td The weight or volume value.
%td
%tr
%td
%strong unit_type
%td Yes
%td g
%td The unit type, i.e. g for grams, Kg for Kilograms, ml for millilitres. Can be blank (see notes).
%td If unit_type is left blank, a variant_unit_name must be given.
%tr
%td
%strong variant_unit_name
%td Maybe
%td bunch
%td If the product is sold as an item such as "bunch", "loaf" or "case", that goes here.
%td Used for products that don't use a unit_type for weight or volume.
%tr
%td
%strong display_name
%td No
%td Orange
%td Used to name product variants, if they have a distinct name.
%td
%tr
%td
%strong on_demand
%td No
%td 1
%td Flag the product as "made on demand". The product will not use stock levels.
%td 1 for active, 0 for disabled, or leave blank to ignore.
%tr
%td
%strong tax_category
%td No
%td (Various, see notes)
%td Sets the product tax category
%td See below for a list of available categories
%tr
%td
%strong shipping_category
%td No
%td (Various, see notes)
%td Sets the product shipping category
%td See below for a list of available categories
%tr
%td
%strong available_on
%td No
%td 2018-05-21
%td Sets the date from which the product will be available
%td Date format is: YYYY-MM-DD

View File

@@ -1,54 +0,0 @@
%table
%thead
%tr
%th
%th name
%th category
%th supplier
%th on_hand
%th price
%th units
%th unit_type
%th variant_unit_name
%tbody
%tr
%td 1
%td Salad Bag
%td Salads
%td Sue's Salads
%td 26
%td 3.50
%td 500
%td g
%td
%tr
%td 2
%td Fruit Juice
%td Drinks
%td Country Juices
%td 12
%td 3.50
%td 300
%td ml
%td
%tr
%td 3
%td Potatoes
%td Vegetables
%td Fernwell Farm
%td 67
%td 4.20
%td 1
%td kg
%td
%tr
%td 3
%td Wholemeal Bread
%td Baked goods
%td Tim's Bakery
%td 66
%td 3.00
%td 1
%td
%td loaf

View File

@@ -1,54 +0,0 @@
%table
%thead
%tr
%th
%th name
%th category
%th supplier
%th on_hand
%th price
%th units
%th unit_type
%th display_name
%tbody
%tr
%td 1
%td Salad Bag
%td Salads
%td Sue's Salads
%td 26
%td 3.50
%td 500
%td g
%td
%tr
%td 2
%td Salad Bag
%td Salads
%td Sue's Salads
%td 44
%td 5.50
%td 750
%td g
%td
%tr
%td 3
%td Cake
%td Baked goods
%td Tim's Cakes
%td 10
%td 4
%td 500
%td g
%td Banana and Walnut
%tr
%td 4
%td Cake
%td Baked goods
%td Tim's Cakes
%td 18
%td 4
%td 500
%td g
%td Carrot

View File

@@ -1,12 +1,6 @@
- content_for :page_title do
#{t('admin.product_import.title')}
- content_for :page_actions do
%div.toolbar{ 'data-hook' => "toolbar" }
%ul.actions.header-action-links.inline-menu
%li
= button_link_to 'View Guide', main_app.admin_product_import_guide_path
= render partial: 'spree/admin/shared/product_sub_menu'
= render 'upload_form'

View File

@@ -133,7 +133,6 @@ Openfoodnetwork::Application.routes.draw do
get '/inventory', to: 'variant_overrides#index'
get '/product_import', to: 'product_import#index'
get '/product_import/guide', to: 'product_import#guide', as: 'product_import_guide'
post '/product_import', to: 'product_import#import'
post '/product_import/validate_data', to: 'product_import#validate_data', as: 'product_import_process_async'
post '/product_import/save_data', to: 'product_import#save_data', as: 'product_import_save_async'