2 Dropdowns Dependend on each other - pimcore

How would I create 2 DropDown Fields in a Object which are dependend on each other in the Pimcore Admin Backend Object Editing Interface?
for example:
when DropdownA is USA
DropdownB should show all States of USA
when DropdownA is Germany
DropdownB should show all Bundesländer of Germany

For that you would need to develop a plugin which would provide a custom Object Field - which would in the end provide two dropdowns that are aware of each other. There is no clean solution to do what you want out of the box.
More information on plugin development:
https://www.pimcore.org/wiki/display/PIMCORE4/Plugin+Developer's+Guide

Related

Is there a simple example on how to add an entity extension for customers with field in the admin of shopware 6?

I want to add an entity extension to a customer in shopware 6. I was able to do so with the examples in the documentation of shopware on the PHP side and now I wonder how to display and modify this new "field" in the shopware 6 backend.
I searched a lot and also tried to find a simple plugin where I could get some inspiration from, but unfortunately I'm not able to find.
So again the question 😊 Is there any simple example on how to add an entity extension for customers with field in the admin of shopware 6? Or an example plugin, where I can see how it could be done?
What you're (likely) trying to achieve would be the combination of multiple separate tasks.
If you want to store data in the database you'd need a new custom entity
If you want to associate the new entity with the customer you'll need the entity extension
You'll need to add a new field in the administration
I've linked to examples respectively, but you'll probably need to take the time and invest in studying the documentation regardless.
I also created an example plugin that combines all these steps and adds a new entity with a height field as association to the customer and displays the field in the administration. You can find the repository here.
Not sure if you considered this, but depending on what you are trying to accomplish, the simplest way is probably adding a custom field (this can be done progamatically or even via the admin panel).
The drawback is, that those fields' values are stored as JSON and it has drawbacks when you try to search through them.

Shopware 6 - shopping experiences layout for search results

i'm using Shopware 6.3.0.1.
is there currently a possibility to assign a standard layout from the shopping experiences to the search results?
No, this is not possible by now. Everytime you create a new category in the administration it is created with no cmsPage selected at all.
Depending on the way you create the category there are ways to hook into the code and set one on creation as well. I assume an event subscriber listening for the creation of a category entry is a way to do it.
Currently shopware doesn't support cmsPages for the search result.
You can vote for this Feature Request:
https://issues.shopware.com/issues/NEXT-10403

Set a shopping world for a specific subshop

I am trying to set a shopping world for a specific subshop in a shopware installation. I have multiple subshops with different domains related to the same thing, in other words, I have for example, cheap-clothes.com, really-cheap-clothes.com, the-cheapest-clothes.com and they all display the same website, the domain is the only thing that change, so the categories are the same on every subshop.
That said, how is it possible to set a shopping world for a specific subshop?
Thanks in advance,
Daniel.
This is only possible when separating the category-trees. The display of shopping worlds is controlled by category assignment. You need to duplicate the categories and the product assignments in order to show a different content.
I would recommend developing your own plugin or a theme for each subshop where you can seapate the shopping worlds based on their ID.

Plugin: How do I set default value into an attribute depending business unit?

I have 3 business units (1 parent and 2 children), 3 users (for each business unit), 2 forms (for each business unit) and 1 plugin for the incident entity.
The incident plugin (create, pre-operation) is setting a default value in the attribute 'Case Origin' (caseorigincode) depending on user's business unit.
My problem is what if the user of the parent business unit creates an incident? how the plugin knows from which form that incident is created to set the default value?
What is the best approach to do that?
Thanks.
Unfortunately I don't think there is a way for the plugin to know which form was submitted. However, you could add a hidden field that gets set via javascript to something different for each form. Then, in the plugin you could query that field to see which form was used.
Be sure to check for null/empty as well, because the update could have been submitted programmatically without the use of a form.
IIRC all CRM entities (both stock and custom) should have a OwningBusinessUnit attribute which is an EntityReference to the Business Unit the record's Owner belongs to.
That should tell you exactly from which BU the record is being created.
(NOTE: The question is inconsistent, since it is stated that caseorigincode is set depending on the BU at first, then it asks about forms. I assume the first is the actual logic: check the BU to set the field)
(NOTE #2: This could be accomplished through a workflow aswell: Check Condition on Owner's BU and Update Record accordingly. Run on create.)
Given a user can only be a member of one business unit then you shouldn't need to worry about which form it was created in. Simply get the SystemUser from the EntityReference of the created by user and use the BusinessUnit EntityReference that provides you with.

Entities in Dynamics CRM 2011

So basically I am making a Jail Management System. The first part is where an inmate is booked and that session has 5 screens namely:
Booking Screen 1
Booking Screen 2
Booking Screen 3
Medical
Property
Commissary
I have created entities and forms for all of them. I want the functionality where i can move from the first booking screen to the rest by using like a "Next" button like we usually have in online forms over the internet. Can i achieve this?
or is there some way where I don't have to go to every entity and create a New record manually?
Regards
Depending on the number of fields you could use 5 tabs instead of pages. The last field of every tab could hold a javascript that opens the next tab and close the previous tab.
You can achieve this by creating a Dialog which will pass the values to Custom workflow activity(Written in c#). I have recently created a dialog for user registration.
Have a look at these link:
Link 2
Link 1
Link 3
Link 4
As Scorpion suggestion, you can use dialog if all of input fields were in the same entity. If you want to use the Wizard to collection fields which were held in different entities. Then you can make a custom web page(e.g. ASP.NET) to handle it.

Resources