Categories
Mastering Development

Session Cookie not sent for CORS requests in Safari

Summary: We are making a cross origin request. It works fine in Chrome and FF, but not in Safari. CORS is enabled in the server and response to pre-flight request is looking good. This is part of the response from server for pre-flight OPTIONS request. URI=/access-token/generate HTTP Headers=[Access-Control-Allow-Credentials:true Access-Control-Allow-Headers:origin, content-type, accept Access-Control-Allow-Methods:GET, POST, PUT, DELETE, […]

Categories
CMS Magento Mastering Development

Adding label to text field

How can I add a label to the custom field in the checkout page? I can’t seem to find a source for that. Assuming code is like what is in the Mageplaza sample <?php $customAttributeCode = ‘custom_field’; $customField = [ ‘component’ => ‘Magento_Ui/js/form/element/abstract’, ‘config’ => [ // customScope is used to group elements within a […]

Categories
CMS Magento Mastering Development

Add TEXTAREA to LayoutProcessor

Hi how do I add a TextArea in my Checkout Page? right now all I can find are ways to add a input field but is there a way to add a text area and not a text field? I’m planning to add a comment field to my checkout but I can’t find any solution. […]

Categories
CMS Magento Mastering Development

magento2 plugin and str_replace

In file module magento have function public function formatPrecision( $price, $precision, $options = [], $includeContainer = true, $addBrackets = false ) { if (!isset($options[‘precision’])) { $options[‘precision’] = $precision; } if ($includeContainer) { return ‘<span class="price">’ . ($addBrackets ? ‘[‘ : ”) . $this->formatTxt( $price, $options ) . ($addBrackets ? ‘]’ : ”) . ‘</span>’; } […]

Categories
CMS Magento Mastering Development

Custom Attribute not saving on Product

I’ve created two custom attributes, but when i create a simple product, just saves one attribute. Using postman,the request has both attributes fields, but the response just has one. Any help is appreciated. Color Attribute, this one works. "is_wysiwyg_enabled": false, "is_html_allowed_on_front": false, "used_for_sort_by": false, "is_filterable": true, "is_filterable_in_search": false, "is_used_in_grid": true, "is_visible_in_grid": false, "is_filterable_in_grid": true, "position": […]

Categories
Mastering Development

Insert json data into MySQL database with slashdb rest api

I’m not able to insert data into mysql database with slashdb rest. I receive a post request from my iot service with json data in the body message, post request canes from this erlang pice of code: Method = post, URL = "http://xxxxxxx/api/v2/sensor_sql/_table/s1", Header = [{"X-DreamFactory-Api-Key", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}], Type = "application/json", Body = MessageStr, HTTPOptions = […]

Categories
Mastering Development

Cross origin error when uploading a file to express server

So I use React to upload a file to my express server, doing this localy works however when I push the code to my nginx express server I keep on getting Cors errors. How would I be able to solve this problem, I currently user cors package ? app.use(cors({ “origin”: “*”, “methods”: “GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS”, “preflightContinue”: false, […]

Categories
Mastering Development

Vue CLI3:blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status [duplicate]

I use firebase as backend and Vue CLI3 as front end. I set up a GET request from an API (https://jisho.org/api/v1/search/words?keyword=apple), unfortunately, there is no status in response which caused the error below: :8080/dashboard:1 Access to XMLHttpRequest at ‘https://jisho.org/api/v1/search/words?keyword=apple’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access […]

Categories
Mastering Development

Interconnection of two dropdowns in plotly-dash

I have been trying to connect two dropdowns to each other i.e. If I select a value from one DropDown the path and the contents of the other DropDown should change accordingly. e.g I have a folder of dates (06-06-2020, 07-06-2020 and 08-06-2020) so if I select a date which is 07-06-2020 the DropDown below […]

Categories
CMS Mastering Development Wordpress

ACF Gallery with Isotope filters

I’m trying to achieve a filtreable gallery taking custom categories for every media attachment. I’m using the ACF plugin and Isotope. I managed to show the filter and to display each category to every image, but when clicking on the filter nothing happens. Here’s the markdown: <!–output categories assigned to each photo via Enhanced Media […]