Magento 2 API Order Export Product Custom Options - magento

I have different individual attributes for some items as radio selection.
Is there a possibility to display the actual value instead of the ID? I mean the value is called "print_value" when i call "/rest/V1/orders/14076" or soap api
API EXPORT
I tried to write a plugin on Magento\Sales\Api\OrderRepositoryInterface and swap the value of option_value with print_value there.
However, the final output remains the same.

Related

Using ajax in prestashop custom module, retrieve data from an input field date to a module's FrontController for exploitation and SQL query afterwards

I need your help to understand how to retrieve the data from the product page form (product.tpl) sent by the 'add to cart' button (product-add-to-cart.tpl include).
Indeed, I would like to retrieve the value of a datepicker field, added under the entry dedicated to the quantity of the product page,
in order to save it in the ps_cart_product table.
Despite my research in the cart class and its controller, I can't do it. How to retrieve the value of an entry in the home page of a product?
A null date (0000-00-00) is however well recorded in our new columns date_retrait in ps_cart_product, we manage to recover it as you can see on a screen, but not to record it correctly.
Where can I call $_POST or REQUEST from the input datepicker name = date_retrait
(here it is 2022-07-24 but this is only a test, modified directly in the DB, normally it displays 0000-00-00)
I understood that I had to use Ajax (mymodule\/controller\/front\/ajax.php)
But I don't understand all the steps, what should I add/modify and especially: where (which files with path)?
[product_tpl][1]
[cart_popup][2]
[add to cart][3]
[ps_shoppingcart_js][4]
[1]: https://i.stack.imgur.com/MwLPS.png
[2]: https://i.stack.imgur.com/LjpMe.png
[3]: https://i.stack.imgur.com/3P4Y2.png
[4]: https://i.stack.imgur.com/z0eb4.png

Slack Dialog external data source filtering

I have a Slack dialog that has two SELECTs and both are pulling data from an external data source. However, the available options of the second SELECT are entirely depending on the selected value of the first SELECT. Is it possible that slack can somehow pass the selected value of the first SELECT to the payload of the second SELECT's request?
I can't seem to find a way to do it.
Thanks!
Assuming you are doing this within a modal view, there are two ways to approach the problem:
Approach 1: stick to 1 view and update it*:
The user picks from list 1.
This triggers a block action payload to your app which gives you access to their choice.
You can then update the view with new input blocks for list 2 that you've set up correctly.
The catch here is that list 1 can not be an input block, but rather an action. It will not be part of the final payload of the form.
Approach 2: split into 2 different views*:
The user picks from list 1.
The user submits view 1
You handle the view_submission event by pushing a new view with the appropriate list 2

Joomla Component Dynamic Custom Field based on other Field Value

I am creating a new Joomla Component. I am able to create custom fields for the component backend forms - but I am not able to create Dynamic Custom Fields.
What I would like to do is have a field that is dynamical populated based on the value of a previous field. The easiest way to explain this is the simple country,state,city breakdown.
Field 1 = Country
Field 2 = State (Based on what the user selected as as Country in Field 1)
Field 3 = City (Based on what the user selected as State in Field 2)
The fields would of course need to be refreshed, reset as the user picks a different country etc.
The data to populate the fields would also all need to come from a database based on the previous fields value.
I am guessing this needs to be done via ajax or javascript or something? But wondering if there is an official way? Especially since there are database calls involved.
Please let me know if there is anything I can explain better..
David
I ended up just creating text fields but then validating the input to make sure the values added are correct.

Can we prepopulate the webform fields with values in webforms for marketers?

We have a requirement to pre-populate the Contact Form with user information on load if the user is a logged in user. So that, user need not fill his information using the webform.
Is there any way to do this using webforms for marketers?
Data is coming from a service api in json format. Need to figure out a way to bind it to fields either in server side or in client side.
Sitecore Version 7.1 140117 WFFM Version "Web Forms for Marketers
2.4.0 rev. 140117"
Have a look at Sitecore - Webforms For Marketers Form - Use ReadQueryString Option. Basically, there is a checkbox, ReadQueryString, in presentation details that gives you the option to fill in the default values from the query string. If checked, you use the item names of the fields (not the display name or title) as keys and the values you want to set the fields to as the values in key-value pair in the querystring.
Create a new rule based on use default value from user profile [fieldname] field and amend it to pick up the value from your service API.
This will be your best way and simplest option in my opinion.
I use this same approach prepopulating ucommerce data from its API.
Create custom field and then you can pre-populate values as per your need.
Like if you want to populate any value in Single line text field the create custom field for this and then reflect forms dll and copy code then update code as per your need.
Please check https://sitecoretweaks.wordpress.com/2015/02/20/custom-field-type-for-sitecore-web-form-for-marketers/ blog post for more details.

MS CRM Save + Copy as new (Custom Entity)

I have a custom entity in Microsoft CRM (4.0). The user has to input records however usually they have a batch of 20+ records that are almost the same apart from 2 or 3 fields which need changing. I know I need to write some custom code to enable this functionally. However can anyone recommend any methods to do this.
Ideally there should be a button that will save and create a copy as a new entity.
My Current way of thinking is to pass all the details as part of the URL and use javascript to strip them out on the page load event. Any ideas welcome.
Thanks
Luke
I found the answer here:
http://mscrm4ever.blogspot.com/2008/06/cloning-entity-using-javascript.html
I've used it and it appears to work well.
Since there are numerous fields, but only certain fields values are different, then i am thinking to set the default value to all the fields, so that users just need to alter those values when needed.
In my approach, i will hook a javascript function on load of the form data entry screen and use XmlHttp approach/Ajax approach to hook to the custom web service to pull/retrieve the default values of each fields. Or you can set those values at the javascript function itself, but the drawback of this, it's difficult to customize later. So i will choose the approach to hook to the custom web service and retrieve those value from some application parameter entity.
Your idea of providing a "clone" button is also a great idea, which means that it will duplicate all the attributes of the previous record, into a new record, so that it will save time for data entry person to customize the different value
EDIT
Since you would enter records in batch mode, how about customizing .ASPX screen to enter records. By customizing through .ASPX screen, you can use a tab , so that users can browse through tabs, to customize the value/attribute of each record.
There will be a "save" button as well as "clone" button to clone some common attribute or value.
I would create a custom web service that would accept the entity type and the ID of the record I'm cloning. Your "Save and Clone" button would call the service, and the service would handle the details of retrieving the current record and deciding which fields to set on the new record. The service creates the record, and sends the Guid of the record back to your button, which then opens up the newly created record.
This way, you avoid the messiness of setting/getting values in JavaScript and tying which fields to set/retrieve directly to your OnLoads, as well as avoiding the possibility of query string that's too long.
The service could easily be sufficiently generalized so that all you'd have to do is add your button to any entity, and it would work, assuming you'd set up your service to handle that particular entity.
One possible downside is that since the clone record button would actually create the record, the user would be forced to delete the cloned record if they decided they didn't want to clone the record after all.

Resources