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
0
votes
1answer
498 views

Trying to setup magento2 , missing Extension intl. -XAMPP

I'm trying to setup magento2 but this error 1 missing PHP Extension intl. already made me crazy... tried so many solution like edit php.ini : From: ;extension=php_intl.dll To extension=php_intl....
0
votes
1answer
455 views

Magento 2 custom module - get media base url

I use this module and I create a image upload field in my custom module. Everything is okay but I want to get the full url of image in the frontend. How I can do this? if I use this in the Data.php ...
0
votes
1answer
299 views

Memory size error [duplicate]

In my Magento store, I got the below error. Fatal error: Allowed memory size of 2122317824 bytes exhausted (tried to allocate 546563077 bytes) in /home/wanstallscustom/public_html/includes/src/...
0
votes
2answers
406 views

How would I sort this this foreach loop?

This pulls a list of all our category thumbnails and the name. I want to sort it alphabetically.- <?php $category = Mage::getSingleton('catalog/layer')->getCurrentCategory(); $categories = $...
0
votes
2answers
101 views

Show a media attribute

I've created a media attribute, and now i'm triyng to display this attribute to my product view page. I've tried this code below: $hdr_img = $cur_product->getResource()->getAttribute('...
0
votes
1answer
407 views

Magento auto login from external site, same domain

I have problem with logging into magento from my external site. I have done researches about it, and tried several codes on web but after logged in from my external site, it won't automatically logged ...
0
votes
2answers
298 views

How to display child categories a filter

I currently have a shop by filter that displays parent category and sub category, I would like to add a child category as a drop down to the sub, please have a look at the link of what I currently ...
0
votes
2answers
5k views

Not able to install Magento because of these errors: php-pdo-mysql-version-minimum & php-intl-version-minimum

I am getting these error messages when attempting to install Magento using the auto install (installatron) with cPanel. I've setup EasyApache 3 to already upgrade my PHP and MySQL versions but these ...
0
votes
3answers
330 views

Magento Get Different options to select from Options.php

I have a admin back-end options section/module to control few things like upload slider images, site background, banners etc. That is simple cause it just requires xml code in system.xml. I want to ...
0
votes
1answer
200 views

Magento Value '29,990000' has to be numeric

I just updated my zendserver. then when I tried to access /admin on my magento local I get the following error Value '29,990000' has to be numeric I tried to replace $price = sprintf("%f", $price); ...
0
votes
2answers
2k views

Change success page

everybody! I need to add this <img src="//cdsusa.veinteractive.com/DataReceiverService.asmx/Pixel?journeycode=22DB0E55-C091-431A-BA44-C1928F926B50" width="1" height="1"/> To my success page ...
0
votes
2answers
539 views

Move Search Bar (Magento 2)

I want to move the search bar from right to the center of the homepage using xml.
0
votes
2answers
3k views

How to solve 500 internal server error in custom module in magento 2

My php version is 5.6 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_curl.dll' - /usr/lib/php/20131226/php_curl.dll: cannot open shared object file: No such ...
-1
votes
2answers
138 views

Layer navigation problem

<div class="navigation"> <dt><?php echo $this->__($_filter->getName()) ?></dt> <dd><?php echo $_filter->getHtml() ?></dd> </...
-1
votes
2answers
1k views

Custom Design/Layout for Simple Products

I’m trying to customize simple products separate from grouped products. I’ve gone as far as creating a layout in catalog.xml with this code below <PRODUCT_TYPE_simple translate="label" module="...
-1
votes
1answer
40 views

Unable to find a PHP related error in my Magento code

I want to show a switch to my two different store views in the header of my Magento 1.9 installation. So I did some changes in my header.phtml file. Here is the complete file: https://codeshare.io/...
-1
votes
2answers
222 views

How to Have multiple If statements in PHP

I want to add this: <?php if(Mage::getBlockSingleton('page/html_header')->getIsHomePage()):?> To This Statement: <?php if(Mage::app()->getFrontController()->getRequest()->...
-1
votes
2answers
2k views

Composer installation issue for Magento 2 on WAMP [closed]

I'm trying to install magento 2 on WAMP Windows 10. I have downloaded. When i run it gives error Autoload error "Vendor autoload is not found. Please run 'composer install' under application ...
-1
votes
1answer
284 views

do we need PHP encoder or php decoder to install magento extension [closed]

we bought an extension. they gave source files. but some files are in encrypted manner. that extension files are encrypted. they mentioned we need php encoder[8.3] to install the extension in the ...
-1
votes
1answer
410 views

Custom product import script break after 1 product import!

I am using custom product import script to import the simp0le products. I have uploaded almost 40k products on the website. But now, only 1 product import and then the script stop. What is the wrong ...
-1
votes
1answer
213 views

How to hide element in php if condition satisfied?(without css,js)

I have this condition and want to hide the element which is generated dynamically from js file. if(!$config):?> <style type="text/css">.priority-nav .priority-nav__wrapper{display:none;}&...
-1
votes
3answers
737 views

Multiple stores in if get store code? [closed]

sorry stupid beginners questions. I am changing the layout of my homepage based on the store code. Works fine with 1 store but how can I add multiple? <?php if (Mage::app()->getStore()->...
-1
votes
2answers
1k views

Age verification for Magento [closed]

this is an age verification for homepage. <script language="javascript"> var agePrompt=prompt("What is your age?"); if (agePrompt>=18) alert('Welcome!') else { alert('Sorry! Come back in a ...
-1
votes
2answers
82 views

How to check setData() set the value or not

I have $product->setData('phone_features', $avidee); Now i want to check whether phone_feature value set or not.How can i check in magento 2.
-1
votes
1answer
206 views

Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in

Magento 2.2.5 version. Every time trying to go to product page I get error: Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in /var/www/html/app/code/MGS/Mpanel/Helper/...
-1
votes
1answer
67 views

Why am I getting this syntax error?

After migrating my site from M1 to M2 everything is working but the customer grid. I have followed this- "Missing required argument $options" After migration from magento 1.9.2.4 to 2.1.3 ...
-1
votes
1answer
42 views

I am trying these commands but show error in magento 1.9

i am trying these commands listed below but its gives me error again and again. i am also using putty with public key. error is: Could not open input file: commands is: php bin/magento cache:...
-1
votes
1answer
68 views

Value outside foreach

Need value outside foreach My code : $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); $itemsCollection = $cart-&...
-1
votes
1answer
62 views

merge the 2 different codes to get 1 code

we are working on marketplace [multi vendor] site. we are using 2 different types of codes to load the quantity in different places in the site. code 1 : <span id="valueqty_<?php echo $...
-1
votes
1answer
183 views

How to add array values in PHP? [closed]

I want to add array elements price and tax amounts and I have some thing like below for adding. 'price': '{$item['price']}', 'tax': '{$item['tax_amount']}', here i want to add price (price) amount ...
-1
votes
1answer
467 views

How to add class in 2 sets of list items in PHP [closed]

I am facing a problem to make even odd list with add 2 list items in php here is my code: <?php $assets = array('Bag', 'Charger', 'Power Cable', 'Video Cable', 'Mouse', 'Keyboard', 'Test', 'Test ...
-1
votes
1answer
52 views

code line from where zooming is displaying

please visit following link : media.phtml file = http://pastebin.com/gAwfdtw7 i wanted to know from which line of the code the product images are zooming in the following link : http://kidsdial.com/...
-1
votes
1answer
194 views

unable to find slider coding in Magento [closed]

I have Magento website which is using "crappy coded" theme and uses grep for slider. Slider coding is using glider.js. when I validate website through w3c there are some errors and one of them is ...
-1
votes
1answer
2k views

Minify JavaScript and CSS in Magento

I analyzed my website on Gtmetrix.com for optimization and the result was this: There are 9 components that can be minified: inline <script> tag #6 inline <script> tag #9 inline <...
-1
votes
1answer
29 views

Array Get Value in magento2

i want to get profile id from this array [2019-05-21 07:30:24] main.DEBUG: array ( 'url' => 'https://api-3t.sandbox.paypal.com/nvp', 'CreateRecurringPaymentsProfile' => array ( '...
-1
votes
1answer
798 views

Call Controller from Button [duplicate]

I created this button: medienshop-dev/magento/app/code/UV/Bestellung/Plugin/Button.php <?php namespace UV\Bestellung\Plugin; class Buttons { public function beforePushButtons( \Magento\...
-1
votes
2answers
368 views

I get Magento 2 (with Sample Data) installing error(s) and stopping process.. (in 67%)

Module 'Magento_ConfigurableSampleData': Installing data... [ERROR] Exception: Warning: PDOStatement::execute(): MySQL server has gone away in H:\OSPanel\domains\magento\vendor\magento\zendframework1\...
-1
votes
1answer
35 views

Magento2 user logged from php

In magento 2: How can I see the user who is currently logged in from php? and How can I login to a user from code and save it in the database?
-1
votes
1answer
54 views

Php code and html within echo

I'm writing a if statement in which a button needs to show if the cart is empty. For this button I need to get the form key of the product for the data-url So something like this: <a href="#" ...
-1
votes
1answer
40 views

Issue with getting json data

I want to get "scanDetail" array's 1st objects 1st element "Scan": Shipment Delivered details tracking:{ "Shipment":{ "@attributes":{ "WaybillNo":"69561350456", "...
-1
votes
2answers
86 views

How can I get the page title of every product in Magento? [duplicate]

I made a new Controller and inside there a new action. Inside there I want to be able to get the page title and the H1 of every product page. Is this possible? Any help would be appreciated Thank you
-1
votes
2answers
72 views

Customise order file

In this code, i would like to have the stars before the product name. Also how to add line breaks \n How to do this ? <?php $Collection=Mage::getModel('review/review')->getCollection() ...
-1
votes
1answer
1k views

Fatal error: Call to a member function addItem() on a non-object

when i want to start klevu search extension configuration wizard from backend i face this problem. a popup window comes up by this error: Fatal error: Call to a member function addItem() on a non-...
-2
votes
3answers
2k views

how to learn php for magento [closed]

I am a dotnet programmer and new to Php, magento. After some struggle now I m able to understand magento flow (layout, blocks, controllers). Now trying to understand phtml files. I know only some ...
-2
votes
1answer
172 views

how to add 2 attribute codes in if condition

i am using this code in attributes.phtml : <?php if ($_data['code'] == 'mobile_design') { ?> <td class="data"> <?php $_ageValues = $_product->getAttributeText($_data['code']); $...
-2
votes
1answer
54 views

Cannot able to create invoice in magento 2.2.7?

After installation of Magento 2 GST extenstion, I try to create an invoice from the admin. But it showing error as cannot create an invoice. This issue reported in github
-2
votes
1answer
31 views

Create magento different language store [closed]

I have created two different stores for different languages on Magento 1.9. But, I am unable to see language drop-down at the frontend. Please guide me
-2
votes
1answer
47 views

Magento product view page menu hide only specific product only

how to remove components menu only in this page . where i find this page.
-2
votes
2answers
198 views

Change category tree output

I try to generate a nice unordered list from a specific parent category ID with the following code: <?php $cat = Mage::getModel('catalog/category')->load(6); $subcats = $cat->...
-3
votes
1answer
114 views

Can I create ecommerce Website using plainphp + soap API + Magento

Can I create eCcommerce Website using plainphp or any php MVC framework + soap API + Magento