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
Related
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.
What event do I use best to hide a product from customer?
I would like to show some products only to a customer group. Normal users should not be able to see them.
I would start with subscribing the
ProductListingCriteriaEvent
this at least should allow you do filter out the products you want to hide for product listings.
I believe this still would allow to show the detail pages, so you also should hook into
ProductPageLoadedEvent
and make your customer group checks.
Last but not least, you will probably run into caching problems, i.e. the page would be cached for the normal users, and the specific customer group would get the cached results, which still do not include "their" products.
We ran into that here: Shopware 6: Changing URL parameters returns the same result in prod mode
The solution for this would probably to subscribe to the ProductListingRouteCacheKeyEvent
$event->addPart((string)($currentCustomerGroup ? 'null'));
Also you might need to take care of hiding from the search.
This problem seems to be already solved with a paid plugin (https://store.shopware.com/en/acris84338660411/block-products-for-customer-groups.html) - but in case you implement it on your own, it would be cool if you publish your solution on GitHub :-)
This seems to be available in future Shopware 6 versions as "Dynamic access" feature.
So I've been tasked with getting a custom item field value displayed on an item in the cart of a site-builder site.
I have experience with SCA but not so much when it comes to site builder. I can see how templates are put together and how to display data in these templates.
I can also tell that it is possible to add or remove field sets from the cart in the 'Set Up Website' tab.
Another thing to note is that the Live Hosting Files are empty.. which is where I would have expected to find the scripts that would create the cart.
So my question is, how do I either create a new row in the 'Set Up Website => Cart' tab to display this new custom field. Or where can I find and edit the template/script that creates the cart?
Any help is appreciated!
Is this the old SiteBuilder Cart or from the new SiteBuilder Extensions? If so, which version? The old, original SiteBuilder Cart is really difficult to add customizations such as a custom field. I would do it by running an AJAX call on a SuiteScript to get the needed data that write it into the cart cell. It was a hack but at least I was able to customize it.
The SB Extensions work a lot like SCA, and it what to do depends upon the version. If it is only for the cart, then just extend Item Keys Mapping and then it will be available on the template file. If you also need it on the cart summary in the checkout then, see SuiteAnswers for the specifics for the various versions.
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.
Is there possible to do quick search by related entity fields?
In example, if we have Contact lookup field on Lead entity. Can we search Leads by Contact's email address or address name?
Can you refer me to some tutorials.
I know that this is possible by using 'Advance find' option.
Thanks in advance.
Sadly, it's not possible to natively configure quick search to set attributes on related entities as "find columns".
As you might be aware, the native solution would be to find contacts by email address then open their record to look at their Leads.
The only other solution I can imagine would be to embed a custom Silverlight or ASPX page behind a navigation or ribbon button. In this case you could execute your own logic for searching but would not get the rich functionality of the native CRM grid without a lot of work.