PS PrestaShop Beginner

Pet Shop Module for PrestaShop: module documentation

Install and configure pet profiles, portion calculation, bag sizes, replenishment plans, e-mail reminders and one-click reorder.

Updated Module version 1.1.0

This module adds to PrestaShop 8 and 9 pet profiles in the customer account, a portion calculator and a bag size recommendation on dry food pages, and replenishment plans that send a reminder before the bag runs out, based on the customer’s real consumption. Technical name: dfpetcare.

Installation

  1. In Modules > Module Manager, click Upload a module and drop the ZIP file.
  2. The module creates its tables and three species with their breeds: dog (32 breeds), cat (12 breeds) and rabbit (2 breeds).
  3. A Sell > Pet Care menu appears with four pages: Feeding settings, Replenishment plans, Pet profiles and Species and breeds. A My pets link is added to the customer’s My account page.
  4. Schedule the cron URL shown on the module configuration page (see below).

Setting up food products

Only products declared in Pet Care > Feeding settings show the portion block. Click Add, search the product by name, reference or ID, then fill in:

  • For: the species concerned. Only pets of these species are offered on the product page. Leave empty for all species.
  • The food’s life stage (all ages, growth, adult, senior): a warning appears when the customer’s pet is not in that stage.
  • Calculation: by energy or by feeding table (see below).
  • Shelf life after opening in days: bags that would stay open longer are not recommended. 0 = no limit.
  • Net weight: for a product with combinations, the weight of each combination in grams. The Fill from combination names button uses the weights read in the names (12 kg, 400 g, 12 x 85 g). Leave empty a combination that is not food. For a simple product, enter the total net weight.

Energy calculation

Enter the metabolisable energy of the food in kcal/kg (dry food: usually 3400 to 4200, wet food: 700 to 1200). For a dog or a cat, the module calculates the resting energy requirement (70 × weight0.75), multiplies it by a factor for life stage, neutering and activity, then converts it into grams. This method does not apply to species set to “Other”.

Feeding table calculation

Copy the table printed on the bag: one line per pet weight with grams per day, and the life stage of the line. Between two lines, the portion is interpolated. Outside the table, it follows the metabolic weight. The Adjust to the pet option corrects the portion for neutering and activity for adults and seniors. It is the only possible method for rabbits, rodents and birds.

When the vet has set a target weight, the module calculates the portion for that weight rather than the current weight.

Species and breeds

In Pet Care > Species and breeds, each species has a name per language and a nutrition model: dog, cat or other (feeding table only). Breeds have a name per language and a size from toy to giant: for a puppy, the size sets the adult age (12 months for small breeds, 18 months for large breeds, 24 months for giant breeds). Without a breed, the size is deduced from the weight. A species used by pets cannot be deleted: disable it instead. Deleting a breed leaves the pets concerned without a breed.

What the customer sees

My pets

From My account, the customer creates up to 20 profiles: name, species, breed, sex, date of birth, current weight, target weight, neutering and activity level. Each card shows the age and life stage (puppy, kitten, adult, senior).

Product page

Under the price, the Daily ration and bag size block offers the customer’s pets that match the food. For the selected pets, it shows the portion in grams per day, the advised number of meals, the total when there are several pets, then a bag size table with durations and price per kg. The recommended size has a badge and a Choose the bag button. A 7-day transition guide gives the grams of new food day by day, naming the pet’s current food when it is known.

The recommended size is the cheapest per kg among available sizes lasting at least the minimum coverage you set, without exceeding the shelf life after opening.

The E-mail me a few days before the bag is empty checkbox turns reminders on for this food. The pet selection and the checkbox are kept for the next order.

Visitors

With the ration calculator for visitors, a visitor or a customer without pets enters the species, weight, age, activity and neutering and gets the same recommendation. A signed-in customer can save this profile by giving it a name.

Order confirmation page

After a dry food order, a block offers to turn reminders on and, when the customer has several pets, to choose the ones eating this food. This block never turns off reminders that are already on: it can only turn them on and set the pets.

Replenishment plans

Each customer has one plan per food. An order is recorded when it is validated and added to the plan once its status counts as paid. The stock starts on the order date plus the average delivery time, then decreases every day with the consumption:

  • the theoretical consumption is the sum of the portions of the pets linked to the plan;
  • each time the customer says how much is left (at least 5 days after the previous answer), the module calculates the observed consumption, bounds it between 0.4 and 2.5 times the theoretical one to discard typing errors, and combines it with the previous estimate;
  • when the customer changes a pet profile, the consumption follows the same proportion.

The empty date follows, and the reminder is scheduled reminder lead time days earlier. A plan whose bag has been empty for 90 days without a new order is closed.

Customer area

In My pets, each tracked food shows a stock gauge, the days left, the estimated empty date, the next reminder date and the consumption used. The customer can say how much is left (empty, a quarter, half, three quarters, one bag, one and a half bags, two bags), choose which pets eat the food, turn reminders on or off, reorder, or stop tracking the food.

Reminders and reorder

Only plans whose customer turned reminders on receive e-mails:

  • the first reminder goes out on the scheduled day;
  • the follow-up reminder goes out the set number of days later if the customer neither reordered nor answered (0 disables it).

The e-mail contains a Reorder button, three answer links (about 2 weeks left, about 1 week left, the bag is empty) and a link to pause reminders. Answer links open a confirmation page: nothing is recorded until the customer clicks, which protects against mail scanners that open links.

The Reorder button asks the customer to sign in, fills the cart with the same size and quantity, and redirects to checkout. If that size is out of stock, the module offers the available size closest in quantity. If the replenishment discount is above 0 and the customer keeps reminders on, a single-use voucher is applied, limited to that food and valid for the set number of days (code PET followed by 8 characters).

The module never charges the customer: they pay for the reorder with your usual payment methods.

Module configuration

  • Reminder lead time (7 days): how many days before the estimated empty date the reminder goes out. Include your delivery time.
  • Follow-up reminder (5 days, 0 = off).
  • Average delivery time (3 days): start of the consumption of a new bag.
  • Replenishment discount (5%, 0 = no voucher) and voucher validity (14 days).
  • Minimum coverage for the recommended bag (14 days) and default shelf life after opening (42 days), prefilled on new foods.
  • Ration calculator for visitors, run tasks from back-office traffic and reminders per run (50).

Out-of-range values are automatically brought back within the allowed limits.

Cron task

The configuration page shows a token-protected URL. Call it every hour, for example:

0 * * * * curl -s "https://your-shop.com/module/dfpetcare/cron?token=..." > /dev/null

Each run adds paid orders to their plans, sends the reminders due and closes inactive plans. Without a cron job, keep the back-office traffic option on: tasks then run at most every 3 hours when an employee uses the back office. The Run tasks now button runs them on demand.

Back office

  • Replenishment plans: plan list filterable by customer, e-mail, food, status, reminders and empty date, exportable to CSV, with the month’s indicators (reminders sent, reorders after a reminder, stock answers). The plan view shows the pets and their portion, the theoretical and used consumption, the estimated stock, the full history, and lets you record the stock reported by the customer or resend the reminder.
  • Pet profiles: filterable and exportable list for your marketing segments (species, breed, age, weight, neutering, customer).
  • Customer page: a block shows the customer’s pets and plans with a link to each plan.

E-mails and translations

The dfpetcare_reorder template is provided in 8 languages (French, English, Spanish, German, Italian, Dutch, Polish, Portuguese), in HTML and text, with a separate subject and introduction for the follow-up. For any other installed language, the English template is copied. The module interface is translated into the same languages.

GDPR

The module answers personal data export and deletion requests: pet profiles, plans, tracked orders and saved choices. Deleting a customer also deletes their data in the module.

Upgrading from 1.0.0

Install the 1.1.0 ZIP over the existing version. The upgrade script adds the last reminder date, turns the follow-up on at 5 days, registers the order confirmation and customer page hooks, and keeps your pets, foods and plans.

FAQ

The portion block does not appear on the product page

Check that the product is declared and enabled in Feeding settings, that an energy or a table is entered, and that the customer has a pet of a matching species. Without pets, the calculator only appears when it is enabled.

Bag durations are not shown

The net weight of the combination is missing. Enter it in Feeding settings.

No reminder is sent

Check that the customer turned reminders on for this food, that the cron task runs (last run date on the configuration page) and that the shop’s e-mails work. The Send the reminder now button on a plan shows an error if sending fails.

What happens on uninstall?

The module tables are deleted: pets, foods, plans and histories. Vouchers already created remain in cart rules.

Was this page helpful?

Still stuck? Contact support