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

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
19 views

Magento 1.9 show php code outside productpage

We currently load some php code, that will only be displayed on the productpage. Therefore we use: <?php Mage::helper('seo')->getCurrentSeo()->getTitle();?> And displays something like: ...
0
votes
0answers
9 views

Can we add translation in setup scripts of magento2?

e.g. In upgrade data i want to insert some records. Is there any effect of translation on data to be inserted ?
0
votes
0answers
14 views

Access Magento Admin on Subdomain

I have a running store on Magento 2 which has multiple websites that I can access in the front end without any problems, for example: https://siteone.mymagestore.com https://sitetwo.mymagestore.com ...
1
vote
0answers
11 views

“mcrypt_module_open is deprecated” exception in cron in Magento 2.2.6 on PHP7.1 ?

The method is silenced in core still cron throws exception if debbug mode is enabled. mcrypt_module_open is deprecated // @codingStandardsIgnoreStart $this->_handle = @mcrypt_module_open($...
0
votes
1answer
19 views

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'referenceContainer': This element is not expected

I am getting this error no product category page 1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'referenceContainer': This element is not expected. ...
2
votes
2answers
18 views

In CRUD, Why delete item operation is preferred via POST request rather than GET request?

Is there is any special security advantages of using a POST request over GET request for delete operation? As Magento 2 has preferred POST for delete operation.
0
votes
1answer
10 views

Magento 2 - what event should I observe to change/intercept the calculation of subtotals on Cart

I am using Magento 2. I made an observer that observes anytime a new item is added to the cart. The observer works properly, I also managed to create a single product discount with this observer, ...
0
votes
0answers
39 views

magento 2.3 does not work in windows [duplicate]

I just installed magento 2.3 in windows/wamp but it is not working. The admin page is blank and the login/registration page also fails to load. this is the home page The solution provided here ...
0
votes
1answer
17 views

Add/Remove class from div if minicart hasitem/noitem

I want to add a class in parent div if minicart/cart is empty and remove same class if minicart/cart has an item(s).I made changes in minicart.phtml. below is my code for that. <div class="block ...
2
votes
0answers
16 views

How to add a Block Grid with Mass Action in an UI form in Magento 2?

I have UI form with a Block grid. <fieldset name="profile_products"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item ...
1
vote
0answers
33 views

PHP Startup: Unable to load dynamic library - The specified module could not be found

I am using WampServer 3.1.0 and PHP version 5.6.31 in windows, i am getting an error like, php_error : [06-Dec-2018 10:13:17 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/...
0
votes
0answers
17 views

About 'There was no Home CMS page configured or found'

I installed this theme. Fastest But doesn't show any widget on Top page, like a below screenshot. I tried these. 1) After import theme data on Admin panel, Cache clear, Flush, Upgrade, Compile, nginx ...
1
vote
1answer
22 views

Difference between class constant and class static variable with array as a value in php7?

Example: class Test { const URLS = [ 'http://example.com/', 'http://example1.com/' ]; public static $urls = [ 'http://example.com/', ...
2
votes
1answer
37 views

How to get value in function that is retrieved and stored in a variable of another function in same class | Magento 2

I want to use $orderId value in other functions. Here is class <?php namespace vendor\module\Observer; use Magento\Framework\Event\ObserverInterface; class Observer implements ObserverInterface ...
0
votes
0answers
20 views

Product name in Magento order confirmation email subject

(Magento 1) I'd like to add the name of the product in the order confirmation email subject. How do I do that?
0
votes
1answer
31 views

Why PHP Settings Check and Checking Component Dependency showing error during Magento 2.3 upgrade?

I was Upgrade Magento from 2.1.12 to 2.3 using Web Setup Wizard. During this process, It show two error PHP Settings Check and Checking Component Dependency. We already set memory_limit=2GB in php/...
3
votes
1answer
22 views

Get all 3rd level categories

is there any chance how to get ALL third level categories available? I have searched whole internet and found only getting categories based on parent category but it doesnt return whole store 3rd ...
0
votes
0answers
5 views

M2 | If click on eidt button, update button should become visible and edit hides

I have to update a record. I have gone through this but it is in M1. I have my code in custom phtml file and my function that changes value is: $changeEmail = $block->changeGuestCustomerEmail(); ...
0
votes
2answers
88 views

How to mass update custom dropdown customer attribute to all customers? PHP or SQL

I created a new customer attribute (Drop Down) and added it to the registration form. Attribute details found in eav_attribute table: Everything work as expected, attribute is added to the customer ...
0
votes
0answers
11 views

Magento 2 setData vs setTierPrice()

Was just wondering if there was any benefit / disadvantage to using the more specific setTierPrice() over setData() when working with Magento attributes. From what i'm aware they are practically the ...
1
vote
0answers
20 views

Magento2 : How to get value of checkbox in observer?

I will refer to previous post: Magento : How to get value of checkbox in observer? Anyone have example of how to do the exact same for Magento 2?
0
votes
0answers
23 views

Magento 2 How do Product ID's work?

My question is simply asking how is a unique product ID created? I want to be able to create a new product but I don't really know how a unique ID is created to attach to it. I need a unique ID to ...
0
votes
0answers
15 views

Magento 2 Get Tier Price Auto-Increment ID

So setup currently I have an array that contains custom values to then insert into the Tier Prices as I want to assign custom Tier Prices to products. This array can be found below: $newTier = [ "...
0
votes
0answers
16 views

Mysql Php display data from 3 tables in the database

I want to display data from 3 different tables. I am having an issue with Inner Join. I want to display results in this format: first_name | last_name | fk_rate_code | dob Tables: invoice (id, ...
0
votes
1answer
13 views

Magento 2 Tier Price Attributes

As it stand I have managed to pull the Customer Group ID, Price Quantity and the Price itself. However there are other attributes: Price ID Website ID All Groups Percentage Value Website Price None ...
0
votes
1answer
27 views

Magento 1.9 Randomly Allowed memory size of 2GB exhausted PHP 7.1.1

I got a php error randomly, Allowed memory size of 2147483648 bytes exhauste and customers see the 500 Internal Server Error. It happens most often after importing products with Dataflow, when ...
0
votes
1answer
13 views

Magento 2 Get Special Price of Product with a specific Customer Group

I am trying to get access to the special product prices using PHP. These have already been set to the products themselves under the Advanced Pricing section. My end goal is to access these products' ...
0
votes
0answers
15 views

Magento 2 Create Group Specific Prices

Short Version: I want to replicate the functionality of the Advanced Pricing under Catalog -> Products, more specifically I want to replicate the Customer Group Price section of the Advanced Pricing. ...
0
votes
0answers
24 views

magento blocking sql table

I tried to truncate catalogsearch_fulltext_scope1 from my Magento 2.1.7 installation. But phpMyAdmin always stopped working. So I deleted its entries and remained with only one product (with 4 ...
0
votes
0answers
24 views

Magento 2 Saving Product Price Changes

Is there a way of saving changes made to the individual products? I have the following below code: $product = $this->_productRepository->get($productID); $product->setCustomerGroupId($...
0
votes
3answers
28 views

RuntimeException: Can't create directory

my website https://roofmegastore.co.uk/ is coming up with this error. 1 exception(s): Exception #0 (Magento\Framework\Exception\FileSystemException): Directory "/var/www/html/magento/pub/static/...
0
votes
2answers
37 views

How to solve “One or more indexers are invalid. Make sure your Magento cron job is running” [duplicate]

My magento 2.2.1 website backend prompts "One or more indexers are invalid. Make sure your Magento cron job is running." How to solve this kind of error? Does it have a big impact?
2
votes
1answer
25 views

Maximum execution time of 300 seconds exceeded error

When I delete many products, I got this error Fatal error: Maximum execution time of 300 seconds exceeded in /magento_1.8.1/www/lib/Zend/Cache/Backend/File.php on line 655 Server php and ....
1
vote
0answers
17 views

Source Key should be specified

We are in the process of moving our Magento site to a new hosting platform. After moving all of the files and making some changes to the template XML, the frontend of the site is now working as ...
0
votes
0answers
29 views

Magento 1.9 Integrity constraint violation on duplicated product

When I duplicate a configurable I get this exception, but the product is created as excepted: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-0-0-1-4-23456-0' for key '...
1
vote
0answers
20 views

Source class for generation not found

I am using a composer library in my custom module. The link for the library is here. This library in turn uses https://github.com/tightenco/collect The {Vendor}/{Module}/composer.json is { "name":...
1
vote
1answer
26 views

Magento 2: AJAX POST to AdminHTML

I have an AJAX POST setup within my template file currently that has 3 values, which I want to POST to my Index.php within my Block. However, my module is an AdminHTML module and this cannot be ...
0
votes
1answer
26 views

Magento 2: Missing required argument $mainTable from Model\ResourceModel\Deal\Grid\Collection

Missing required argument $mainTable from Model\ResourceModel\Deal\Grid\Collection But I check my all file and all code working fine but this error show on dashboard.
0
votes
0answers
46 views

Custom customer attribute on customer grid

I'm using Magento 1.9.3.2 So I created a custom extension that added an attribute for my customers. Everything is working fine except for the fact that I want to display that custom attribute on the ...
0
votes
0answers
10 views

Magento 1.9 After applying price filter, price filter get hidden but i want to show price filter always

Magento 1.9 After applying price filter, price filter get hidden but I want to show price filter always after applying also. My price filter looks like as shown in image below And after applying ...
1
vote
3answers
55 views

n98-magerun.phar not working - PHP Fatal error: Class 'Phar' not found

I can't execute n98-magerun.phar, I get PHP Fatal error: Class 'Phar' not found. I am using PHP 5.5.14 (cli) Any hints how to solve this?
0
votes
0answers
26 views

Magento v2.2.5, how to add attribute options that contain special characters such as accented e's

Magento Version 2.2.5 Using '\Magento\Catalog\Api\ProductAttributeRepositoryInterface'. SOLVED: encode first with utf8_encode("label")
1
vote
0answers
22 views

how to remove wishList Item by item id and customer id in magento 1

if (!empty($customerId) and ! empty($item_id)) { $return['canRemove'] = true; try { $item = Mage::getModel('wishlist/item')->load($item_id); ...
0
votes
0answers
22 views

Magento2.2.2 Backend Curl CURLPROTO_HTTP undefined

This is an odd one: I've just updated my to macOS High Sierra installed missing extensions Frontend it's all good Backend Admin login fine But when logged in get Exepction: > 1 exception(s): ...
0
votes
2answers
60 views

Print all PHP variables available in template

How can I print all the available PHP variables which I can use in a template? For example all variables which I can access in app\design\adminhtml\default\default\template\wr\catalog\product\edit\...
0
votes
0answers
23 views

How configure cron by config_path?

I have following code: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> ...
0
votes
0answers
21 views

magento 1.9 doesn't save attribute value on sales_order_place_after

When the event sales_order_place_after is triggered the new quantity value is not inserted, what is the problem? How to update quantity or other attributes when this event is triggered? I need to ...
2
votes
3answers
73 views

Show price inclusive tax on checkout

[Magento 1] I want to show prices on checkout inclusive of GST (Indian). Currently, it's adding the tax separately on checkout page resulting in increase final price. We would like to configure it in ...
0
votes
0answers
9 views

Can't change international shipping address country

When making an International order through admin the country for shipping address always changes back to default after the Ajax request finishes, I.E If I am doing a Europe order and the default ...
0
votes
1answer
39 views

Magento 2 - Pass data from php to javascript in widget

I have an custom widget in admin panel which has select option with all available categories in the store. How can I pass this data to my javascript file? I want to get array of all loaded categories ...