Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
Fields in product form in the admin, how could I edit, add and inherit?

it's a continuation from this question. I am still learning my way around Shopware, I have pretty much the same file structure in my files.

I want add 3 fields to the product form in the admin, and so far I have created the table and the extra column on the product table (although not sure if I really need this). When I hardcode, it saves string into my new table, the entity seems to be read and when I search the repo I get the correct extension extension:

return this.extensionRepository.search(this.extensionCriteria)
            .then((extension) => {
                console.log(extension);
            });

But I don't really understand how I can save the value and read it out as when I get the extension with a value, I can't place the value in the input field and when I save it doesn't as I get this error TypeError: e.getEntityName is not a function, which I guess is coming from the sw-inherit.wrapper/index.js file.

I would like to use the fields in the deliverability section of the product page in the admin. Basically replace 3 of the inputs with floats, as the shop will sell fabrics and this comes in metres like 0.2 metres.

So my twig template would look like this:

{% block sw_product_deliverability_form_min_purchase_field %}
<sw-inherit-wrapper
    v-if="showModeSetting"
    v-model="extension.customMinPurchase"
    class="sw-product-deliverability__min-purchase"
    :has-parent="!!parentProduct.id"
    :inherited-value="extension.customMinPurchase"
>
    <template #content="props">

        <sw-field
            type="number"
            :map-inheritance="props"
            number-type="float"
            :min="0"
            :error="productMinPurchaseError"
            :label="$tc('sw-product.settingsForm.labelMinPurchase')"
            :placeholder="$tc('sw-product.settingsForm.placeholderMinPurchase')"
            :disabled="props.isInherited || !allowEdit"
            :value="props.currentValue"
            @change="props.updateCurrentValue"
        />

    </template>
</sw-inherit-wrapper>

{% endblock %}

but I am confused, and I don't know what I am looking for or how to identify what I am missing. I would appreciate any suggestions or advice.

If I haven't been clear, sorry, as I seem to not really understand the problem properly and definitely not Vue nor Shopware proficient, but want to learn. Thanks

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Maybe you are looking for "Custom fields" in Shopware, this feature allows you to attach custom fields to entities.

Docs: https://developer.shopware.com/docs/guides/plugins/plugins/framework/custom-field/add-custom-field

Look at: "Add custom fields to an entity"

If you check the ProductEntity class, you can see the trait being used: use EntityCustomFieldsTrait;

If you add the configuration explained in the docs, the custom fields you are adding will be editable in the administration.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!