Include Shopware 5 default contact form in a shopping world? - shopware

I have a shopping world which acts as the "contact" page and now I want to include the default contact form of Shopware 5.
Is there a way to do this with some file include function passing the form ID or any other way?

there are a number of plugins that enable this functionality: https://store.shopware.com/search?p=1&q=Einkaufswelt%20formular&shopwareVersion=5 .
When you want do it on your own, you have to create a own shopping world element and include the corresponding template file https://github.com/shopware/shopware/blob/5.7/themes/Frontend/Bare/frontend/forms/form-elements.tpl and and you have to reinitialize the javascript functionalities from the form.

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.

Customise Netsuite Site Builder Cart

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.

Liferay: Dynamically populate 'select' structure field

I am building a liferay theme, which has two columns side by side. The right column is where the web contents will be displayed.
My implementation aims to build a menu (left column) that gets the titles from the web content titles and builds hierarchy (parent, child) based on a 'select' structure field that I added to each web content.
So far I was able to build this system using
Liferay.Service('/journalarticle/get-articles'...)
and some javascript coding.
Now the 'select' fields i use in my structure have predefined hard coded options.
How can i populate dynamically this option list so that whoever is managing content will automatically have all titles from all web contents available to choose a 'parent' from? So far a developer has to update this option list each time there is a new web content added.
#chadct : AFAIK Liferay not provide this default functionality, this is not good practice to populate dynamically value in structure field. But you wanted to achieve that functionality, then there are 4 solution :
Add one text field in structure which contains articleId of your parent web content.
You can add related article for that web content and write some sort of code to get article which consider as a parent of that web content.
Create Select DOM options form template which hold the list of article according to groupId and render on web content view mode, then you can select parent content from there and update content expando with articleId of parent webcontent. Remember this contains AJAX post request. and only show that control who is admin or loggedin user or depends on Role. Refer AJAX post calling
Hook edit_structure.jsp and add your logic here as you want.
Note : last one is worst but also a solution, Remember you need to modify your current solution.

Create a list of pages in Orchard

Lets say for example, I have a list of products that each have it's own page... in what way can I create a single page that will list each product as it's contents as a list (with hyperlinks)? Not really sure how to do this directly in Orchard - or will I need to create a custom page / widget? Thanks for any help... new to Orchard and not sure how to tackle this.
You have a couple options. I believe the Orchard gallery at orchardproject.net has a module called Simple Commerce that may solve your problem. (it's simple so it might not)
(In the following section, I've tried to boldface the terminology words that are 1) are crucial to understanding how to use Orchard and 2) helpful in finding your way around the dashboard)
Another option may be first creating a Content Type--probably one named Product with some Fields describing an individual product. Price, SKU and description come to mind, but you'll be better able to describe your own products. Each Content Type in Orchard can be associated with any combination of Parts. You may have to research which ones you actually want for an individual product, but I'd recommend:
Body (this could replace the Description I suggested above) You could include any amount of HTML/script in this section to make your individual product pages look fancy!
Common (this has to be added when Containable is used)
Containable (this will allow the items to be listed)
Route (so you can link to a specific product)
This gives each product its own slug (URL)
Tags (to allow products to be categorized)
Now, you need to create a new List from the dashboard so you can display the products together (and inherit other features like pagination, etc). Be sure to select the Product Content Type in the Contains drop down list.
Then, you can start creating your Content (your Products) one by one. In the dashboard, click the new Product item and describe each new piece of Content.
Finally, you can link directly to this new List using the Products List's *slug*. You could (and might want to) add the Products List to your main navigation menu. Clicking the Products List and checking the "Show on main menu" box will automagically add a navigation button directly to this page. You could, of course, link to this List from anywhere using the slug (also found on the list's edit page)
This page, from the Orchard documentation pages describes more things you can do with a list of content like modifying the layout of the list, placing content fields in different places and even converting your products to widgets which you could use to display some promotional product offering in a special spot on your site.
I highly recommend reading through at least the documentation provided on the Orchard site to get a good grasp of what this CMS can do out of the box and what you would need to write custom code to accomplish (which you could do in this case, but Orchard can handle it out of the box)
Hope this helps!
Two ways to do this:
http://orchardproject.net/docs/Creating-lists.ashx and http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.Taxonomies

How to Hide Field Based on Current User Role in Sharepoint?

I have column Status (0= Default, 1=Accepted, 2=Rejected), when first creating this list
I want to hidden this field and filling it with default value (0).
On edit form, I want to hide this column from updating if user role is not HelpDesk.
Thx
For your first requirement, you could use SPUtility.js (full disclosure this is a library I maintain). You would basically put some JavaScript in a Content Editor Web Part on your NewForm.aspx page:
SPUtility.GetSPField('Status').Hide();
If you want to change the value (if you don't have a default specified in your list settings) then you could do:
SPUtility.GetSPField('Status').SetValue('Default').Hide();
The second requirement is a bit tougher. You don't really specify how the user gets a role of "HelpDesk" (profile property? SharePoint group?). Depending on how it is setup, you may be able to use an AJAX call to the SharePoint webservices to check their security. Or you could write a custom webpart that validates their role and then emits some JavaScript.
Use Infowise Smart List Lite, the free version of our Smart List Pro product. Your requirement is just one of its many features.

Resources