Property-Based SKU

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Property-Based SKU

Post by aimeos » 19 Jun 2019, 08:07

superscotty19 wrote: 2.) SKUs appearing in frontend: Ah yes! I set the stock, added to basket, and I see the SKU. However, the Manufacturer Part Number (MPN) Property that I defined is acting weird. When I click on the product, I see the "Properties" accordion but when I click it, *all* the MPN properties for all the variants appear. Even if I select a variant, the accordion still shows all MPNs. How can I make it so that I only see the MPN that applies to the selected variant?
Maybe there's a problem in the JS code for the detail template:
- https://github.com/aimeos/ai-client-htm ... d.php#L449
- https://github.com/aimeos/ai-client-htm ... os.js#L667

Can you check that?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

superscotty19
Posts: 95
Joined: 13 May 2019, 08:09

Re: Property-Based SKU

Post by superscotty19 » 19 Jun 2019, 09:04

Hi,

Good idea. The code viewer for the PHP file was cut off but I think that's the problem (specifically, around line 461. I say that because when I look at the source of my item detail page, it has the following code:

Code: Select all

<tbody>
<tr class="item subproduct subproduct-33">
<td class="name">MPN</td>
<td class="value">90052014</td>
</tr>
<tr class="item subproduct subproduct-35">
<td class="name">MPN</td>
<td class="value">90052024</td>
</tr>
<tr class="item subproduct subproduct-37">
<td class="name">MPN</td>
<td class="value">90052012</td>
</tr>
<tr class="item subproduct subproduct-39">
<td class="name">MPN</td>
<td class="value">90052013</td>
</tr>
<tr class="item subproduct subproduct-41">
<td class="name">MPN</td>
<td class="value">90052714</td>
</tr>
<tr class="item subproduct subproduct-43 subproduct-actual">
<td class="name">MPN</td>
<td class="value">90052715</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052716</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052717</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052032</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052033</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052734</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052735</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052736</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052737</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052022</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052023</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052724</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052725</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052726</td>
</tr>
<tr class="item">
<td class="name">MPN</td>
<td class="value">90052727</td>
</tr>
</tbody>
That's suspect because:
a.) The MPN for the variant I chose is in the code
b.) 14/20 items are missing the classes subpart and subproduct-x (or 6/20 have extra classes). Perhaps these 14/20 are the same as the 14/20 causing the initial save problem earlier?
c.) When I change a variant attribute variable using the dropdowns, nothing changes in the Properties dropdown on the page

I hope that gives some insight. I can investigate (b) a bit further by creating another selection product and monitoring the results. However, it won't have 20+ variants....

-S.

superscotty19
Posts: 95
Joined: 13 May 2019, 08:09

Re: Property-Based SKU

Post by superscotty19 » 19 Jun 2019, 22:35

Update to 3.) ... here are the steps I take to create a mess:

a.) Create product + variants
- Enter basic info, choose select
- enter variants (see screenshot 1)
- enter images
- enter text (long description)
- enter prices (0 tax, 689 actual)
- enter default category
- enter characteristics (attributes)
- click save and close

-> all products created as new products, variant attributes are saved to variant attributes

- enter mpn property for 1 item (see screenshot 2)
- save and close

b.) go to frontend
- mpn shows no matter what (see screenshot 3)
- choose a colour and it works but the size goes to a default (see screenshot 4)
- change colour to metallic and set new size - colour changes but size doesnt (see screenshot 5)
- no matter what colour i choose, it sticks on metallic black. in some cases, it changes the size but not the colour even - though i selected colour not size (see screenshot 6)
- if size is "please select" then i can change colour (see screenshot 7)

Looks like a glitch to me ....
Attachments
aimeos select 3.png
aimeos select 3.png (238.88 KiB) Viewed 2834 times
aimeos select 2.png
aimeos select 2.png (67.76 KiB) Viewed 2834 times
aimeos select 1.png
aimeos select 1.png (161.79 KiB) Viewed 2834 times

superscotty19
Posts: 95
Joined: 13 May 2019, 08:09

Re: Property-Based SKU

Post by superscotty19 » 19 Jun 2019, 22:36

more attachments...
Attachments
aimeos select 6.png
aimeos select 6.png (239.71 KiB) Viewed 2834 times
aimeos select 5.png
aimeos select 5.png (240.03 KiB) Viewed 2834 times
aimeos select 4.png
aimeos select 4.png (239.9 KiB) Viewed 2834 times

superscotty19
Posts: 95
Joined: 13 May 2019, 08:09

Re: Property-Based SKU

Post by superscotty19 » 19 Jun 2019, 22:37

last one...
Attachments
aimeos select 7.png
aimeos select 7.png (239.9 KiB) Viewed 2834 times

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Property-Based SKU

Post by aimeos » 21 Jun 2019, 07:46

We can confirm that there's a problem with showing the right attributes and properties. Will come back to you when fixed.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Property-Based SKU

Post by aimeos » 21 Jun 2019, 10:08

Problem has been fixed with this commit: https://github.com/aimeos/ai-client-htm ... 1fe36a2a0b

It's also available in aimeos/ai-client-html version 2019.04.7 and 2018.10.20 and will be part of the next TYPO3 package uploaded to TER. If you don't use composer, you can add the changes of the template and JS file yourself in the meantime.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

superscotty19
Posts: 95
Joined: 13 May 2019, 08:09

Re: Property-Based SKU

Post by superscotty19 » 24 Jun 2019, 08:15

Hi, Sorry for the delay - had to fix wife's car :-)

OK I copied/pasted the code to the 2 files, tested it and while it's better it is still glitching. Here's the scenario:

Item: Bike 1
Bike 1 color red, size small, part # (property) 90418-8002
Bike 1 color red , size large, part # (property) 90418-8004
Bike 1 color blue, size small, part # (property) 90418-8102
Bike 1 color blue, size large, part # (property) 90418-8104
Bike 1 color yellow, size small, part # (property) 90419-8102
Bike 1 color yellow, size large, part # (property) 90419-8104

Now for the testing...

1.) Initial load: Properties dropdown is now empty -> Correct!
2.) Choose color red but leave size blank -> Properties dropdown shows part # 90418-8004 (aka color red size large) -> OK?
3.) Choose color red, size small -> Properties dropdown shows part 90419-8102 (aka color yellow size small) -> WRONG
4.) Choose color red, size large -> Properties dropdown shows part # 90419-8104 (aka color yellow size large) -> WRONG
5.) Choose color blue, size small -> Properties dropdown shows part # 90419-8102 (aka color yellow size small) -> WRONG
6.) Choose color blue, size large -> Properties dropdown shows part # 90419-8104 (aka color yellow size large) -> WRONG
7.) Choose color yellow, size small -> Properties dropdown shows part # 90418-8104 (aka color yellow size large) -> WRONG
8.) Choose color yellow, size large -> Properties dropdown shows part # 90419-8104 (aka color yellow size large) -> Correct?
9.) Go back to color red, size small -> Properties dropdown shows part 90419-8102 (aka color yellow size small) -> WRONG

It seems to be skipping through the loop? Let me know if you need me to run more scenarios as I have more bikes with more options.

HTH,
-S.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Property-Based SKU

Post by aimeos » 24 Jun 2019, 17:35

The changes in the aimeos.js file still seems to be not available while the PHP code is now correct in your installation.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

superscotty19
Posts: 95
Joined: 13 May 2019, 08:09

Re: Property-Based SKU

Post by superscotty19 » 25 Jun 2019, 03:48

Nope,

Here's the code for public_html/typo/typo3conf/ext/aimeos/Resources/Private/Extensions/ai-client-html/client/html/themes/aimeos.js

[code]
} else {
$(".addbasket .btn-action", parent).removeClass("btn-disabled").r$
}

$(".catalog-detail-additional .subproduct-actual").removeClass("subproduc$
$(".catalog-detail-additional .subproduct-" + prodId).addClass("subproduc$

}
}

# Removed as glitch
# $(".catalog-detail-additional .subproduct-actual").removeClass("subproduct-actual");
# $(".catalog-detail-additional .subproduct-" + prodId).addClass("subproduct-actual");
});
[/code]


... and here's the code for

[code] }
}

# Removed 20190623
# foreach( $propItems as $propId => $propItem )
foreach( $propItems as $propItem )
{
# Removed as part of glitch
# $propMap[ $propItem->getType() ][ $propId ] = $propItem;
# $subPropDeps[ $propId ][] = $propItem->getParentId();
$propMap[$propItem->getType()][$propItem->getId()] = $propItem;
$subPropDeps[$propItem->getId()] = $propItem->getParentId();
}
}


...

<?php

# Removed as part of glitch
# if( $propertyItem->getParentId() != $this->detailProductItem$
# && isset( $subPropDeps[ $propertyItem->getId() ] )
# ) {
# $classes .= ' subproduct';
# foreach( $subPropDeps[ $propertyItem->getId() ] as $$
# $classes .= ' subproduct-' . $prodid;
# }
if( isset( $subPropDeps[$propertyItem->getId()] ) ) {
$classes .= ' subproduct subproduct-' . $subPropDeps$
}
?>
[/code]

Plus I've cleared all private data on the browser as well as trying a different browser altogether and clearing opcache on TYPO3.

... but I still get a mess. New example:

Bike2, color teal, size 44cm, has property "MPN" of 90219-6044
Bike2, color teal, size 48cm, has property "MPN" of 90219-6048
Bike2, color teal, size 51cm, has property "MPN" of 90219-6051
Bike2, color teal, size 54cm, has property "MPN" of 90219-6054
Bike2, color teal, size 56cm, has property "MPN" of 90219-6056
Bike2, color black, size 44cm, has property "MPN" of 90219-6144
Bike2, color black, size 48cm, has property "MPN" of 90219-6148
Bike2, color black, size 51cm, has property "MPN" of 90219-6151
Bike2, color black, size 54cm, has property "MPN" of 90219-6154
Bike2, color black, size 56cm, has property "MPN" of 90219-6156

Results:

Initial load, no properties -> Correct
Choose Bike2, color teal, size 51cm -> MPN = 90219-6151 -> WRONG
Choose Bike2, color teal, size 51cm -> MPN = 90219-6144 -> WRONG
Choose Bike2, color black, size 44cm -> MPN = 90219-6156 -> WRONG
Choose Bike2, color black, size 48cm -> MPN = 90219-6156 -> WRONG
Choose Bike2, color black, size 51cm -> MPN = 90219-6156 -> WRONG
Choose Bike2, color black, size 54cm -> MPN = 90219-6156 -> WRONG
Choose Bike2, color black, size 56cm -> MPN = 90219-6156 -> OK but only by luck.

Post Reply