Questions tagged [code]
The code tag has no usage guidance.
131
questions
0
votes
1
answer
20
views
Magento 2: Show Image by its Role
I want to create a custom image role and assign it to product. Only those products image will be shown on category page having that custom role.
0
votes
0
answers
17
views
how to get values saved in db in one row seperated by commas as individual values?
Customer blocker→ email text field in system configuration , comma separated , then these emails will be restricted to show frontend , must be redirected to custom cms page 'You're restricted to view'
0
votes
1
answer
21
views
How to generate custom log file in magento 2?
I have tried generating custom log file using helper and logger but the file did not generate.
0
votes
0
answers
9
views
I want to create a new tab in customer dashboard and save its data in a table
I want to form a customer tab in customer dashboard.
When click on tab show custom tab having field customer name and save
data in custom table.
0
votes
0
answers
11
views
how to show product quantity in dropdwon on configurable products?
My product quantity is showing in a dropdown but only on simple products.
I want to do the same on configurable products.
1
vote
1
answer
20
views
I wanto to make the qunatity of products in a dropdown
My qunatity/Qty on Product page i simple a text field.
I want to change it into a drop-down.
1
vote
2
answers
28
views
how to add cms block in magento without using our own theme and in app/code?
How to Add CMS Block in Magento2 programatically.
I want to add a cms block in app/code insstead of app/design using layout or xml files.
0
votes
1
answer
32
views
What is the coding standard for extension development for Magento OS and Magento Ecommerce
Extension development coding standard for Magento OS and Magento Commerce?
0
votes
0
answers
50
views
Install MFTF Automation testing in Magento Version 2.4
I am trying to install MFTF automation testing in Magento's latest version 2.4. I am following the Magento basic documentation. In the Magento root directory, I run the command vendor/bin/mftf build: ...
0
votes
2
answers
69
views
How do I make a pdf link within website open in a new window?
Is there an easy way to set a pdf link (link to a file within the website) open in a new window?
I am sure this must be something to do with the code, but it is the first time I have been asked to do ...
0
votes
0
answers
27
views
Where do I find the exact 'carrier_code' I need to send to Magento2 to add my shipment through API
I want to add using the /rest/V1/shipment/track API. My shipment. We work with 3 shippers:
DHL
UPS
PostNL.
Now I need to know the carrier_code in order to add the correct information for the tracking ...
0
votes
0
answers
16
views
Mageplaza Controller Sample doesn't display Phtml message
I followed the example from below link but the message "Welcome to MagePlaza.com" doesn't display.
https://www.mageplaza.com/magento-2-module-development/how-to-create-controllers-magento-2....
0
votes
0
answers
56
views
in-store delivery method is still not displayed
I have followed all the steps in the guideline URL "https://docs.magento.com/user-guide/shipping/shipping-in-store-delivery.html" but the in-store delivery method is still not displayed in ...
0
votes
0
answers
81
views
How to debug that my all error message is not showing in Magento 2?
I have a Magento 2 Store.
So i when i try to login with wrong cred. it just doesn't show me error its just reload the page like this.
i have switched the theme but there is still the same issue on ...
2
votes
0
answers
160
views
Add Product Name to Advanced Pricing Export
I'm attempting to add the "Product Name" attribute export the Advanced Price List in Magento 2.3.4 but I cannot seem to get it to work.
I am attempting to modify the AdvancedPricing.php ...
0
votes
0
answers
13
views
My code is this and there is no space at starting but still i am getting Fatal error what can I do please tell me?
<?php
namespace Magento\Framework\View\Element\Template\File;
use \Magento\Framework\App\Filesystem\DirectoryList;
use \Magento\Framework\Component\ComponentRegistrar;
use \Magento\Framework\...
0
votes
1
answer
451
views
Short array syntax must be used to define arrays Use ::class notation instead
I had things like that
90 | WARNING | [ ] Use ::class notation instead.
92 | WARNING | [x] Short array syntax must be used to define arrays
94 | WARNING | [ ] Use ::class notation instead.
96 |...
0
votes
1
answer
23
views
Static Block Incorrect size
I am very much a novice when it comes to magento. I've self taught myself in areas i can. Long story short a web designer who was all the talk and not much of the walk designed a website for our store ...
2
votes
0
answers
35
views
How to add a text on Homepage using module (code) [closed]
Need help writing a code for adding text on Homepage.
I'm running Magento 2 on localhost
2
votes
1
answer
90
views
Add a block to programmatically generated widget
I need to generate a widget block with upgradeData.php and assign a block to this widget how can I do this?
Folowing is my code for widget generation:
Setup/UpgradeData.php
public function ...
0
votes
1
answer
305
views
When to use app/code vs app/design
I saw two topics about that but I'm still not sure.
I'm discovering Magento 2, I'm a frontend developer and right now, I just want to make my company website's header and footer (html, css) (so a ...
1
vote
0
answers
84
views
Magento2 Mageplaza LayeredNavigation multiselect filter with AND condition [closed]
I am working on a project which uses Mageplaza Layered Navigation. I need to change the behavior of multiselect from OR to AND.
As an example, I create attribute color. When I search for red and ...
0
votes
1
answer
31
views
Need code of edited things through admin panel
How we can get the code of edited pages through the admin panel?
5
votes
2
answers
656
views
Argument replacement not working for type object
I am trying to replace an object using Argument Replacement but unfortunately I am unable to do so for type:object.
Every time I am getting error:
1 exception(s):
Exception #0 (Magento\Framework\...
0
votes
1
answer
577
views
URGENT! Magento2 error The website with code default that was requested wasn't found
My website meets a problem. It shows error:
"0":"The website with code default that was requested wasn't found. Verify the website and try again.","1":"
I've check ...
0
votes
1
answer
64
views
Custom php code in magento not working / magento block path wrong
i am new to magento & using magento 2 . I have to run a php code in my cms page . When i check the website i can understand that the theme is Alothemes Bencher6 . So what i did is
app/design/...
1
vote
1
answer
80
views
Magento 2: How to Improve Code In Magento (PHP)?
I'm new to Magento just, I'm working on an event I call many files through object manager, but I know that's not a good way, I have a chunk of code just need to know how can I improve it.
...
0
votes
1
answer
128
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
0
votes
1
answer
47
views
How to separate backend code in Magento 2?
I have multiple clients that need their stores to behave differently i.e. additional fields for orders, different ways of saving data etc. etc. Is it possible with Magento 2 to write for example a ...
0
votes
1
answer
831
views
Magento 2.3.1 How to display source or stock name on product page ? MSI Multii Source Inventory
How to display source or stock name and code on the product page? Where is information about a current stock or source name? Can I use the code from Sourceitem.php on the Product page?
public ...
1
vote
0
answers
38
views
Checkout Page not loading and getting blank page
first, I apologize for not being a programmer and not being able to publicly post the URL in question.
The checkout process gets empty in the second process page.
I assume Initialization code laods ...
1
vote
1
answer
357
views
Magento2 I want to change "Please specify the zip code." error message on one step checkout Canada post method
Magento2 I want to change "Please specify the zip code." error message on one step checkout Canada post method
Thank you,
0
votes
3
answers
128
views
Magento 1.9 header ISSUE
Have some strange header.phtml error. Problem is non my index page everything is ok, and on any other page have some weird problem my header and menu change places.
code for my current header.phtml ...
0
votes
1
answer
59
views
I have a problem adding a new shipping method
I'm trying to add a new shipping method, i create the module in the etc directory like Mrsolutions_Domesa.xml, inside is the next code:
<?xml version="1.0"?>
<config>
<modules>
&...
1
vote
1
answer
66
views
Problem adding Google Analytics Code and Facebook pixel in Magento Community 1.9.3 [closed]
Our site was hacked a while back and ever since we 'brought it back' we are unable to add Google Analytics code or a new Facebook pixel in - System/Configuration/General/Design/HTML Head/Miscellaneous ...
2
votes
0
answers
39
views
Transfer to other server
I want to transfer to other server my store (new server have plesk panel ).
I wrote command in cli
bin/magento setup:backup --code --media --db
from old server with this method can i take those ...
0
votes
1
answer
411
views
Magento 2 - Custom theme - Change the background to an image
I know how to change the colour of my background in my custom theme however I was wondering if it were possible to change the background on all pages to an image?
I imagine it is similar to changing ...
0
votes
1
answer
116
views
Custom theme - Cannot find code to change text [closed]
I've downloaded a custom theme for my Magento 2 site and would like to know where some files are generally located such as the "Save 60% off sale" text or the "find your next Magento 2 theme". I've ...
1
vote
0
answers
219
views
How to use code migration toolkit in magento2?
Below is the Github link for Code migration toolkit magento2.
https://github.com/magento/code-migration
I need to migrate my magento1 modules to magento2 standards. Does this supports it? If it ...
0
votes
0
answers
862
views
Create QR codes per single product purchased
Hello to the community!
I have the necessity to create QR codes per every single product that's purchased.
I know that there's a way to link a SKU to a QR code, but what I need to do is a little more ...
0
votes
1
answer
791
views
Change Magento2 attribute code Programmatically
In Magento 2, there is a product attribute code with space.(I know, Magento will not allow to create product_attribute_code with space or with Capital letters).
Now, I need to change/update that ...
1
vote
1
answer
48
views
Alligning The Subtotal Title To The Right - New Order E-mail In Magento 1.9
I am trying to align the subtotal title to the right after I was told to remove the SKU from the new order e-mail, but everything I do in the coding in (app/design/frontend/base/default/template/email/...
0
votes
1
answer
125
views
How to apply coupon code if specific products are available on the cart?
The cart contains two products ex: product1+product2 then only my discount can be applied, otherwise should not allow even individual also. Based on SKU
0
votes
1
answer
167
views
How many Facebook Pixel Code can you have in Magento?
How many facebook pixel codes can you have in Magento. I so that our marketing seo's put in Magento admin console in section Miscellaneous Scripts that there is more then one Pixel code e.g.
<!-- ...
0
votes
1
answer
34
views
How to remove discountcode from checkout and transactional emails?
I'm working with magento 1.9.3.4 and I wold like to remove the Discount code (e.g. COUPONCODE1) from showing on the checkout and transnational emails. Is this possible?
Is there a controller/model/...
0
votes
1
answer
2k
views
Php / Magento 'requires' Fatal Error .... need help interpreting problem
I am trying to install a new theme (not getting a reply from support about this and trying to fix it myself). After SFTP'ing the theme folders to my root folder, I am getting the following error when ...
0
votes
2
answers
939
views
update products price with code
i want to increase my products price in magento
foreach ($prodCollection as $product) {
echo $product->getName() .'<br>';
echo "old: " . $product->getPrice() .'<br>';
$...
0
votes
1
answer
31
views
How Do I Get Rid Of Code Showing Up After the Paypal Express Button on the Product Page?
How Do I Get Rid Of Code Showing Up After the Paypal Express Button on the Product Page?
I've attached an image of the problem.
I'm using Magento vers. 1.9.
0
votes
1
answer
48
views
How can I create a discount code which allows the customer to get a specific item free if they spend over £300? [duplicate]
Either by having this item in their basket anyway and subtracting the value from the order or it would be great if the code added the item on to the order for free, without them having to search for ...
0
votes
0
answers
25
views
Is there any way to modify the magento php code (backend)?
In magento 2:
Where can I modify the login code?
How can I see the user that is logged in?
Where are the php files that control the backend?