Giter Site home page Giter Site logo

Comments (4)

pixelmatseriks avatar pixelmatseriks commented on June 16, 2024 1

Hi,

By default no attributes are returned in product list mode, but it is possible to add additional fields and attributes to return in XHR result for product list.
Note, if an additional attribute is added to the product list, all attributes on each product is mapped to the product since the attribute_value field will be added to product attributes. This can have a big impact on the performance if installation contains many products and attributes.

See:
https://docs.typo3.org/p/pixelant/pxa-product-manager/main/en-us/Configuration/Index.html#settings-listview-additionalattributes

Also note that by default the "card" partial is used in both "vue" and "extbase" mode, so some special condition might be needed to make the cards work in both "vue" and "extbase" mode.

An alternative that doesn't impact the performance like attributes might do is to extend the product model and then include additional fields to the XHR result for product list.

See:
https://docs.typo3.org/p/pixelant/pxa-product-manager/main/en-us/Configuration/Index.html#settings-listview-additionalfields
and
https://docs.typo3.org/p/pixelant/pxa-product-manager/main/en-us/Developers/ModelExtender/Index.html

from pxa_product_manager.

pixelmatseriks avatar pixelmatseriks commented on June 16, 2024 1

A way to see what data that is returned to the product list is by checking the network and the Fetch/XHR result (type 1606131593). There is no "attribue_value" key in the "list" result, so it should look something like: product.xxx1.label and product.xxx1.data, but the data can look different depending on the type of the fetched attribute, e.g. an array.

from pxa_product_manager.

nasiri avatar nasiri commented on June 16, 2024

While we don't have a lot of products, the first example is the preferred one.

Shouldnt this code work then?

plugin.tx_pxaproductmanager.settings.listView.additionalAttributes = xxx1, xxx2
plugin.tx_pxaproductmanager.settings.listView.includeEmptyAdditionalAttributes = xxx1, xxx2

Inside partial/cards then added following:

<f:section name="productName"> <f:if condition="!{product}"> <f:then> <div class="item-title"> <span class="product-item-text product-item-title" v-text="product.name"></span>{product.attribute_value.xxx1} </div> </f:then> <f:else> <div class="item-title"> <span class="product-item-text product-item-title">{product.name}</span> </div> </f:else> </f:if> </f:section>

Still no Attribute xxx1 inside of the Listview.
Is {product.attribute_value.xxx1} or {product.attribute.value.xxx1} right?

Regards and thanks in advance.

from pxa_product_manager.

nasiri avatar nasiri commented on June 16, 2024

Thx. Now at least it works for the non-array attribute. ;)
Fetching the XHR Result helped too.

Any solution, how to iterate, if the data is in an array. i am not found of how to render/itterate any vue mode version array.

For Attribute with Option Array (rendering the whole array as a string works thou, itterating doesn't):

{ "pid": 84, "title": "xxx2", "uid": 2, "value": "xxx2" }

I cant even adress the first attribute xxx1 (no array) without the Viewhelper "v-text" in Partial/Cards Fluid Template (I assume it's the same reason i can't itterate):

<span class="product-item-text product-item-title" v-text="product.xxx1.data"></span> works

{product.xxx1.data} isn't

from pxa_product_manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.