Questions tagged [script]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

What should I have to do for these error logs

While checking I found these error logs. Anyone can help me what should I have to do please? Here's the error logs: https://onetimesecret.com/secret/l242h8z8w7r84fkuf3dc09vd2clbns3
Sufyan Ahmed's user avatar
0 votes
0 answers
77 views

Magento 2 - Add attribute to script added with "text/x-magento-init"

Magento adds this google analytics script: vendor/magento/module-google-analytics/view/frontend/web/js/google-analytics.js It is getting initialised / loaded here: vendor/magento/module-google-...
Black's user avatar
  • 3,003
0 votes
0 answers
124 views

Clicking a button scrolls to the top of the page after revealing the hubspot form

Please see the image below as it helps understand what the issue is. When the complete form cta button is clicked, it scrolls up to the top of the page after revealing the form instead of stopping at ...
CodeForGood's user avatar
0 votes
0 answers
17 views

Can you configure cron jobs to run custom script on server?

I have written some custom scripts in typescript that I would like for my Magento2 application to regularly run. Ideally, I would like for my application to run these scripts once a day. Does anyone ...
Slippy's user avatar
  • 1
0 votes
0 answers
63 views

Easiest way of adding a script to the order confirmation page in Magento 2

I have received a tracking pixel from one of our advertising company, and they asked me to place that code in my order confirmation page in Magento 2. where is the order confirmation file located in ...
Feroze Ahmed's user avatar
0 votes
1 answer
324 views

Scripts and Stylesheets wont accept script?

Magento 2.3.3 I am inserting a script into the scripts and stylesheet section of my shop. As soon as there is a <script>...</script>, it wont add it. If I add the script without the ...
user4095519's user avatar
1 vote
0 answers
520 views

How to create a script to export each product with all images, names, SKUs, dimensions as a CSV programmatically in Magento 2?

**This is a working code** **You Create a file path as i.e. http://localhost/magento241/exportproduct.php** <?php use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\...
Vikram Dhande's user avatar
0 votes
1 answer
508 views

magento 2: Add custom <script> tag in <head> section, only for specific CMS page

I have a CMS page in Magento 2, for which I want to add <script> tag that will be included in the <head> section of this page only. I do not want this <script> tag to appear on any ...
Kade's user avatar
  • 1
0 votes
1 answer
5k views

How to add custom js script on the <head> tag in magento2

Hi here am trying to add a js script to the <head> tag, methods used Content => Design => Configuration, Now click on the edit link of the current theme and Go to the HTML Head tab and ...
Praveen Negimani's user avatar
0 votes
1 answer
73 views

Detect IE11 browser and show cms block modal with phtml script tag

I have a modal that pops up when the site detects it's on IE11. The modal is in a cms block so that the client can edit it. I have created a reference container with a custom phtml and put the script ...
totneschap's user avatar
1 vote
0 answers
27 views

Magento 2 - Load data from store instead of hardcoding

I am creating a new tag programmatically and append it to the DOM. Currently I hardcoded the phone number, because I don't know exactly how I can load it from the store by using javascript. This is my ...
Black's user avatar
  • 3,003
1 vote
1 answer
410 views

How to include YouTube iframe API in Magento 2 layout template?

I'm using Magento v2.4.1 and i want to show a youtube video on my storefront home page and control it using youtube iframe API in .phtml file, how can I correctly load this youtube iframe API in my ....
Padawan's user avatar
  • 135
0 votes
1 answer
22 views

URL key for specified store already exists while importing products through custom script

I have some of the products already added in magento admin. And now i am trying to create same name product with the use of script that time i am facing error "URL key for specified store already ...
ZealousWeb's user avatar
  • 2,146
0 votes
0 answers
108 views

Strange error - custom module template calling by using {{block class="" name="" template="" }} not working

I am trying to call 3 the script on my cms page pagebuilder, The thing is, first one only return the value, but i individually tested each values is working, if add at the same time three values first ...
zus's user avatar
  • 145
0 votes
1 answer
105 views

{{block class="" name="" template="" }} - Get phtml template script partially working on CMS page

If i using sinlge script in cms pahe it is working, {{block class="Amasty\Storelocator\Block\Location" name="location.block.home" template="Zero_Storelocator::home-page-...
zus's user avatar
  • 145
2 votes
1 answer
473 views

How to handle dynamic data in a script tag in head section for every page

I am absolutely new to Magento 2 (1 week in). I am trying to develop a Magento module that lets the admin specify a string (token) and when the admin saves the module I would like the token to ...
artuzai's user avatar
  • 23
0 votes
4 answers
358 views

Magento 2 - How does require know where jquery is defined?

You can use jquery in phtml like this: require([ 'jquery' ],function($) { $(document).ready(function() { /* Your logic */ }); }); But how does the require know where to find ...
Black's user avatar
  • 3,003
0 votes
1 answer
2k views

How to create a script to export all products images in csv programmatically in Magento 2

Magento2 how to developed custom script export for list of all product images with associated sku, Alt-Text, Image path,Image size please if anyone creates the script to share with me as soon as ...
Arun Sharma's user avatar
  • 1,151
0 votes
1 answer
186 views

How to include image path in script

My script : <script> require(['jquery'], function($){ jQuery.ajax({ url: '<?php echo $this->getUrl('customwishlist/index/wishlist') ?>', method: 'get', dataType: 'json', success: ...
zus's user avatar
  • 145
0 votes
1 answer
205 views

How to create magento 2 admin user from the root external script?

I want to create admin user from the root directory Is it possible? How can I create a new admin user without CLI (SSH) and database?
HIren Kadivar's user avatar
0 votes
2 answers
473 views

How to add cookiebot Cookie Declaration in Magento 2.4.0

How to add cookiebot Cookie Declaration in Magento 2.4.0 <script id="CookieDeclaration" src="https://consent.cookiebot.com/00000000-0000-0000-0000-000000000000/cd.js" type="...
Ravindrasinh Zala's user avatar
0 votes
1 answer
48 views

how to setup cronjob in magento 1.9.3

I am trying to set a cronjob for export order to another website in Magento 1.9.3 please, anyone, have an idea then plz share it with me.
Deep Shah's user avatar
  • 541
1 vote
2 answers
475 views

Adding Custom Option For Multiple Products at once . Magento 2

I have an category of Watches and in this category there is more then 2500 Products now I want to add Custom Option on each Product for that I was following This link so when I write script for it. it ...
Asad Khan's user avatar
  • 1,466
0 votes
0 answers
226 views

How to execute php file from magento admin in Magento 2?

I have created a php file on root folder of magento in Magento 2 and hit a controller on that file. That process is done and i have tested it it running on terminal. How would i run that script from ...
Prits's user avatar
  • 626
1 vote
0 answers
10 views

Magento 1 fetch Order items which has blank/zero product id/price/sku from last one day

Any idea how to create shell script which fetch order items which has blank/zero product id/price/sku from last one day in Magento 1 ?
Hamendra Sunthwal's user avatar
0 votes
1 answer
90 views

custom script (leaflet) in Contact page

I added Leaflet map to contact page like here: Can't add custom script (leaflet) to Contact page I used the solution with success. If you want to put it into an extension (not just in a theme): ...
lhd-s's user avatar
  • 11
0 votes
1 answer
219 views

Magento 2.3.5 script to change attribute set groups name

We have a lot of attribute sets in our store 100+. And by default the general group name inside a attribute set is called "Product Details" we want to change/translate this text. We already ...
JGeer's user avatar
  • 1,446
0 votes
1 answer
41 views

Where is the js script written for selection of attributes in magento 2

I am unable to find one ajax script . Can any body tell me where is the script written for this page https://prnt.sc/szvwqu On selection of attributes , how the price gets changed ? where can i find ...
Nafsss's user avatar
  • 720
1 vote
3 answers
2k views

Exclude particular <script> tag moving to bottom of the page- Magento 2.3

In my Magento site, we found there was configuration in admin. Admin -> Store -> Configuration -> Advanced -> Developer (Enabled only on Developer mode). JavaScript settings -> Move JS code to the ...
Shajitha Banu's user avatar
0 votes
2 answers
269 views

How to migrate from Shopify to Magento 2?

I'm having many clients migrating from Shopify to Magento 2, and the data migration usually happens via ERP, but for some clients, it's not possible. How could I import to my Magento 2 the Shopify ...
Rafael Corrêa Gomes's user avatar
0 votes
2 answers
298 views

script error composer.json

I want to add 3rd party module from artifacts in my project. required all modules with composer but when I run composer update at the end I have following error Fatal error: Uncaught LogicException: ...
Giga Todadze's user avatar
0 votes
1 answer
69 views

Script only loading directly after clearing the cache, but cant get found after second reload

I am using the extension Aheadworks_Wbtab. I don't know whats going on. If I flush the cache and reload then the slider shows and works fine. But if I reload again, then the slider dissapears and I ...
Black's user avatar
  • 3,003
0 votes
1 answer
66 views

Javascript file wont work

I have a LAMP server running in a VM, which is currently running fine. Now I would like to have a button on the /magento page that toggles a div container for me. I tried different approaches and I ...
Jackridder's user avatar
0 votes
2 answers
489 views

How to run magento 2.3 scripts through cron

I have made one script (addproducts.php) in my Magento root folder for adding products programmatically. For now, I am hitting this script in URL as localhost/addproducts.php. What should I do to ...
Nafsss's user avatar
  • 720
2 votes
1 answer
1k views

Element 'script', attribute 'crossorigin': The attribute 'crossorigin' is not allowed

After installing customer attribute extension from Bsscommerce they added another addon module. It then broke frontend of site so they disabled all of their modules but the error still persists. I've ...
Sahus Pilwal's user avatar
2 votes
1 answer
252 views

How do I execute Magento 2 CLI commands using a custom script?

I had created a custom script which update my database. After completion of database update, I want to execute the Magento CLI commands by adding custom functions in my custom script. The script ...
IntraPersonalLearner's user avatar
3 votes
2 answers
2k views

How do I get connection to database by entering Database details in Magento 2?

I want to get custom database connection by adding database details in my custom script without using ResourceConnection. In Magento 1 we can do like this $conn = new \mysqli($servername, $username, ...
IntraPersonalLearner's user avatar
0 votes
1 answer
632 views

How to send email in Magento 2 programmatically without creating custom module?

I need to create a custom script which allows me to send a simple test email with email addresses of Sender, Receiver CC Bcc; Subject line and Body of Email. How could I do this in Magento 2.x? ----- ...
IntraPersonalLearner's user avatar
1 vote
1 answer
528 views

Magento 1.9 - How to include custom PHP Script into .PHTML file

My magento tracking page: Back-end magento code : How can i add my PHP script into this tracking page. Tracking page code - trackorder.phtml [https://i.stack.imgur.com/ySgMA.png] <?php ...
zus's user avatar
  • 145
1 vote
1 answer
28 views

Magento 1 php script product in stock sent email

I would like a php script that when specific products, which I define, have a qty of higher than 0. I automatically receive an e-mail from this. Anyone have an idea how I can easily make a script out ...
JGeer's user avatar
  • 1,446
0 votes
2 answers
353 views

How to export all product sku and cateogry id in csv format runing custom script?

I am using Magneto2.3.1 and i need to export all product sku and cateogry id in csv format runing custom script?if anyone know and idea share code please
Rv Singh's user avatar
  • 1,607
0 votes
1 answer
204 views

How to refresh the cache programatically in magento 1 EE

What is the code for clean or refresh the cache programmatically because I have got lots of snippets but all are not working in Magento 1 enterprise edition. Does anyone know how to solve it? Thanks ...
Naresh Prajapati's user avatar
1 vote
1 answer
292 views

I have many spam customer in Magento 1.9 so how can i remove?

Guy's I have a Magento 1.9 site and some days ago I check my admin side so found lot's of spam customer so I can add google Recaptcha at that time. But it already has many customers are in site so ...
Rohit Gohel's user avatar
1 vote
1 answer
823 views

Uncaught Error: Script error for: tinymce in Magento 2 Admin backend

I am facing this error in the admin panel. Due to this error my admin panel menus such as order, customers are not loading. It loading forever. Kindly help me to solve this issue. Uncaught Error: ...
Kowsigan Atsayam's user avatar
1 vote
3 answers
2k views

Attempting to pass access keys into composer create-project for automated install

I am writing a shell script in bash (rewriting) that migrates / deploys our magento2 marketplace. I started off by getting the latest release from github, but that makes it so i cannot use the admin-...
CarComp's user avatar
  • 1,216
0 votes
1 answer
300 views

Create a script to update the SKU and set SKU using CSV

How To Create a script For Update Product SKU Using Custom Script.
Divya 's user avatar
  • 392
0 votes
1 answer
225 views

Create the SQL script for the changing the instance_type parameter in the database widgets_instances magento 2

I have to change like this Magento\Cms\Block\Widget\Block to Custom\General\Block\Widget\Block. I am using the Replace function in the SQL , But it is not working.
Divya 's user avatar
  • 392
2 votes
2 answers
117 views

How to securely run PHP scripts in Magento 2

I know that we can run php scripts by placing our script in root of magento 2 folder and we can load products, orders etc via object manager and perform our desired functionality. although this method ...
Joey Leblanc's user avatar
1 vote
1 answer
724 views

how to create a cron to execute a script every 1 min magento 2

I have created a script that deletes duplicated option for custom attribute because this attribute product will generate duplicated value after every save or edit of the product so how to proceed to ...
Developper Magento 's user avatar
0 votes
1 answer
202 views

How to do a dry run in root folder? [closed]

Is there way to do a dry run within your root folder to make sure the line of code works
joe willmott's user avatar