Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
841685b
Implement EAV structure for product entity
Jade-GG Jul 24, 2025
78a47ec
Apply fixes from Duster
Jade-GG Jul 24, 2025
77c9a41
Fix model name
Jade-GG Jul 24, 2025
42a1a7e
Get store specific values
Jade-GG Jul 24, 2025
ee340e9
Apply fixes from Duster
Jade-GG Jul 24, 2025
9cfed19
Allow for values to be queried on, filter products based on website a…
Jade-GG Jul 24, 2025
30c975e
Apply fixes from Duster
Jade-GG Jul 24, 2025
573f3bf
Rename EavAttribute to AbstractAttribute
Jade-GG Jul 24, 2025
9184a38
Apply fixes from Duster
Jade-GG Jul 24, 2025
0cda5c0
Add stock data to products
Jade-GG Jul 24, 2025
9766b95
Apply fixes from Duster
Jade-GG Jul 24, 2025
dbe6403
Rename Datetime
Jade-GG Jul 24, 2025
e6b9338
Delete src/Models/AttributeDateTime.php
Jade-GG Jul 24, 2025
22b4949
Cast value properly when getting
Jade-GG Jul 24, 2025
521423d
Apply fixes from Duster
Jade-GG Jul 24, 2025
b6fef4c
Small fixes
Jade-GG Jul 24, 2025
24c785d
Add parent, children, super attributes & super attribute values
Jade-GG Jul 24, 2025
b72b189
Apply fixes from Duster
Jade-GG Jul 24, 2025
f5fcd82
Add consts
Jade-GG Jul 24, 2025
1ec5263
Fix sorting on super attributes & change whereValue to whereAttribute
Jade-GG Jul 24, 2025
8594af0
Apply fixes from Duster
Jade-GG Jul 24, 2025
46f1854
Rename product, use config rapidez.model, add callbacks, abstractify …
Jade-GG Aug 6, 2025
ab8aeda
Still return falsy values
Jade-GG Aug 6, 2025
0bab9eb
Remove old scopes, update HasAlternates to include rewrites relation
Jade-GG Aug 6, 2025
3f25db8
Apply fixes from Duster
Jade-GG Aug 6, 2025
98aacc5
Remove unnecessary casts
Jade-GG Aug 6, 2025
052ba64
Add URL, images, price for configurable/grouped products, move stuff …
Jade-GG Aug 6, 2025
7e934b7
Apply fixes from Duster
Jade-GG Aug 6, 2025
f310cc7
Simplify price & add specialPrice
Jade-GG Aug 6, 2025
baae5d8
Merge branch 'feature/flat-tables' of https://github.com/rapidez/core…
Jade-GG Aug 6, 2025
e42bdc5
Apply fixes from Duster
Jade-GG Aug 6, 2025
c7c4da2
Make custom attributes trait slightly more abstract, add product link…
Jade-GG Aug 7, 2025
7faf8d3
Apply fixes from Duster
Jade-GG Aug 7, 2025
0830d95
Add inverted product links
Jade-GG Aug 7, 2025
c13f98c
Add category info & use config models
Jade-GG Aug 7, 2025
f3e8018
Add minSaleQty
Jade-GG Aug 7, 2025
9c0f104
Add breadcrumb categories
Jade-GG Aug 7, 2025
c8499d0
Add reviewSummary
Jade-GG Aug 7, 2025
b50ce36
Fix bug & add toArray for indexing
Jade-GG Aug 7, 2025
d265943
Allow indexing (but slow)
Jade-GG Aug 8, 2025
5262dcf
Apply fixes from Duster
Jade-GG Aug 8, 2025
2240d05
Formatting
Jade-GG Aug 8, 2025
3947219
Add tier pricing
Jade-GG Aug 26, 2025
1097b17
Apply fixes from Duster
Jade-GG Aug 26, 2025
16993dc
Merge pull request #985 from rapidez/feature/flat-tables-tier-pricing
royduin Aug 27, 2025
9602fe3
Fix performance
Jade-GG Sep 1, 2025
cdb4c9b
Apply fixes from Duster
Jade-GG Sep 1, 2025
21a2620
Merge branch 'master' into feature/flat-tables
royduin Oct 15, 2025
ded4821
Fix product pages & improve given product data
Jade-GG Oct 16, 2025
e4ed907
Add todo
Jade-GG Oct 16, 2025
6815f9b
Apply fixes from Duster
Jade-GG Oct 16, 2025
8fac631
Fix categories & super attributes
Jade-GG Oct 16, 2025
2e535bf
Apply fixes from Duster
Jade-GG Oct 16, 2025
71abd6b
Merge branch 'feature/flat-tables' into feature/flat-tables-product-data
Jade-GG Oct 16, 2025
2523f8a
[CI] Update Snapshots
Jade-GG Oct 16, 2025
94eca16
Fix super attributes swatch data
Jade-GG Oct 16, 2025
9ad97eb
Merge branch 'feature/flat-tables-product-data' of https://github.com…
Jade-GG Oct 16, 2025
49f6c47
[CI] Update Snapshots
Jade-GG Oct 16, 2025
ae91e4d
Merge pull request #1050 from rapidez/feature/flat-tables-product-data
royduin Oct 16, 2025
18c484f
Explose stock implementation
royduin Oct 16, 2025
10d4dd1
Apply fixes from Duster
royduin Oct 16, 2025
8728146
Accessors for backwards compatiblity
royduin Oct 16, 2025
275272d
Switched the fallback method so relations can be used
royduin Oct 16, 2025
eca329b
Fixed the grouped products, relation prices and breadcrumbs for inact…
royduin Oct 16, 2025
4682610
Use the non-deprecated naming
royduin Oct 16, 2025
53a9b0f
Merge branch 'feature/flat-tables' of github.com:rapidez/core into fe…
royduin Oct 16, 2025
2f24eef
Apply fixes from Duster
royduin Oct 16, 2025
035e093
Moved the product backwards compatibile accessors to a trait
royduin Oct 16, 2025
ea83753
Partially implement super attributes & small value refactor (#1052)
Jade-GG Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/rapidez/attribute-models.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend' => Rapidez\Core\Models\AttributeModels\ArrayBackend::class,
];
3 changes: 3 additions & 0 deletions config/rapidez/magento-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
'catalog/seo/category_url_suffix' => '.html',
'catalog/seo/product_url_suffix' => '.html',
'cataloginventory/item_options/backorders' => '0',
'cataloginventory/item_options/min_sale_qty' => '1',
'cataloginventory/item_options/max_sale_qty' => '10000',
'cataloginventory/item_options/qty_increments' => '1',
'cataloginventory/options/show_out_of_stock' => '0',
'checkout/cart/redirect_to_cart' => '0',
'currency/options/default' => 'USD',
Expand Down
22 changes: 13 additions & 9 deletions config/rapidez/models.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,45 @@

// The fully qualified class names of the models.
return [
'page' => Rapidez\Core\Models\Page::class,
'attribute' => Rapidez\Core\Models\Attribute::class,
'product' => Rapidez\Core\Models\Product::class,
'attribute_option' => Rapidez\Core\Models\AttributeOption::class,
'block' => Rapidez\Core\Models\Block::class,
'category' => Rapidez\Core\Models\Category::class,
'customer_group' => Rapidez\Core\Models\CustomerGroup::class,
'category_product' => Rapidez\Core\Models\CategoryProduct::class,
'customer' => Rapidez\Core\Models\Customer::class,
'customer_group' => Rapidez\Core\Models\CustomerGroup::class,
'config' => Rapidez\Core\Models\Config::class,
'oauth_token' => Rapidez\Core\Models\OauthToken::class,
'option_swatch' => Rapidez\Core\Models\OptionSwatch::class,
'option_value' => Rapidez\Core\Models\OptionValue::class,
'page' => Rapidez\Core\Models\Page::class,
'product' => Rapidez\Core\Models\Product::class,
'product_image' => Rapidez\Core\Models\ProductImage::class,
'product_image_value' => Rapidez\Core\Models\ProductImageValue::class,
'product_link' => Rapidez\Core\Models\ProductLink::class,
'product_view' => Rapidez\Core\Models\ProductView::class,
'product_option' => Rapidez\Core\Models\ProductOption::class,
'product_option_title' => Rapidez\Core\Models\ProductOptionTitle::class,
'product_option_price' => Rapidez\Core\Models\ProductOptionPrice::class,
'product_option_type_title' => Rapidez\Core\Models\ProductOptionTypeTitle::class,
'product_option_title' => Rapidez\Core\Models\ProductOptionTitle::class,
'product_option_type_price' => Rapidez\Core\Models\ProductOptionTypePrice::class,
'product_option_type_title' => Rapidez\Core\Models\ProductOptionTypeTitle::class,
'product_option_type_value' => Rapidez\Core\Models\ProductOptionTypeValue::class,
'product_review_summary' => Rapidez\Core\Models\ProductReviewSummary::class,
'product_stock' => Rapidez\Core\Models\ProductStock::class,
'product_super_link' => Rapidez\Core\Models\ProductSuperLink::class,
'product_view' => Rapidez\Core\Models\ProductView::class,
'quote' => Rapidez\Core\Models\Quote::class,
'quote_id_mask' => Rapidez\Core\Models\QuoteIdMask::class,
'quote_item' => Rapidez\Core\Models\QuoteItem::class,
'quote_item_option' => Rapidez\Core\Models\QuoteItemOption::class,
'report_event' => Rapidez\Core\Models\ReportEvent::class,
'rewrite' => Rapidez\Core\Models\Rewrite::class,
'store' => Rapidez\Core\Models\Store::class,
'widget' => Rapidez\Core\Models\Widget::class,
'block' => Rapidez\Core\Models\Block::class,
'sales_order' => Rapidez\Core\Models\SalesOrder::class,
'sales_order_address' => Rapidez\Core\Models\SalesOrderAddress::class,
'sales_order_item' => Rapidez\Core\Models\SalesOrderItem::class,
'sales_order_payment' => Rapidez\Core\Models\SalesOrderPayment::class,
'search_query' => Rapidez\Core\Models\SearchQuery::class,
'search_synonym' => Rapidez\Core\Models\SearchSynonym::class,
'store' => Rapidez\Core\Models\Store::class,
'super_attribute' => Rapidez\Core\Models\SuperAttribute::class,
'widget' => Rapidez\Core\Models\Widget::class,
];
1 change: 1 addition & 0 deletions config/rapidez/searchkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'url',
'thumbnail',
'in_stock',
'min_sale_qty',
'children',
'super_*',
'reviews_count',
Expand Down
22 changes: 11 additions & 11 deletions resources/js/components/Product/AddToCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default {
// Options per super attribute that match the given named refinements
return Object.fromEntries(
Object.entries(this.product?.super_attributes || {}).map(([index, attribute]) => {
let attributeValues = values.find(([key, value]) => key === attribute.code)?.[1] || []
let attributeValues = values.find(([key, value]) => key === attribute.attribute_code)?.[1] || []
if (!Array.isArray(attributeValues)) {
attributeValues = [attributeValues]
}
Expand Down Expand Up @@ -339,7 +339,7 @@ export default {
var simpleProducts = Object.values(product.children).filter((childProduct) => {
let isMatching = true
Object.entries(this.options).forEach(([attributeId, valueId]) => {
var attributeCode = product.super_attributes[attributeId].code
var attributeCode = product.super_attributes[attributeId].attribute_code

if (Number(childProduct[attributeCode]) !== Number(valueId)) {
isMatching = false
Expand Down Expand Up @@ -377,7 +377,7 @@ export default {

productUrl: function () {
let namedOptions = Object.fromEntries(
Object.entries(this.options).map(([key, value]) => [this.product.super_attributes[key]?.code, value]),
Object.entries(this.options).map(([key, value]) => [this.product.super_attributes[key]?.attribute_code, value]),
)

let params = new URLSearchParams(namedOptions)
Expand Down Expand Up @@ -410,23 +410,23 @@ export default {
}

Object.entries(this.product.super_attributes).forEach(([attributeId, attribute]) => {
disabledOptions['super_' + attribute.code] = []
disabledOptions['super_' + attribute.attribute_code] = []
valuesPerAttribute[attributeId] = {}
// Fill list with products per attribute value
Object.entries(this.product.children).forEach(([productId, option]) => {
if (!valuesPerAttribute[attributeId][option[attribute.code]]) {
valuesPerAttribute[attributeId][option[attribute.code]] = []
if (!valuesPerAttribute[attributeId][option[attribute.attribute_code]]) {
valuesPerAttribute[attributeId][option[attribute.attribute_code]] = []
}

if (!option.in_stock) {
if (Object.keys(this.product.super_attributes).length === 1) {
disabledOptions['super_' + attribute.code].push(option[attribute.code])
disabledOptions['super_' + attribute.attribute_code].push(option[attribute.attribute_code])
}

return
}

valuesPerAttribute[attributeId][option[attribute.code]].push(productId)
valuesPerAttribute[attributeId][option[attribute.attribute_code]].push(productId)
})
})

Expand All @@ -437,7 +437,7 @@ export default {
Object.entries(valuesPerAttribute).forEach(([attributeId2, productsPerValue2]) => {
if (attributeId === attributeId2) return
var selectedValueId = this.options[attributeId]
var attributeCode = this.product.super_attributes[attributeId2].code
var attributeCode = this.product.super_attributes[attributeId2].attribute_code

Object.entries(productsPerValue2).forEach(([valueId, products]) => {
// If there is no product that intersects for this attribute value
Expand Down Expand Up @@ -465,10 +465,10 @@ export default {
valuesPerAttribute[attributeId] = []
// Fill list with products per attribute value
Object.entries(this.product.children).forEach(([productId, product]) => {
if (!product.in_stock || this.disabledOptions['super_' + attribute.code].includes(product.value)) {
if (!product.in_stock || this.disabledOptions['super_' + attribute.attribute_code].includes(product.value)) {
return
}
valuesPerAttribute[attributeId].push(product[attribute.code])
valuesPerAttribute[attributeId].push(product[attribute.attribute_code])
})
})
return valuesPerAttribute
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/Product/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default {
Object.values(window.config.product.children).forEach((child) => {
if (
child === simpleProduct &&
Object.values(window.config.product.super_attributes).filter((attribute) => attribute.update_image).length
Object.values(window.config.product.super_attributes).filter(
(attribute) => attribute.additional_data.update_product_preview_image,
).length
) {
self.images = simpleProduct.images
self.active = Math.min(self.active, self.images.length - 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div v-for="(superAttribute, superAttributeId) in item.super_attributes" class="mt-2">
<template v-if="superAttribute.visual_swatch">
<template v-if="superAttribute.additional_data?.swatch_input_type === 'visual'">
@include('rapidez::listing.partials.item.super-attributes.visual-swatch')
</template>
<template v-else-if="superAttribute.text_swatch">
<template v-else-if="superAttribute.additional_data?.swatch_input_type === 'text'">
@include('rapidez::listing.partials.item.super-attributes.text-swatch')
</template>
<template v-else>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<label>
<x-rapidez::label>
@{{ superAttribute.label }}
@{{ superAttribute.frontend_label }}
</x-rapidez::label>
<x-rapidez::input.select
v-bind:name="superAttributeId"
v-model="addToCart.options[superAttributeId]"
required
>
<option disabled selected hidden v-bind:value="undefined">
@lang('Select') @{{ superAttribute.label.toLowerCase() }}
@lang('Select') @{{ superAttribute.frontend_label.toLowerCase() }}
</option>
<option
v-for="(option, optionId) in addToCart.getOptions(superAttribute.code)"
v-for="(option, optionId) in addToCart.getOptions(superAttribute.attribute_code)"
v-text="option.label"
v-bind:value="optionId"
v-bind:disabled="addToCart.disabledOptions['super_'+superAttribute.code].includes(optionId)"
v-bind:disabled="addToCart.disabledOptions['super_'+superAttribute.attribute_code].includes(optionId)"
/>
</x-rapidez::input.select>
</label>
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<div>
<x-rapidez::label>
@{{ superAttribute.label }}
@{{ superAttribute.frontend_label }}
</x-rapidez::label>

<ul class="flex flex-wrap gap-x-1.5 gap-y-2 items-center pr-14">
<li v-for="(option, optionId) in addToCart.getOptions(superAttribute.code)">
<li v-for="(option, optionId) in addToCart.getOptions(superAttribute.attribute_code)">
<x-rapidez::input.swatch.text
type="radio"
v-bind:name="superAttribute.code"
v-bind:name="superAttribute.attribute_code"
v-model="addToCart.options[superAttributeId]"
v-bind:value="option.value"
v-bind:disabled="addToCart.disabledOptions['super_' + superAttribute.code].includes(option.value)"
v-bind:disabled="addToCart.disabledOptions['super_' + superAttribute.attribute_code].includes(option.value)"
v-bind:aria-label="option.label"
v-bind:id="option.label"
required
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<div>
<x-rapidez::label>
@{{ superAttribute.label }}
@{{ superAttribute.frontend_label }}
</x-rapidez::label>

<ul class="flex flex-wrap gap-x-1.5 gap-y-2 items-center pr-14">
<li v-for="(option, optionId) in addToCart.getOptions(superAttribute.code)">
<li v-for="(option, optionId) in addToCart.getOptions(superAttribute.attribute_code)">
<x-rapidez::input.swatch.visual
type="radio"
v-bind:name="superAttribute.code"
v-bind:name="superAttribute.attribute_code"
v-model="addToCart.options[superAttributeId]"
v-bind:value="option.value"
v-bind:disabled="addToCart.disabledOptions['super_' + superAttribute.code].includes(option.value)"
v-bind:disabled="addToCart.disabledOptions['super_' + superAttribute.attribute_code].includes(option.value)"
v-bind:aria-label="option.label"
v-bind:id="option.label"
v-bind:color="window.config.swatches[superAttribute.code]?.options?.[option.value]?.swatch ?? 'none'"
v-bind:color="window.config.swatches[superAttribute.attribute_code]?.options?.[option.value]?.swatch ?? 'none'"
required
>
@{{ option.label }}
Expand Down
15 changes: 8 additions & 7 deletions resources/views/product/overview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
<dd>{{ $product->entity_id }}</dd>
<dt>SKU</dt>
<dd>{{ $product->sku }}</dd>
@foreach (config('rapidez.models.attribute')::getCachedWhere(fn($a) => $a['productpage']) as $attribute)
@if (($value = $product->{$attribute['code']}) && !is_object($value))
<dt>{{ $attribute['name'] }}</dt>
<dd>
@php $output = is_array($value) ? implode(', ', $value) : $value @endphp
{!! $attribute['html'] ? $output : e($output) !!}
</dd>
@foreach (\Rapidez\Core\Models\EavAttribute::getCachedCatalog()->where(fn ($attribute) => $attribute->is_visible_on_front) as $attribute)
@if (($value = $product->{$attribute['attribute_code']}))
<dt>{{ $attribute['frontend_label'] }}</dt>
@if ($attribute['is_html_allowed_on_front'])
<dd>{!! $value !!}</dd>
@else
<dd>{{ $value }}</dd>
@endif
@endif
@endforeach
</dl>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/product/partials/super-attributes.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@foreach ($product->super_attributes ?: [] as $superAttributeId => $superAttribute)
@if ($superAttribute->visual_swatch)
@foreach ($product->superAttributes ?: [] as $superAttributeId => $superAttribute)
@php($swatchType = $superAttribute->additional_data['swatch_input_type'] ?? null)
@if ($swatchType === 'visual')
@include('rapidez::product.partials.super-attributes.visual-swatch')
@elseif ($superAttribute->text_swatch)
@elseif ($swatchType === 'text')
@include('rapidez::product.partials.super-attributes.text-swatch')
@else
@include('rapidez::product.partials.super-attributes.drop-down')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<label>
<x-rapidez::label>
{{ $superAttribute->label }}
{{ $superAttribute->frontend_label }}
</x-rapidez::label>
<x-rapidez::input.select
id="super_attribute_{{ $superAttributeId }}"
Expand All @@ -10,14 +10,14 @@ class="w-64"
required
>
<option disabled selected hidden :value="undefined">
@lang('Select') {{ strtolower($superAttribute->label) }}
@lang('Select') {{ strtolower($superAttribute->frontend_label) }}
</option>
@foreach ($product->{'super_' . $superAttribute->code} as $optionId => $option)
@foreach ($product->superAttributeValues[$superAttribute->attribute_code] as $option)
<option
value="{{ $option->value }}"
:disabled="addToCart.disabledOptions.super_{{ $superAttribute->code }}.includes({{ $option->value }})"
value="{{ $option['value'] }}"
:disabled="addToCart.disabledOptions.super_{{ $superAttribute->attribute_code }}.includes({{ $option['value'] }})"
>
{{ $option->label }}
{{ $option['label'] }}
</option>
@endforeach
</x-rapidez::input.select>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<div>
<x-rapidez::label>
{{ $superAttribute->label }}
{{ $superAttribute->frontend_label }}
</x-rapidez::label>

<ul class="flex flex-wrap gap-x-1.5 gap-y-2 items-center pr-14">
@foreach ($product->{'super_' . $superAttribute->code} as $optionId => $option)
@foreach ($product->superAttributeValues[$superAttribute->attribute_code] as $option)
<li>
<x-rapidez::input.swatch.text
type="radio"
name="{{ $superAttribute->code }}"
name="{{ $superAttribute->attribute_code }}"
v-model="addToCart.options[{{ $superAttributeId }}]"
v-bind:disabled="addToCart.disabledOptions.super_{{ $superAttribute->code }}.includes({{ $option->value }})"
:value="$option->value"
:aria-label="$option->label"
:id="$option->label"
v-bind:disabled="addToCart.disabledOptions.super_{{ $superAttribute->attribute_code }}.includes({{ $option['value'] }})"
:value="$option['value']"
:aria-label="$option['label']"
:id="$option['label']"
required
>
{{ $option->label }}
{{ $option['label'] }}
</x-rapidez::input.swatch.text>
</li>
@endforeach
Expand Down
Loading