Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [php]

This tag is used for questions which involve PHP code in any way. So as soon there is a PHP Exception returned or error report generated, this question qualifies to be tagged with PHP.

0
votes
0answers
16 views

Add a block (PHP) to pass data in custom home page

I need to pass data from a block PHP into my new custom home page. But I have created the page_layout/custom_home.xml into Magento_Theme inside app/design/My/Theme folder. Where should I create a ...
1
vote
2answers
74 views

Magento 2: How to Override File in Vendor Folder

I installed a 3rd party PHP sdk via composer and need to override a couple files in my own module. However, I'm not quite sure what the best practice is to override these files from the vendor folder. ...
0
votes
1answer
34 views

magento 1.9 observer on quantity product change

I can't find the event for quantity product change for magento 1.9. I need to do something after a quantity product is updated from backend and frontend, when a user buy a product and decrease ...
0
votes
1answer
36 views

Does initializing a helper variable before using it multiple times benefits performance?

I wonder if it is better to write: $lesser2000 = Mage::helper('wr_epo')->getFensterbankTill2000mm($quote); $higher2000 = Mage::helper('wr_epo')->getFensterbankHigherThen2000mm($quote); ...
0
votes
0answers
17 views

Magento 2: customer sign up data validation by reading csv

I have customized Magento 2 customer signup form for a card ID. Is there a way that I can read CSV that includes millions of customer_id and privilge_crd_nu and validate by the time of user signs up.
0
votes
2answers
221 views

Parse error: syntax error, unexpected '$servername' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST) php

I am trying to connect to a MySQL database usign PHP but am currently facing this error : Parse error: syntax error, unexpected '$servername' (T_VARIABLE), expecting function (T_FUNCTION) or const (...
0
votes
2answers
36 views

Magento 2 Installation stop at 2%

Magento 2 Installation step 6 still Stops at 2% !
0
votes
1answer
33 views

magento 1.9 problem custom module programming example problem

I have these files: app/code/community/Foggyline/HappyHour/Block/Hello.php class Foggyline_HappyHour_Block_Hello extends Mage_Core_Block_Template { public function __construct() { parent::...
2
votes
2answers
30 views

Hide block of text if there are no items to compare

I'd like to display/hide a block of text by wrapping in a PHP IF Statement. Value will be based on whether Comparable Products is not equal to "0" (or NULL?). I imagine I'd be looking at something ...
0
votes
1answer
85 views

Onepage checkout order successful page is blank no errors Magento 2.2.6

I have problem with one page checkout ordering page after placing an order and prossesing to checkout Success Page is blank... I tryed to change magento mode from production to developer but then ...
0
votes
0answers
38 views

Loads of system error logs in Magento 1

For instance when i'm clearing cache i get some errors and they are pointing to a core module here: 2018-10-04T15:20:26+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 1: parser ...
1
vote
1answer
52 views

Free Shipping using PHP Script

I have to give free shipping order over 1000 and zipcode range between 600001 to 600010, i am using webshop matrix rate for shipping method, in this case, shopping cart pricing rule not working free ...
0
votes
2answers
35 views

Get product in stock proucts when manage stock enabled

I'm doing some customization on magento 1.9.x website. I need to get all products with in stock and manage stock enabled I'm using this code $stockCollection = Mage::getModel('cataloginventory/...
0
votes
0answers
19 views

Delay in loading top navigation

If you load https://www.uitverkoopgigant.nl/wonen-slapen.html there is an delay of 3 seconds before the top navigation loads. And the categorie slider loads first vertical and then it goes horizontal ...
0
votes
2answers
78 views

Magento 2 - Categories not display when Page Cache is on

I have a very strange issue on Magento 2.2.2, if I enable the Page Cache (Full page caching - FPC) the top navigation is not display anymore. What I can do? Thank you
1
vote
0answers
22 views

php for tax calculate

i try to calculate tax for export.Every price in magento admin had already inserted with tax include. So the only sollution i can think is to calculate it at success page. With tax 24% i try to ...
2
votes
1answer
27 views

How to apply “if” condition to XML generation file

I have a Magento 1.7 Community plataform, connected to an ERP (Bling). We have a file that take all those php information and send as an invoice to Bling. In our products, we have a field named "...
1
vote
4answers
706 views

when i run magento using xampp it shows Fatal error: Uncaught Exception: Deprecated Functionality:

Fatal error: Uncaught Exception: Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in C:\xampp\htdocs\magento\vendor\colinmollenhour\...
1
vote
0answers
53 views

Magento 2: Configure just only for one country

We have a magento 2 store, with more than 20 stores location and they are being separately maintained in the same web site, we do sell only in the country. is there anyway that I could completely get ...
0
votes
1answer
120 views

How to enable LOAD DATA LOCAL INFILE in Magento 1.9

So far I found this closed question and solutions for Magento 2, but I'm hoping there's a solution for Magento 1 as well. This question should not be closed like the other one because it IS specific ...
0
votes
1answer
120 views

Product import through EXCEL file

I am working on magento v2.2.5, and need to upload excel .xlsx file. How to work with excel file like how will magento read excel file, then upload?
0
votes
1answer
107 views

Magento 2 - Change top navigation submenu position

I create a new theme for Magento 2 based on Luma theme. I change the submenu of the top navigation to be 100% width. .navigation .level0 .submenu { max-width: 1280px; width: 1280px; ...
0
votes
0answers
21 views

Magento 1.9 drag n drop functionality on module's grid list in admin

I would like to add drag and drop functionality to my custom module list in the admin panel. Has someone re-use the drag and drop functionality from the categories or would this have to be a separate/...
0
votes
0answers
47 views

Magento 2 install nginx php mysql dnsmasq xdebug php codesniffer on mac high sierra

Is there any complete guide where I can see how to install 1. nginx 2. php (multiple version) 3. mysql 4. dnsmasq 5. xdebug 6. php codesniffer on mac high sierra? Please don't suggest Valet+ ;). ...
3
votes
1answer
18 views

magento 1.9 custom module fronted error 404

I have problem to acces the custom module frontend controller. I am following a basic tutorial to build a custom module. These are the files I've edited: /var/www/html/magento/app/etc/modules/...
0
votes
2answers
128 views

Notice : Undefined variable:

In the backend of my Magento 2 i get today this error: Notice : Undefined variable: _ENV in /home/uitverko/public_html/deal-finder.nl/vendor/zendframework/zend-http/src/PhpEnvironment/Request.php ...
0
votes
0answers
21 views

Nesting level too deep - recursive dependency?

While uploading the products from Linnworks to Magento I get the error “Status Update error. Error : Product update was not successful. SKU: #1234. Product ID 1234. Nesting level too deep - recursive ...
1
vote
0answers
103 views

Send email using SMTP in PHP with PHPMailer [closed]

I tryed this code: <?php // Import PHPMailer classes into the global namespace // These must be at the top of your script, not inside a function use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\...
1
vote
0answers
12 views

PHP set db value according to server datetime

Need to send notification to user by cron. For that there is a datetime picker from which admin can select datetime. IF datetime selected by datepicker is as below: $selecteddate = '26-9-2018 10:00';...
3
votes
1answer
34 views

Where to place Mobile detect code?

I saw this method as efective to detect if the user is using a mobile device: $isMobile = Zend_Http_UserAgent_Mobile::match( Mage::helper('core/http')->getHttpUserAgent(), $_SERVER ); But ...
1
vote
1answer
216 views

Magento2 - Override Template order summary in sales email order

I have the template that is using the following to render order summary {{layout handle="sales_email_order_items" order=$order area="frontend"}} it is taking the code from the following template ...
4
votes
0answers
86 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
1
vote
1answer
69 views

Removing link from root category on topmenu

I am trying to make the topmenu root category not clickable using this method https://community.magento.com/t5/Magento-2-x-Programming/Remove-links-to-top-categories-in-menu/td-p/77072 but it ...
5
votes
2answers
3k views

Magento 2.2.6 | Unable to upgrade

Since Magento 2.2.6 was released not long ago we wanted to update our installation via CLI. Unfortunatly i stepped accross a few problems. Steps I've done so far composer require magento/product-...
0
votes
0answers
10 views

After protected-directories got error

Hello i have problem with my store when im in protected-directories mode one my stores Working 100% Loading all images and my color options from backend when i turn off protected-directories for ...
1
vote
1answer
72 views

Magento Core doesnt work after transfer

Hello i just put my store to other new server but i have very big problems... I set right permissions ( owner and group too ) to magento dir but i get this error Magento\Framework\Exception\...
5
votes
1answer
78 views

Problem with CLI

Hello i have an error of every command i press in CLI. Following this Error Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /var/...
1
vote
1answer
208 views

Magento 1 - Convert Object into an array value

I was trying to get the information of tracking in the UPS. I got on of the method from the core (app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php => method name getTracking($trackings)) that ...
0
votes
1answer
30 views

Magento 1.9.x Quantity Select Box Increments - How can i limit them?

We currently display product quantities in select box <select><option> type inputs and limit the select dropdown to a maximum Qty of 30. This has been working fine for us however we want ...
0
votes
1answer
141 views

Magento 2 Order Cancel foreign key constraint error

I'm currently receiving this error when cancelling an authorize.net direct post order (authorized only, not captured yet, shipping method is ups). [2018-09-13 13:14:49] report.CRITICAL: SQLSTATE[...
3
votes
1answer
62 views

How to cache a block in block_html cache type in Magento 2?

I have a block file that does heavy data processing due to which my product page PHP rendering time increases above 2 seconds. I have disabled page_cache in my Magento 2 system so i cannot use ...
6
votes
3answers
243 views

Magento native file PHP function - public function getItemOptionsValue(): float

/vendor/magento/module-catalog/Pricing/Price/ConfiguredOptions.php This is file in magento native version 2.2.4 /** * Get value of configured options. * * @param float $basePrice ...
0
votes
1answer
37 views

PHP execute issue in Magento 2

I'm trying to save my custom customer attribute when the corresponding checkbox is checked. But if the customer unchecks the checkbox it should update the attribute to a value of 0. var newProducts =...
0
votes
0answers
13 views

Saving custom customer attributes

I have a few custom customer attributes in the admin/customer information section of my site. The attributes are as followed: new_products_attr exclusive_offers_attr discounts_sales_attr I've setup ...
1
vote
1answer
42 views

How to translate escapehtml (Filter by)

Hello i cant to translate this one http://prntscr.com/kt3mrb my code is <div class="block-content filter-content"> <?= $block->getChildHtml('state') ?> <?php if ($...
1
vote
1answer
35 views

How to remove a specific href from a top-menu link in Magento

i post before several day this one Hello I am trying to make 3 items on menu to be not click-able and I want to ask how to remove a specific href from a top-menu link in magento? (I don't want to ...
0
votes
1answer
209 views

Magento 2.2.5: Warning: Cannot modify header information - headers already sent by [custom_theme registration.php]

I'm developing a custom theme and running into errors. The theme has been tested and working on various servers but, for some reason, since uploading to siteground I get the following error (file ...
0
votes
1answer
39 views

Magento 2 Loading customer through block error

I'm trying to use Magento best practices by not using Object manager, and instead loading what I need through my blocks. I've got this code in my newsletter.php block file: protected $...
0
votes
1answer
42 views

Magento 2 admin how to change product price when adding product to cart

Can any one please suggest me how to change the product price when adding product to cart through admin. I want to change the price of the product programmatically when adding product to cart.
1
vote
1answer
68 views

Magento 2.2.5 shell script PHP Memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes)

I have a magento 2 script which runs through shell so to not have a timeout issue. It uses php multi curl request and it was running fine. But recently asked our hosting server to increase the PHP cli ...