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
57 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 ...
1
vote
3answers
71 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?
1
vote
0answers
23 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
45 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
99 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
1answer
35 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
97 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
1answer
73 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 ...
1
vote
1answer
54 views

PHP: remove all before last slash

I need to remove all text from url before last slash / $url = https://example.com/aaa/bbbb/ccc/ttt/img.jpg The output must be img.jpg Also note /aaa/bbb/ccc/ttt in not the same must use regular ...
0
votes
1answer
39 views

Magento 2 | How to include a class from a seperate PHP File

I'm currently coding a module and I got a PHP File which has nothing to do with Magento. This is my structure: - My --- Module ---- Observer ------- MediabaseObserver.php ------- vuxml.php I want ...
0
votes
1answer
32 views

Magento 1.9.3.8 insert fields in one step checkout

I have magento 1.9.3.8. I use amasty customer attributes and one step checkout. In out theme's folder I have added layout files for these attributes and a new customer attributes phtml file with this ...
0
votes
1answer
29 views

getting “Consumer is not authorized to access %resources” when using rest API in magento2

AUTH REST API: if(isset($_POST)){ print_r($_POST); $email=$_POST['email']; $pass=$_POST['pwd']; //$email='memotest@gmailtest.com'; //$pass='memo@123'; $userData= array("username"...
0
votes
0answers
18 views

Magento 1.9.2 - Set Position Order when i call getAllIds() for an attribute options

I tried to sort all the options of a specific attribute after calling the getAllIds() function. The error that brings me back is: setPositionOrder () can not call in array. I also tried to insert ...
0
votes
0answers
15 views

magento 1.9 detach simple product associated to a configurable and assign to another configurable

How to detach simple product associated to a configurable and assign to another configurable in php. For example to attach a simple product to a configurable I use this code: Mage::...
0
votes
1answer
29 views

Magento 1.9.2 - I do not want to show username, password, host and port in PHPMailer using SMTP

At the moment we have this code to send emails with phpmailer via smtp. How can I make it work without showing username, password, host and port? I do not want to show my credentials in the file : ...
0
votes
0answers
38 views

Fatal error: Call to a member function add() on boolean

When I enter an admin page, it will only appear. Fatal error: Call to a member function add() on boolean in */app/code/core/Mage/Admin/Model/Config.php on line 101 public function ...
0
votes
0answers
18 views

magento 1.9 ORM data are different from SQL data

I have added a new attribute with this code into the install script: $this->addAttribute( Mage_Catalog_Model_Category::ENTITY, 'macro_path', array( 'group' => 'General ...
-1
votes
0answers
23 views

Magento 2 : How can i add thumbnail of ordered product in order grid of admin?

I am trying to add a thumbnail of ordered product in grid. But i kept failing. Can any one help me with this issue?
0
votes
1answer
31 views

Magento 2 - Add Size Chart issue

I try to add Size Chart block on product view page in Magento 2. I add this code in catalog_product_view.xml <referenceContainer name="product.info.main"> <block class="Magento\Catalog\...
0
votes
0answers
27 views

Magento (1.3) Error after migration

we have an old magento with 1.3 version with php 5.3 (we're working on its magento 2 version), but for now I migrated it from a server to another because we have to keep it online, where the new ...
1
vote
0answers
14 views

Create custom extra new field in Magento 1.9 admin panel

I'm trying to add one more one more field to upload aadhaar card image. I tried doing it by adding attribute but it didn't work, And also I tried to duplicate the below code in /app/code/local/...
0
votes
0answers
8 views

Limit Tag cloud with a given amount for Magento Blog sidebar

Looking to adjust this code to make it only show a number of tags in the tag cloud <?php foreach ($tags as $tag): ?> <li<?php if (--$tagCount < 1): ?> class="last"<?php endif;...
0
votes
1answer
20 views

How can I manipulate SOAP request output?

I'm using the following soap function to pull my Magento category tree: <?php $client = new SoapClient('http://bennettcode.com/store/index.php/api/soap/?wsdl'); // If somestuff requires API ...
0
votes
1answer
24 views

Magento 1.9 pagination url issue

I have change the pagination URL from p to page like below: magento/test.html?page=1 But when I click on any pagination, product page shows same product on every page. If I change from page to p ...
0
votes
1answer
28 views

Magento 1.9 - Foreach for sum values is not correct

I recollect the question because I explained myself badly in the previous one. I have 40 clients in my Magento and I have created a custom attribute (input text) called attribute2. Only 3 customers ...
0
votes
1answer
93 views

magento 2 setup:install error

all. I'm using MacOS High Sierra. I have so many problems with installing magento 2. For example: now I need use command : bin/magento setup:install --admin-firstname=pavel --admin-lastname=konchych ...
0
votes
1answer
37 views

Trying to get filterable attributes of product collection

I am trying to get filterable attributes of product collection after applying filter to it programmatically. same as layered navigation idea after I apply filter to category, it just return ...
1
vote
0answers
41 views

php Out of Memory error when refreshing report statistics

I have recently upgraded from Magento CE 1.9.2 to 1.9.3.10. Since this we get the following error when Reports>Refresh Statistics is used: Fatal error: Out of memory (allocated 1808531456) (tried ...
0
votes
2answers
40 views

Theme displays on localhost and not on domain server, please help!

For some odd reason my theme is not displaying on the live server but on the localhost it shows perfectly fine. What could be the cause of this issue? Thanks in advance!
0
votes
1answer
33 views

How to update a field in a post array Magento 1.9

I have a custom field value that gets set at checkout form . I want to update that custom field from the post array. I`ve tried getting the current value and then setting it to a new value. $...
2
votes
1answer
37 views

PHP Online refund in Firstdata payment gateway (Payeezy)

I have implemented the Firstdata payment gateway for online payment. It is working fine. Now I want to implement the online refund functionality. If anyone provide me the sample script for Firstdata ...
0
votes
1answer
18 views

make a category branch undeletable

I would make a category branch undeletable, my idea is to use an observer on the events catalog_category_delete_before and catalog_category_delete_after. On catalog_category_delete_before the branch ...
0
votes
0answers
15 views

Magento 2 : LayeredNavigation plugin never called

I'm trying to override the function canShowBlock() in the Magento\LayeredNavigation\Block\Navigation block. I'm using this plugin but it's never called : di.xml <?xml version="1.0"?> <...
0
votes
1answer
43 views

Get tracking Id magento 2

I want to Get Tracking id when shipping the order, For it, I use "sales_order_shipment_save_after" Observer. And I try but I got the blank array. My code is $shipment = $observer->getEvent()->...
0
votes
1answer
26 views

Magento 1.3 requirements

I have an old website that runs magento 1.3 and i'm trying to move it to another server, but I can't find the system requirements of magento 1.3. IT's currently using php 5.2, I'm wondering if it ...
1
vote
1answer
29 views

Magento 1.9.3 International Phone prefixes

Hello I would like to get help on adding the country code as prefix (+44, +234, +233 etc) in magento. I am currently using 1.9.3.2 version.Thanks
0
votes
0answers
43 views

Magento 1.9 problem set category ids to product

When I try to set category ids to a product nothing happen, I use the method setData( 'category_ids' ), I cannot use the method setCategoryIds beacuse I built an observer on ...
0
votes
1answer
16 views

Is this the correct way to write a constructor that extends this other PHP file?

I am using Magento 2.2.6. The file I am extending is \Magento\UrlRewrite\Model\Storage\DbStorage. It has the following constructor: /** * DB Storage table name */ const TABLE_NAME = 'url_rewrite'; ...
0
votes
1answer
75 views

How to cancel Magento order programmatically

I want to change the order status to 'canceled' when payment failed. I've tried the code below but the order status gets saved as processing: $orderId = $number8; //order id $order = ...
0
votes
0answers
14 views

Magento 1.9.2. - Dashboard: Add each month as a date range of current year in the order report

Now I have the standard Magento filters but I would like to see the reports of orders of every single month of the current year. I tried to edit function public function getChartUrl() in Graph.php, ...
0
votes
2answers
29 views

Upload large files from system config not working

I'm trying to Upload a zip archive to media from System/Configuration but when I choose a large file (e.g. 35MB) it redirect to Dashboard and I get the error Invalid Form Key. Please refresh the ...
0
votes
1answer
30 views

AED-SAR and SAR-AED currency Switching magento 2.1.7

I have 4 currency (AED, USD, GBP, SAR) in my store AED is my base and i have 2 store (English and Arabic). All the currencies working properly but when i change AED to SAR or SAR to AED it's not ...
0
votes
0answers
14 views

Magento 1.9.2. - Join eav customer attributes table with all its values

I have joined the eav / config table to pick up a specific attribute (created with Attribute Manager) connected to the customer id. But now I would like to be able to get all the attributes from that ...
0
votes
0answers
41 views

Prevent order save if any error occurred

When a client selects place order button at the end of checkout, in my model i have code if any errors occured with posting if an error occurs how do i prevent the order from being saved. currently ...
0
votes
1answer
23 views

Magento 1.9 Google site map generation 404 error

I'm using magento 1.9.x version, recently i tried to generate google site map via Catalogue - > Google Site Map But it gave 404 error Then i checked the code and identify the location of error ...
1
vote
2answers
40 views

Turn developer mode off in Magento 2

I need some help, my websites are showing the key after the url. So i thought it is still in developer mode and need to be turned into production mode. I checked the magento file in folder bin, but ...
0
votes
1answer
53 views

Magento 2 Tooltip not working in phtml file

<?php $_content = '<img src=\"' . $block->escapeUrl($block->getViewFileUrl('Magento_Checkout::cvv.png')) . '\" alt=\"' . $block->escapeQuote(__('Card Verification Number Visual ...
1
vote
2answers
133 views

How can we pass table to an html variable in php code? Magento2 TCPDF

I am using TCPDF Library to get PDF Downloadable. I have to pass retrieved data through loops to single vaiable as: $tcpdf->writeHTML($html, true, false, true, false, ''); I have to pass these ...
2
votes
1answer
56 views

How to use GrumPHP with Magento2?

I would like to use GrumPHP with my Magento 2, to be able to run simple verifications during my development, how can I do that?
0
votes
0answers
19 views

Magento 2 Admin section Newsletter Subscribers not visible

Magento 2 Admin section Newsletter Subscribers grid not visible. I see this http://prntscr.com/l57dma, though I have subscribers (I see in database). I disabled all (not magento core) modules, and ...