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
1answer
5 views

Migration from 1 to magento 2

I am trying to migrate a magento 1 to magento 2. Both database are on my local system. When I run the migration tool I don't get any error messages but when I check the products in the magento 2 ...
0
votes
1answer
21 views

Magento 2.3.0 - Create Product Page H1 title with product name and attribute name

I have created two phtml files that can be called from within a CMS Block on a product page to echo the product name and an attribute name. As follows: Product Name {{block class="Vendor\...
0
votes
0answers
6 views

Magento 1.9.2. - foreach remove duplicate from options attribute value

I'm pulling out all the values ​​of the color attribute of the products associated with the product configurable with this foreach. foreach($simple_collection as $simple_product){ echo $...
0
votes
2answers
31 views

Magento 2.3.0 - Add custom block after product description tabs

I've created a CMS block called km_product_page_short_description I want to call this CMS block in a custom block below the product description tabs (where the blue line is) as shown in the ...
0
votes
1answer
29 views

How to use require_once in magento 2

I'm trying to include a PHP class in magento 2. I use a require_once and create a folder lib in the root of my module and there I put the folder that contains the class lib/Meli/Meli.php Also try in ...
1
vote
0answers
7 views

Sub Category - Load By Attribute (name) URL issue, how to resolve?

Mage::getModel('catalog/category')->loadByAttribute('name', $val)->getUrl(); The above code won't work correctly in my PHP code when I have multiple categories & sub-categories with the same ...
0
votes
1answer
13 views

How to catch exeption in unit test and check it

I have a model class, that throw exception if some value is null. How I can test, that it condition is ok. $contact = $this->contactFactory->create() ->setEmail('testdelete@...
0
votes
1answer
14 views

How to get products from wishlist using customer id

Magento 2.3 PHP 7.1 I trying to get products from customer wishlist in Model but $products array is empty. $products = []; $items = $this->wishlist->loadByCustomerId(1, true)-&...
0
votes
1answer
28 views

Magento 2: Get Order Info From Invoice

Using Magento 2.3, I'm trying to get a custom attribute from the order and save it to the invoice when the invoice is first created. I already have the custom attributes setup and saving to the ...
0
votes
0answers
9 views

How to edit category in Magento 1 using PHP using path (Not ID)

I need to be able to revise Magento 1 categories externally. When products are created using Magmi it creates the category, during the process, I store the path used to create the category. I want to ...
1
vote
2answers
51 views

Magento 2.3.0 Get product attribute name in phtml in CMS Block

I have a attribute called Artist It has several artist names XYZ ABC RST I need to be get the artist name associated to the current product page via a call to a phtml in a CMS Block. What do ...
0
votes
0answers
32 views

Quantity not getting validated (the way it should) for numbers between 1 - 9

I have problem with quantity increments, unable to increase the quantity for a product in the cart by increasing the quantity number in the input field, the input field for quantity does not seem to ...
1
vote
1answer
16 views

Magento 2: Admin user with restricted access can access everything via API?

I have created an admin user to manage my orders and granted the access for order view action only. (as below) But the user can generate token via API and access all order i.e view, delete, etc ...
0
votes
1answer
45 views

Magento 2.3.0 Get Country Name

I'm trying to insert the current store country name through a CMS Page/Block by following this article. I've created a Block file countryname.php in app/code/Vendor/Countryname/Block with the ...
1
vote
0answers
10 views

Generate xml php code problem

I am using a php script to generate an xml from my magento 1.9 to a comparison engine. I have a field in the engine called mpn which need to be filled from my product's SKUs $aData['id']=$iProduct; $...
1
vote
3answers
47 views

Fatal error: Uncaught TypeError: Argument 1 passed to

I just cloned a project from git, everyting ok, when i enter to a module name kardex i found this error, the thing is that this error only appears to me in my project, not happen in another cloned ...
1
vote
2answers
18 views

Magento 2 + How to import the custom city collection from the database into a dropdown (for the city textarea)

I'm a bit confused with creating a city dropdown with my custom cities. I have already imported the cities into a table and also created the Model, ResourceModel, Collection. Now I need to get those ...
1
vote
0answers
53 views

\Magento\Framework\Registry deprecated in magento 2.3, How to create instance with Registry?

/** * Registry model. Used to manage values in registry * * Registry usage as a shared service introduces temporal, hard to detect coupling into system. * It's usage should be avoid. Use service ...
0
votes
0answers
58 views

Magento 2.2.6: Error after upgrading to Magento 2.3.0

Just updated from M2.2.6 to M2.3.0, everything seemed to go without a hitch, but after loading the front-end of the website I'm seeing the following error: Exception #0 (BadMethodCallException): ...
0
votes
1answer
33 views

How to Solve Wamp Server - 3 Showing Code Instead of Execute in Windows?

My wamp server showing source code instead of excute? Any help?
0
votes
1answer
13 views

Problem with my cron in custom module in magento 1.9

I am unable to call cron into my model using this xml. Please suggest be a way. app/code/local/Rkt/Crons/etc/config.xml <models> <cronscron> <class>...
0
votes
3answers
51 views

Get Store Information Magento 2.3.0

Using Magento 2.3.0 with php7.1 I'm trying to use this module to get store information. I have modified the folder names as such app/code/Vendor/SiteInfo/Block/SiteInfo.php And used the following ...
0
votes
0answers
6 views

Magento 2.2.5 Mysql add a coupon cart rule to customers account

I am looking to programmatically add a coupon code to a customers account so next time they come to the site and login to there account there will already be a cart price rule automatically applied to ...
0
votes
0answers
20 views

Static version pub/static/versionxxxx increases everytime I load the page

When I do static:deploy, the version text file is written in pub/static. When I repeatedly load the website and look at the source, the version number on the link is growing each time. I checked ...
0
votes
1answer
37 views

Magento 2 - Transactional email templates

How I can get Sales Representative Contact Email in a transactional email templates? I try to add something like this but the href is not display: <li style="background: black; color:white;"> ...
0
votes
0answers
22 views

Magento2 - Add Custom fields block after shipping method

Want to add custom fields after shipping method at Magento 2 checkout page. I have created custom module with checkout_index_index.xml and able to add custom fields block at after shipping address ...
0
votes
0answers
28 views

I need theme similar like Murals website uses

I need to create one project similar like this website https://www.muralsyourway.com/, so it needs to have same features like this one, people able to sell their murals and able to create one of their ...
0
votes
0answers
42 views

Magento2. Problem with cron when i run cron job by clicking on the button

I have buttons. When I click on them, I start the cron job. Cron works, everything is fine. But I ran into the problem that at the same time the file through which I run the load until the work of the ...
0
votes
1answer
17 views

Payment method buttons sometimes work sometimes no

I need a little help, sometimes the buttons of the method payment doesn't work, I can't find what is going on, in the most of the cases they work.
0
votes
0answers
11 views

how to setup cron job in magento 1.9 in localhost

I am a beginner to Magento. I am struggling to run my custom module for every regular intervals of time. I want to run cron job in my Magento site. Please give me complete knowledge about this.
0
votes
2answers
21 views

How to override order sales model in magento 1.9

I have stuck with this. I am trying to override sales/ order model _saveafter function with my custom module. I have the following code \app\code\local\Rkt\SalesNew\etc\config.xml <modules> ...
0
votes
1answer
20 views

Regex for starting with character and rest all are digits

I want a regex of length 13 in which starting word is a alphabet and rest 12 entries are digit. Something like this : A123456789764
1
vote
1answer
18 views

change layout in magento 2 before page load

I am trying to change a page layout before the loading of a page in magento 2. I want this layout to be loaded on the base of configuration. If you have any example available feel free to drop it in ...
0
votes
0answers
5 views

setcookie() issues on running with HTTPS on WordPress [migrated]

I have set 2 custom cookies to be saved when user clicks a button that runs the script to save the cookies. The issue is that I need these to be saved through HTTPS because I am using them on a store ...
0
votes
0answers
16 views

Invalid Form Key. Please refresh the page. while submiting form

i'm using magento 2.3 and got this error while i try to submit a custom form in a product detail page, have tried to increas max_input_vars option in php.ini but it didn't solve anything, any other ...
0
votes
1answer
12 views

magento 2 get multi valued attribute field values of product

I want Dealer store view attribute value of product. I have tried this $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $eavConfig = $objectManager->get('\Magento\Eav\Model\...
0
votes
1answer
27 views

Magento 2 Error: Class does not exist

I see this error 3 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Crediya\Minicalculadora\Block\Data Exception #1 (ReflectionException): ...
0
votes
1answer
11 views

How can I add icons login in Magento Homepage header?

How can I add icons social and login in Magento 1.9 Homepage header?
0
votes
0answers
17 views

How to run query subdate(now(), INTERVAL 1 DAY) in Magento Helper

in Magento 1.9 Community, I have this query created_at >= subdate(now(), INTERVAL 1 DAY) Group By product_id order By sum(qty_ordered) desc How do I do this in Helper/Data.php? Currently this is ...
0
votes
1answer
9 views

Make og:title propercase Magento 2

Issue My client has added their product titles in UPPERCASE, and as such the og:title property is also in uppercase. For example: 'MY T SHIRT' Current Code <meta property="og:title" content="<...
0
votes
0answers
17 views

Magento 2: Getting Product By Id Dynamically

So it may be a basic question, But I would love to get answer for this, I'm using fresh installation of Magento 2.3 and set up route for products which gets them in a list now my goal is to when I ...
0
votes
0answers
6 views

Compare date of productstock not working in Magento 1.9

I currently use the following code, to check if the $productEta is in the future, based on the date of today. But that is not working well. Its a dynamic code, so I will provide the entire code: $...
0
votes
1answer
4 views

CollectRates check all radio buttons

im making a shipping extension. All the things works great but one thing no. My collectRates function who is responsible to show all shipping methods on the frontend is checking all. Code: /** * @...
0
votes
1answer
21 views

Installing Google recaptcha:2.0.0 on Magento Open Source 2.2.6

Included in Magento documentation the following steps to install Google recaptcha:2.0.0 on Magento Open Source 2.2.6: Install Module: composer require msp/recaptcha:2.0.0 Enable Module: php bin/...
0
votes
0answers
36 views

Need to remove Currency name(ie \gdp or \usd) from url in magento

I am new to Magento 1.9 I m trying to remove currency name from url and at the same time setting canonical url
0
votes
0answers
32 views

Php script for import configurable products from csv

I need to import a lot of products. So i want to use a script. So if you have any script to do that can you share the whole php file?
1
vote
1answer
20 views

Calculating average price of specific products over time

I'm trying to create a graph that will show the average price of specific products on my site over a period of time. What I'm struggling with is coming up with the most efficient query to use, in ...
0
votes
1answer
65 views

Magento-CE 2.3.0 installation error on Xampp

Error in Installation: [php7:error] [pid 10084:tid 1952] [client ::1:53679] PHP Fatal error: Uncaught RuntimeException: The path "C:/xampp/htdocs/magento/lavoska/generated/code/Magento/...
1
vote
0answers
18 views

How to modify part of the design of the details of the article magento 2?

I want to be able to modify a part of the page of the details of the products of magento 2 The marked part is the one that I want to be able to edit, add or remove content is that section. So far I ...
-1
votes
0answers
16 views

Magento 2 Braintree Card Payment integrate with react native app

I try to use Braintree Card Payment extension from Magento 2, but I can't find a solution. If I use card payment from magento web theme, it works fine. But if I make endpoint requests (I use magento ...