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

Export Category name in xml feed Magento 1.9.2

I have the script below for exporting product xml feed for magento 1.9.2 The problem is that I cannot export the category name for each product The scipt is: require 'app/Mage.php'; Mage::app(); $...
0
votes
0answers
11 views

Magento 2 - (Shipping Address) Custom city dropdown validation not working in checkout page

I followed this link. I created a custom shipping method and I need the city to be required for my shipping rates to be calculated. My problem is my shipping-rates-validation doesn't get trigger it ...
0
votes
0answers
8 views

Magento 2.2.5 Class 'IntlDateFormatter' not found

I'm running ubuntu 18.04, using php7.0 and i get this error even though i installed all the extensions while installing magento, is there anyway to fix this, php -i | grip intl shows /etc/php/7.0/...
-1
votes
0answers
15 views

How to pass the shipping and order data to another url after payment [on hold]

We are using Magento 1.9.2 in our website. How to pass the order data to another url after placing the order?
0
votes
1answer
41 views

Magento 2 - Add subcategories images in Top Navigation Menu

I want to add subcategories images in Top Navigation Menu, I found this module but display only parents categories, I need to be on subcategories. I want to be like this:
4
votes
1answer
87 views

Why does adding constructor parameters require my to clear /generated

I'm using Magento 2.2 in development mode. I have a controller class class MyController { public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\...
0
votes
0answers
7 views

Magento 2 user field validation using an API

In a dedicated data table where we stored customer's privilege card number in order to validate them with users that they enter to a field called "privilege card no" On such an occasion I'll have to ...
0
votes
1answer
14 views

What are the preferred server resources needed to run a magento 2 ecommerce site? php memory limit, virtual and physical memory? ,

When updating magento to 2.3, warning was given to set php memory to a minimum of 2048. Wondering what the preferred settings/resources are and if hosting on a shared server is fine.
0
votes
0answers
27 views

How to create a custom discount “Gift card” in Magento 1.9 at cart page

The functionality will be = Enter Gift Card number(16 digit) Enter Gift Card Pin(6 digit) Enter Amount(amount entered by user) I have already created the above mentioned input fields in the cart ...
0
votes
1answer
21 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
25 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
8 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
37 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
2answers
47 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
9 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
16 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
32 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
11 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
55 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
40 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
50 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
49 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 ...
4
votes
0answers
115 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
1answer
86 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
34 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
54 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
24 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
40 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
32 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
12 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
22 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
21 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
20 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
23 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
29 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
10 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 ...