Questions tagged [code]
The code tag has no usage guidance.
120
questions
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 ...
2
votes
1answer
2k views
Show State/Province code in address
When a customer make an order, in the shipping and billing address appears the extended Province name (for example "Lecce"). Is it possible to show the Region code "LE" instead of the Region name "...
0
votes
0answers
29 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
66 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
62 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
81 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
13 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
37 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
153 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
45 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
445 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
299 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
61 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
3answers
111 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
585 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 ...
0
votes
1answer
35 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 ...
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 ...
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
2answers
376 views
Magento - Remove tax from all products quote. (Update)
I saw there are some post like this but I tried that answer and dit not work.
I am learning how to use magento, and What I wan to try is remove all the tax from the cliente when them have add 3 ...
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
2answers
356 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 ...
0
votes
1answer
759 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
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 ...
1
vote
1answer
252 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,
1
vote
2answers
86 views
Does anyone have any example code or recommended plug ins for adding the rel=prev and rel=next tags for paginationN
Does anyone have any example code they have used in magento to implement the rel=prev and rel=next tags for paginated content on a magento site?
or if you have a recommended plug in?
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
45 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 ...
12
votes
2answers
14k views
Magento multiple order on one checkout or order splitting
Store products are supplied from different vendors. It is required to create multiple order for every vendor based on its products in the cart during one checkout. Is there any extension to achieve ...
0
votes
1answer
279 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
100 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
199 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
716 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
665 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
146 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/...
3
votes
3answers
783 views
In this code what this customer parameter means
In this code what this customer parameter mean
$this->helper('customer')->getRegisterPostUrl();
0
votes
2answers
669 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>';
$...
40
votes
5answers
7k views
Magento coding standards
I recently started working extensively with Magento and Code sniffer, and I would like to know which standards I should follow.
I tried Zend coding standards, but I don't want to use the 80 line ...
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
46 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 ...
27
votes
5answers
10k views
Why does Magento have 3 code pools?
Magento has three code pools:
community
core
local
Core: It contains all Magento default modules
Community and local: We use these code pools for our custom module development.
Now I have doubt ...
1
vote
1answer
2k views
Registration and sent coupon code
If user register with website and send to the coupon code for that customer.
How to get the coupon code and sent to the customer?
Is it possible to generate coupon code automatically?