Listinger Plugin Documentation

Comprehensive guide for using the Listinger Simple Product Listing Plugin

1. Installation

To install the Listinger Simple Product Listing plugin:

  1. Download the Listinger Simple Product Listing plugin ZIP file.
  2. In WordPress, go to Plugins > Add New > Upload Plugin.
  3. Select the downloaded ZIP file, click Install Now, and then Activate the plugin.

2. Getting Started

After activating the plugin, you can start managing products:

  • Create Products: Navigate to Listinger > Add New in your WordPress admin panel to create a new product.
  • Create Product Categories: Organize products using categories in Listinger > Product Categories.
  • Use Shortcodes: Display product listings on your site using shortcodes, which can be customized for layout and display options.

3. Product Custom Post Type

The plugin registers a custom post type for products (listinger_product), enabling you to add, edit, and display products with custom fields and media.

  • Labels: Custom labels are used throughout the WordPress dashboard for a more intuitive interface. For example:
    • Add New Product, Edit Product, and View Product.
  • Slug: The products use the custom slug fmcg-products.
  • Supports: The product post type supports the following WordPress elements:
    • Title: Display the product name.
    • Editor: Add a detailed product description.
    • Thumbnail: Assign a featured image.

Customizable Display Settings

Products can be displayed individually or in lists on pages, posts, or sidebar areas. Archive and single product pages use custom templates for consistent formatting.

4. Product Categories

The plugin includes a custom taxonomy called listinger_product_category for organizing products. Categories help group similar products, making it easier for users to navigate.

  • Slug: The categories use the slug fmcg-product-category.
  • Hierarchical Structure: Categories are hierarchical, allowing parent-child relationships for subcategories.
  • Custom Slugs: Each category can have a custom URL slug (more details in the Custom Slug for Categories section).

Example Categories:

  • Face Washes
  • Creams & Lotions
  • Hair Care

5. Custom Fields

Each product post includes several custom fields to enhance the product details.

Key Custom Fields:

Basic Product Information:
  • Price: Set the product’s price.
  • Stock: Define available stock.
  • Minimum Order Quantity: Set the smallest order quantity.
Packaging and Brand Details:
  • Packaging Size: Specify the size or quantity per package.
  • Brand: Specify the product brand.
  • Country of Origin: Indicate the product’s origin.
Additional Product Details:
  • Skin Type: Suitable for various skin types.
  • Key Ingredients: List primary ingredients.
  • Shelf Life: Specify the shelf life.
Media Fields:
  • Images: Add multiple product images.
  • Video: Add a YouTube or Vimeo URL.

6. Shortcodes

The plugin includes several shortcodes for displaying products on your site. Shortcodes are customizable with attributes for layout and filtering.

Available Shortcodes

Product List

[listinger_product_list category="your-category-slug"]

Purpose: Displays a list of products in a specified category.

  • Attributes: category - Filter products by category slug.

Example: [listinger_product_list category="face-washes"]

Single Product

[listinger_product id="product_id"]

Purpose: Displays a single product by ID.

  • Attributes: id - The ID of the product post.

Example: [listinger_product id="123"]

Product URLs

[listinger_product_urls category="your-category-slug" columns="2" links="6"]

Purpose: Displays clickable links to products in a specific category.

  • Attributes: category, columns, links

Example: [listinger_product_urls category="creams" columns="3" links="9"]

Cart

[listinger_cart]

Purpose: Displays the cart contents with product names, quantities, and total price.

Checkout

[listinger_checkout]

Purpose: Displays a checkout form to capture customer information.

Checkout Button

[listinger_checkout_button]

Purpose: Adds a "Proceed to Checkout" button that links to the checkout page.

7. AJAX Functions

The plugin supports AJAX for a smoother user experience without page reloads.

Contact Supplier

Function: listinger_contact_supplier

  • Fields:
    • Product name
    • Supplier’s mobile number
    • Custom message
  • AJAX Handling: Sends an email with inquiry details to the supplier.

Add to Cart

Function: listinger_add_to_cart

  • Fields:
    • Product ID
    • Quantity
  • Response: Success message if the product is added to the cart.

8. Admin Scripts

The plugin enqueues scripts for both frontend and backend operations.

Frontend

  • Styles: Custom CSS for product display, buttons, and other UI elements.
  • Scripts: Includes AJAX functions for adding to cart and contacting suppliers.

Backend (Admin)

  • Media Uploader: Allows users to upload images for each product.
  • Admin Scripts: For managing custom fields, validations, and AJAX handling.

9. Session Management

The plugin uses PHP sessions to manage cart data. The session starts when the cart is first accessed or a product is added, and the data is maintained until checkout.

  • Clearing the Cart: The cart session is cleared upon order completion.
  • Cart Data Storage: The cart contains product IDs and quantities.

10. Custom Slug for Categories

Each product category can have a unique URL slug:

  1. Go to Listinger > Product Categories.
  2. Add a new category or edit an existing one.
  3. Enter a value in the "Custom Slug" field.

Custom slugs improve SEO and allow for more intuitive URLs for product categories.

11. Template Structure

The plugin provides templates for product listings and single product views.

Custom Templates

  • Single Product Template: single-listinger_product.php
    • Usage: Customize the layout for individual product pages.
    • File Location: templates/single-listinger_product.php
  • Archive Template: archive-listinger_product.php
    • Usage: Defines the layout for the product archive (all products).
    • File Location: templates/archive-listinger_product.php
  • Category Template: taxonomy-listinger_product_category.php
    • Usage: Customize the layout for specific product categories.
    • File Location: templates/taxonomy-listinger_product_category.php

To override these templates, copy them to your theme folder and modify as needed.

12. Troubleshooting

  • Products Not Displaying: Ensure the correct template files are in place. Check for console errors or conflicting plugins.
  • Cart or Checkout Issues: Verify that sessions are enabled on your server and ensure no cache plugins are interfering with session data.
  • AJAX Issues: Check that JavaScript is properly enqueued and that no errors appear in the browser console.

14. Import/Export Products

The Listinger plugin includes an import/export feature for bulk managing products via CSV files.

How to Access

Navigate to Listinger > Import/Export from the WordPress dashboard to open the import/export page.

Import Products

To import products from a CSV file:

  1. Select a CSV file with the product data to upload.
  2. Click Import Products to load products from the CSV.

Function: listinger_import_products

Export Products

To export all products into a CSV file:

  1. Click Export Products to download a CSV file of the products.

Function: listinger_export_products

CSV Format

When preparing a CSV file for import, use the following format:

  • Each column represents a field such as Post ID, Title, Content, Price, etc.
  • Include required meta fields like price, brand, and packaging size, and optional fields like categories and featured image URLs.

15. Orders

The Listinger plugin includes an Orders system to manage customer purchases and inquiries.

Registering Orders

Orders are stored in a custom post type listinger_order. This post type captures customer details and order items.

Order Processing Functions

  • Add to Cart: listinger_add_to_cart adds items to the cart using AJAX, stored in a cookie for easy session management.
  • Process Order: listinger_process_order captures customer information and processes the order.

Order Meta Boxes

On the order edit page, the following fields are displayed:

  • Billing Details: Name, email, mobile, and address.
  • Order Items: A table displaying each product, its quantity, price, and total.

Order Shortcodes

  • Add to Cart Button: [listinger_add_to_cart product_id="123"] generates a button to add a specific product to the cart.
  • Checkout Form: [listinger_checkout] displays a checkout form with customer details and cart items.

13. FAQs

Can I customize product display fields?

Yes, you can modify the custom fields in the meta box and display them on the front end by editing the templates.

How do I use a custom slug for product categories?

Add a custom slug in the category editor. It will be used in the URL if specified.

Is the plugin compatible with all themes?

It should work with most themes that support custom post types and templates. Some custom styling may be required.

© 2024 Listinger Plugin. All rights reserved.