Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

Magento 2: product status disable by add CLI commands [on hold]

I want to create CLI command that display all product status.
5
votes
2answers
69 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
33 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
42 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
34 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
0answers
26 views

Hide reward points payment when discound code is applied in magento 2

I want to hide reward points payment option while discount code is applied but I don't know if that can be set somewhere in the Magento admin panel. I want to do it in reverse direction too, so if ...
0
votes
1answer
24 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
13 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
0answers
19 views

Invalid response line returned from server: HTTP/2 200 ver 2.2.7

HI I have tried the fixes but none see me to so I am wondering if its because I have 2.2.7 version, that why I am receiving the error code after inputting the keys into the configuration to get the ...
0
votes
1answer
78 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
28 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
81 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
52 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
31 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
27 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
34 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
122 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
51 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 ...
0
votes
0answers
110 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
292 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
243 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
36 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
65 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
60 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
29 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
921 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
362 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
29 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
42 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
23 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
52 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
433 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
294 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
245 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
29 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
426 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
145 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
36 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
178 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
498 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 '...
0
votes
2answers
216 views

how to reduce the magento website page load time? [duplicate]

I presume the website pages are slow down because of this filter to get only configurable products.. I used ->addAttributeToFilter('type_id', array('eq' => 'configurable')); this code works ...
1
vote
1answer
167 views

How to decrease brand product list page load time in magento?

I am collecting brand specific products based on the brandId in brandproductlist.php as follows., $collection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*')...
0
votes
2answers
173 views

how to check which collection is taking how much time to load in a function in magento 1.9

I am writing a backend function for loading a profile on android app, want to figure out why its slow , and taking more time to load so want to debug the load time of each query in function how can I ?...
3
votes
1answer
130 views

Magento 2 core functionalities and structure - difference between vendor/magento/framework and vendor/magento/module-* namespace code?

What is the difference and when to use vendor/magento/framework code, and when to use the vendor/magento/module-* code?
11
votes
1answer
223 views

Does removing commented code speed up a Magento site?

In most (if not all) Magento files, there is commented disclaimers: /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with ...
0
votes
1answer
1k views

Notice: Undefined index: files in app/code/core/Mage/Core/Model/Translate.php on line 1

Notice: Undefined index: files in /home//public_html/.com/app/code/core/Mage/Core/Model/Translate.php on line 139 #0 /home//public_html/.com/app/code/core/Mage/Core/Model/Translate.php(139): ...
4
votes
2answers
1k views

What is meant for Vanila magento 1 codebase?

I am trying to migrate from magento 1 to magento 2 and I have seen on magento website there is a tool for that which is code migration toolkit here's link for the same https://github.com/magento/code-...
2
votes
1answer
49 views

How to know all available methods and how to use them [closed]

I'm still learning how to use Magento and I see that it has lots of useful methods. However, my only way of learning that a method exists, and how to use it, remains looking at code that's already ...
0
votes
2answers
50 views

html / code to add price in a specific block?

I've tried multiple snippets of code to add an item price to a specific block without success. On the example item page : https://fixlcdscreens.com/default/catalog/product/view/id/10234/s/ACER-...