Загрузка...

#12 (Parent and child products) & product attribute |Django Oscar E-commerce

If you're interested in getting some of the code, consider subscribing to one of the tiers in my Patreon membership! I'll personally email you the link to access it. Thank you for your support!

Patreon : patreon.com/ElieCode
Welcome back to the channel! Today, we’re diving into a key concept in
#ecommerce platforms, especially for those of you working with Django Oscar or any other framework that deals with complex product structures. We’re talking about Product Variants—specifically, the difference between parent and child products, and the distinction between product attributes and variants. By the end of this video, you’ll know exactly when to use each one and how they can help structure your product catalog for easier management and a better customer experience. So, let’s jump in!

parents and Child Products
Imagine you’re selling a product that comes in multiple versions, like a T-shirt available in different colors or sizes. Instead of creating separate entries for each version, we can group these under a single product to make things cleaner. This is where parent and child products come in.

A parent product is the main product that acts as an umbrella, grouping similar versions or variations of itself.
Child products represent each specific version under that parent. These are the individual sizes or colors, for instance.
In #django #oscar , only the parent product, or products without children, will have their own URL by default. This means that the parent product page will display the overarching details, and customers can select from options—like different sizes or colors—that correspond to the child products.

But here’s the important part: only the child products can have stock records. Stock records are where you store essential information like the price and stock quantity for each version. So, if a customer selects a red T-shirt in size medium, they’re selecting a specific child product that has its own unique stock and price data.

Product Attributes vs. Variants

Now, one of the most common questions is, when should I use attributes, and when should I use variants? This is a critical distinction to get right because it impacts both the customer’s experience and how you manage your catalog.

Variants are what we just talked about. They’re tied directly to stock records, so if each variation of your product has different pricing or availability, you should use variants. For example, a size XL shirt might be more expensive than size S, or a limited-edition color might have fewer items in stock. Each of these requires its own stock record.

Attributes, on the other hand, are used for properties like #colors , #size , or fabric that don’t impact pricing or stock by themselves. Attributes are great for search and filtering purposes. For example, if you have multiple colors for a shirt but each color is priced the same, then color can just be an attribute. It doesn’t need to be a variant unless the color impacts the stock or price.

So here’s a quick summary to keep things clear:

Use #variants if each product variation has different pricing or stock levels. Variants let you manage inventory at a more detailed level.
Use #attributes for properties that help users filter and #search but don’t affect #stock or #price
00:00 - Introduction
03:20 - Modifying the ProductAttribute Model: Organizing product attributes by category
06:44 - Updating the Product Attribute Form: Adding the variants field
08:03 - Including the Variants Input: Customizing the Product Class form template
12:09 - Rendering Attributes and Options: Displaying based on variant categories in templates
21:12 - Dynamically Removing Variant Options: Filtering options listings dynamically
24:34 - Checking for Variant vs. Non-Variant Options: Listing other options conditionally
25:56 - Dynamically Retrieving Option Names: Using them in input names
39:18 - Overview of Parent and Child Products: Understanding the difference
40:00 - Adding Parent and Child Products: Step-by-step guide
43:13 - Setting Default Price Values: Adjusting for multi-currency setups in the strategy file
46:07 - Updating the Details Page: Displaying parent products with child products

Видео #12 (Parent and child products) & product attribute |Django Oscar E-commerce канала ELIE
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять