Questions tagged [code]
The code tag has no usage guidance.
120
questions
0
votes
0answers
22 views
layout sales_order_create_index.xml explain code please
vendor/magento/module-sales/view/adminhtml/layout/sales_order_create_index.xml
There are two blocks name="coupons" and name="order_create_coupons_form" with classes
Magento\Sales\...
2
votes
0answers
51 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
0answers
47 views
Adding Search Console to Magento 2.3.3
I have a client who is designated owner in Search Console.
We are trying to get him verified, BUT adding code in Magento does not work.
We were trying to add the code via Content -> Configuration -&...
0
votes
0answers
11 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
1answer
67 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
0answers
12 views
Programmatically massing create bundle products in Magento 1
1) I try to make bundle products throw php in magento 1 and I dont know how to make it to several or more bundle products(in my code only one bundle product) in one script
2) and can u tell me about ...
0
votes
1answer
19 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
0answers
26 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
1answer
35 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
1answer
136 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
0answers
40 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
1answer
28 views
Need code of edited things through admin panel
How we can get the code of edited pages through the admin panel?
5
votes
2answers
411 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
1answer
275 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 store,store_group, store_websites ...
0
votes
1answer
59 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
1answer
57 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
1answer
59 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
1answer
33 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
1answer
562 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
0answers
32 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
1answer
236 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
3answers
106 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
1answer
55 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
1answer
42 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
0answers
35 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
1answer
270 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
1answer
98 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
0answers
197 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
0answers
680 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
1answer
639 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
1answer
45 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
1answer
115 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
1answer
137 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
1answer
33 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
1answer
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
2answers
648 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
1answer
30 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
1answer
45 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
0answers
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?
0
votes
2answers
35 views
How to access the files on a Magento site
A client of mine has a Magento site set up, I've been asked to help them out with the SEO. I've never used Magento before, didn't even know that it exists. I need to find the actual files so I can ...
1
vote
0answers
53 views
Area Code not set when Model is used while using Upgrade Data Script
I have following code in UpgradeData.php
protected $test;
public function __construct(
\Vendor\ModuleName\Model\Test $test
)
{
$this->test = $test;
}
public function ...
0
votes
1answer
517 views
Magento 2 | How can we use jQuery without “require(['jquery'],function($){” this code
We have face problem we implement some slider and also we have wrighten many script in phtml.
If we add the jquery library then magento is giving the error in core files and all script are stopped ...
0
votes
1answer
365 views
Magento1.9.3 Cash On Deivery Charges
I want to add some Cash on delivery charges in my magento 1.9.3.2 website. Which can be automatically added in bill in onepage checkout page and also in invoice.
I do not want to add any extension.
...
0
votes
2answers
349 views
Coupon code for free product with purchase over $99
I want to create a coupon code to have a specific product added to the cart at no cost when the order total is over $99 and the code has been entered.
I am not having any luck figuring out how to ...
1
vote
0answers
33 views
Magento 2 : Is there a file system map for Magento 2?
Ultimately I want to add code snippets to some or all pages on my website, specifically, the code is the Facebook pixel code is the google tag manager code.
I've found a number of similar questions ...
0
votes
1answer
720 views
Countdown Timer
I can't get the following code to work on the frontend. It displays correctly but will not countdown as I would like. I have tried changing the date but nothing happens. Could someone point me in the ...
1
vote
1answer
149 views
CE v1.9.3.4 (v2) did NOT fix the “Enable Form Key Validation On Checkout” Was released July 12,2017
@Ryan-hoerr YESTERDAY sent out message that there was v2 Patch or upgrade to v1.9.3.4 from v1.9.3.3 because of the form_key checkout problem which the Magento CE 1.9.3.4 Release Notes was supposed to ...
1
vote
1answer
39 views
Need help on writing magento code for fetching data for this custom mysql query
Customizing IWD_SalesRepresentative extension in their reports I want more data than they give by default
Their default code:
$colunms = $this->_getSelectedColumns();
$this->getSelect()...
0
votes
1answer
206 views
Why it's showing Undefined index when I try to convert a module from M1 to M2?
I'm trying to convert one module to M2, and after running the code_conversion_tool, I've ended up with .converted files all around.
I've renamed them to replace the actual files.
While doing setup:...
0
votes
1answer
583 views
Can't Edit products
I'm having problems with my Magento website.
I first noticed we had a problem when I went to: "System/Configuration/General/Design" I got the following error message:
"Fatal error: Class '...