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.

Filter by
Sorted by
Tagged with
3
votes
1answer
1k views

How to edit SQL error generated by PDO.php?

I started with this exception: exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds ...
3
votes
1answer
12k views

How to get all the customer wishlist items in magento

I want to get all the product ids from wishlist in magento. I tried with below code but I am getting only one product id. public function GetWishlistProductId($productId) { $customer = Mage::...
3
votes
1answer
90 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 ...
3
votes
1answer
232 views

Overwrite Constructor to inject custom module helper

I have created a custom module. which rewrites \Magento\Checkout\Block\Onepage\Success class by creating a custom module. and i am able to make changes in prepareBlockData function but i want to ...
3
votes
2answers
2k views

Php max_input_vars prevents attribute options saving in M2

Magento 2.2.1. PHP 7.0.26 Nginx After 2 days struggling around with attribute options in M2, I found out where the problem was. I have several custom dropdown attributes with hundreds of options. I ...
3
votes
1answer
2k views

Product page 404 error only sometimes [closed]

I have a weird problem I can say. I'm using Magento 1.9.3.6, and SOMETIMES, NOT ALWAYS, when I want to access the product page, of any product, it gives me an 404 page not found error and if I ...
3
votes
1answer
3k views

How to override private function in Model (Magento-2)

My di.xml file <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> ...
3
votes
1answer
820 views

How do I check if page has certain ID

I have a page that needs to behave a little different than similair pages, so I want to add an if else statement for only one ID. How can I do that for magento 1.9? On the view.phtml I need to add ...
3
votes
1answer
32 views

Magento 2.1 security: Arbitrary PHP from database fields

I have a basic security question about Magento 2.1 Do any of the modules in a default installation allow the execution of arbitrary PHP code directly from a database field? I'm assuming not, but I ...
3
votes
1answer
374 views

Magento php wrong version detected

I work in ubuntu 14 server. The problem is that in the console i see the version of my php is 7.0.14, and in the magento2 setup it says my version is 5.5.9 I appreciate any help
3
votes
2answers
1k views

Invalid carrier specified - Cannot add tracking to shipment

I'm trying to add tracking to orders via the SOAP (V1) interface using the sales_order_shipment.addTrack method - but as the title suggests I'm getting the following error: Invalid carrier specified ...
3
votes
1answer
599 views

How to assign product category during products import

I've to import some products from a txt file where, for every row, there's product sku, product name, product description, short description, price and category id. The products are imported but price ...
3
votes
1answer
923 views

How to Get links from Magento customer menu?

I'm trying to get url's from Customer Menu (My Account) from Dashboard, in a controller that extends Mage_Customer_AccountController. I've tried this: class Namespace_Module_AccountController ...
3
votes
4answers
6k views

Cannot correct php.ini error in Magento 2.0.2

Hello I'm using the latest magento source files from magento website. I've installed the files via directions on the support documentation of magento website and at the Readiness Check point i get the ...
3
votes
2answers
127 views

Where Does Magento use Composer's `type` Attribute — Is this Required?

In my experiments with Magento 2 composer packages, I've been able to get a package up and running without using composer's type attribute. However, this class file #File: vendor/magento/framework/...
3
votes
2answers
8k views

How to make Payment Gateway in Magento 2?

Please provide any official documents or any demo/tutorials mode for this (How to make Payment Gateway in Magento 2). I was referring to http://inchoo.net/magento-2/implementing-payment-gateway-...
3
votes
1answer
494 views

iterate over array value not display in phtml

I´m trying to display Ebay GetSingleItem response (http://developer.ebay.com/devzone/shopping/docs/callref/GetSingleItem.html) and I´m having problems displaying array ["ItemSpecifics"]. The call is ...
3
votes
2answers
4k views

Get average review star rating score in text

I want to echo the average review star rating of a product in text. Currently it is displayed in width % to display the review stars. But I want to display it like: Reviewscore is 4.7 / 5 How can ...
3
votes
1answer
2k views

company name in place of first/last name for Business customer group?

How can i make the customer group Business request a Company Name instead of First Name or Last Name. this way when signing up a company i can put in the company info since there wont be any first/...
3
votes
1answer
5k views

Modify custom option of product in cart

I have this code in checkout/cart/item/default.phtml $allProductOptions = $_item->getProduct()->getTypeInstance(true)>getOrderOptions($_item->getProduct()); $productOptions = $...
3
votes
1answer
50 views

Issue when creating two similar extensions

I am using Magento 1.9.0.1. I've created two extensions. The first one i created is called PercentPayment and the second PercentShipping. The issue appeared when i created the second one. Strangely ...
3
votes
1answer
253 views

How to create Account Child… Company, Staff Signup

How do i create and attach a new set of field to a registered account? I need a way to create company accounts and add the company's staff under said account. this way the company can see what each ...
3
votes
1answer
2k views

Magento + APCu caching issue. Site is slow and there is more cache misses than hits

I have a Magento 1.7.0.2 installation running on LEMP Stack; Nginx + PHP-FPM (PHP v5.5.6 w/ APCu v4.0.2) + Percona. I've configured my magento to use APCu caching like this: app/etc/local.xml <...
3
votes
2answers
1k views

Parse Log - extract info from huge exception.log file

How can I have a list of exceptions from a exception.log file ? Sometime this files are very big and the only way to analyze them is using Vim or similar cli tools. I would like php approach (so ...
3
votes
4answers
16k views

Call a PHP file with AJAX in Magento

Seems like I can't make Ajax to call the PHP file and I can't figure out what or where the problem is. I`m trying to make a module that reads from database and it should display a form with options to ...
3
votes
3answers
4k views

show images in my custom admin module

I have a custom module, through which I can upload multiple images from admin. Along with images, I have text, drop-down form fields in my module. Now I can upload all images to media folder of ...
3
votes
2answers
4k views

add to cart button is not working

I have a custom module which does same function of product view page. I am using this module in order to show my bundle products. i have created a fully functional module for this. I have loaded the ...
3
votes
1answer
2k views

Magento Model Filter by Category Returns No Products

I'm using Magento EE Lite (1.11.02) and I'm trying to load a collection of products by one single category. The following code functions as you would expect: public function getProductList() { $...
3
votes
1answer
42 views

Magento 2.3.0 - Can't set to production mode

I want to put my store on production mode, I use this command on ssh: php bin/magento deploy:mode:set production And I have this output: Enabling maintenance mode Config "dev/debug/debug_logging = ...
3
votes
1answer
30 views

Convert(re-write) array_filter code into foreach loop

I have an array $arrItems['items'] in which 5 more arrays (associate array) and each array contain 5 element (with the keys: f_name, l_name, contact, address, seller_id). I want to get all those ...
3
votes
1answer
179 views

Magento | How to add Save Action for Customer Group new field

I added a new field for Customer Group. It called customer group email. I added the field and it displays in the backend but it doesn't save the data and I don't know How can I add Save action. I ...
3
votes
2answers
582 views

Blank Page When Installing Magento Open Source 2.2.2

I am getting the following error when trying to run the initial php setup script, please advise $ php bin/magento setup:install Fatal error: Declaration of Zend\Mvc\Controller\PluginManager::get($...
3
votes
2answers
3k views

Magento 2 - How to add a new sort options in category page

I want to add a new sort options in the toolbar sorter. I want to add "price low to high" and "price high to low" in Sort By dropdown in product listing page. I try to create a new module, I found ...
3
votes
1answer
614 views

Memory leak in magento when saving products

I have a problem when trying to mass update group prices in products. It seems when saving the products memory doesn't get released properly and keeps accumulating until it gets exhausted. I've set ...
3
votes
3answers
95 views

Megento 1.9.3.1 please tell me how to fix this [closed]

Friends this is very major issue,in magento 1.9.3.1 this below issue is frustrating and no solutions I found since last one week. kindly help me to revert back the cause and solution so that i may ...
3
votes
2answers
2k views

Object DOMDocument should be created

I recently converted a Magento 1.9 module to be compatible with Magento 2. all was going well until I got this error: Object DOMDocument should be created I'm not experienced enough in Magento and ...
3
votes
2answers
168 views

Filter Magento collection with nested “OR” “AND” filter

I am trying to determine how to filter a Magento collection from a flat table that would produce a WHERE clause with an AND that is followed by expression with a nested OR, which has nested ANDs, such ...
3
votes
1answer
812 views

HTTP ERROR 500 when using require(_once) app/Mage.php

(Edit: The first line went missing, just the greetings) Hello guys! I'm both new to Stack Exchange and relatively new to Magento. What I want to do: Use a self-written JQuery Script to get the ID of ...
3
votes
1answer
1k views

copy categories from other categories in same magento

I want to copy categories with sub categories and add it to another categories with same mangento with different stores. For Example: Store One Category Category 1 Sub Category 1 ...
3
votes
1answer
555 views

Adding UI for Third Party Category Attributes in Magento 2.1?

Is there a standard/best practices way to add UI for third party category attributes in Magento 2.1? In previous versions of Magento 1 and Magento 2, the user interface at Products -> Categories ...
3
votes
1answer
153 views

Why Magento 2 developers create ASCII art in their code? [duplicate]

I wonder why nobody refactored this abomination Magento\Framework\ObjectManager\Factory\AbstractFactory /** * Create object * * @param string $type * @param array $args * * @return object * @...
3
votes
1answer
526 views

How to get two different search forms in Magento one fulltext and one title search?

I want to do two different search types in two different search forms. I got the head search in fulltext and i created a quicksearch.phtml to edit this as a title only search. Is there a way to set ...
3
votes
1answer
2k views

Magento 2 - Correct way of Module Installation

Trying to install sample module in Magento 2 from this. Below is the module structure app/code/NameSpace/Module/ module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
3
votes
1answer
819 views

Magento 2: Does, and Should, the `crontab` Area Have its own di.xml

Does Magento 2's crontab area load a scoped di.xml file? Or is this no longer used? Or should it be used, but its not being loaded as part of the crontab application is a bug? Or do I fundamentally ...
3
votes
1answer
402 views

SOAP V1 : Empty Response Not recognised

I have this weird situation where SOAP retuns no value but I am not sure how to check whether it has returned any value or not. For example, I am calling SOAP to get product image detail like this: $...
3
votes
1answer
3k views

Include multiple Mage.php into an external script

Is it possible to include multiple Magento (Mage.php) instances into the same external script and run them simultaneously? My idea is to develop an external migration tool between two Magento systems,...
3
votes
1answer
764 views

MySQL get data from Custom table via _prepareCollection

I'm using Magento 1.9.0.1 and i'm working on custom extension. I want to get data from custom table and display it in a grid table in page created by me in the admin panel. Here is the Grid.php file ...
3
votes
1answer
327 views

Assign Simple Products to Configurable

I'm trying to import a lot of Products from my old Shop and therefor I need your help. My items have a "parent" item which was necessary for my old Shop. Example: -T Shirt Batman --T Shirt Batman ...
3
votes
1answer
395 views

ReadyShipper on OS X, Connecting to HTTPS SOAP Endpoint

This is a long shot, but has anyone here gotten Ready Shipper 7.3 working with a Magento SOAP HTTPS (that's S, as in secure) endpoint? If so, how? That is, I've downloaded the ReadyShipper 7.3 ...
3
votes
3answers
10k views

Admin layout file not loading in custom module

I'm trying to load in a block on one of my admin pages in a custom module, but it doesn't appear to be loading. At first I thought it was a handle issue, but I've found out that the handle is ...