All Questions
68 questions
12
votes
7
answers
49k
views
Magento2 : How to get product id to my custom module
I am new to magento2 and currently I'm building a custom module and i want to get the product ID/SKU from the catalog.
I'm trying to call using a function located in the Block folder. please advise!
10
votes
1
answer
3k
views
Magento2 : How to hide a Product from a specific Customer Group?
I want to create an extension that will hide a product from a specific customer group.
5
votes
2
answers
18k
views
How do I modify Magento rendered page before it's displayed?
I am trying to modify the rendered page content before it's displayed to the user. I would like to do this in my custom module.
So far, I have tried hooking into the cms_page_render event but:
it ...
5
votes
0
answers
722
views
Custom Model Relationship (CMS Page + Product)
I am trying to assign a Product Object to a CMS Page Object, so when you have the CMS Page Object, you can do something like this:
$product = $page->getProduct();
I have modified the CMS Page ...
4
votes
1
answer
5k
views
Magento 2.2.6 - Change the product name title
how I can change products name attribute. I create a new attribute second_name and I assigned to all products, now I want this attribute to replace the default name attribute. I need to change this on ...
4
votes
1
answer
1k
views
Magento2 - Product Collection with custom condition
What is the best practice for adding custom condition of following collection?
Category view detail page product collection
Search page product collection
Give me some advice for that. How can I add ...
3
votes
1
answer
1k
views
XML Module Product Page custom options.phtml problem
I've a module in magento which is creating a new view of the product page, by calling a new options.phtml file.
the problem I have is that if I call, via ajax, this modified product page view, with ...
2
votes
2
answers
5k
views
Multiple product model rewrites
I have two custom modules: ModuleA and ModuleB.
Each one rewrites Core Product Model via:
<global>
<models>
<catalog>
<rewrite>
<...
2
votes
1
answer
861
views
How to get the product ID in Magento 2 plugin
Hi all I am using Magento 2 and I want to get the product Id on all pages.
Now i amable to get the product id in product details pae (Product single page). but i am not getting those in product ...
2
votes
1
answer
5k
views
Add custom textarea field to product form (admin)
I want to add a custom product attribute to the product form in the admin area.
https://devdocs.magento.com/guides/v2.2/howdoi/customize-form-configuration.html and https://devdocs.magento.com/guides/...
2
votes
1
answer
927
views
How do you create a link to BOTH the product frontend and backend from the sales order page?
We are looking to create a link to the frontend of a product and the backend of a product from the "items ordered" area of the sales order page. We have the code to create both, but not from the same ...
2
votes
1
answer
2k
views
Magento 2 : How to add a product grid (assign product) in custom module using UI Component?
I want to add product grid (assign product) in my custom module using UI Component.
I follow this ANSWER:
Magento 2 : How to add a product grid in custom module using ui component?
and I get the ...
2
votes
1
answer
265
views
Order per product unit or per box
This is what I'm trying to achieve:
I have 2 radiobuttons:
1. Order per item
2. Order per box (6)
Under those radiobuttons, theres a textbox. People need to fill the amount in that field. When I ...
2
votes
0
answers
34
views
Product feed with 2 Facebook Page
I have the Facebook Ads extension plugin with Magento.
I already have it configured with one Facebook Page with the product feed.
Is it possible to add another page and a second product feed? The two ...
1
vote
1
answer
957
views
Magento 2: Overriding addtocart.phtml for Configurable Products
I've create a module and overriden addtocart.phtml to replace the 'Add to Cart' button with 'Preorder' when the Preorder attribute is set to 'Yes'.
This works well on simple products, but I cannot ...
1
vote
2
answers
1k
views
Adding Product Backend URLs on the Custom Grid
I have a custom grid, where I need to add links to Product Edit pages on back-end.
I was able to get product front-end URLs using a renderer, but can't get the product links on back-end.
I have ...
1
vote
1
answer
483
views
Custom Module to turn product page into homepage
I have a "Today's Deal" product that changes automatically every 24 hours. It's the only product in the "Today's Deal" category.
I want the product page to be the homepage but i can't get the module ...
1
vote
2
answers
2k
views
Magento 2: How to completely hide price from the store
I want to completely hide the price from the store. Be it in the catalog, product, minicart or cart. I need to do this through a custom module.
Any help is appreciated. Thanks!
1
vote
2
answers
1k
views
How to include custom JS to admin create new product in magento 2
I want to include custom JavaScript to create new product form.
I already try with below way
Using XML way.
app/code/Namespace/Modulename/view/adminhtml/layout/index_index_add.xml
<head>
...
1
vote
1
answer
1k
views
Fetch details from catalog_product_flat_1 table
In catalog_product_flat_1 table, we created a custom column custom_uid & saving customer ids
Assume below image is the catalog_product_flat_1 table. You can see the columns contain Product name ...
1
vote
1
answer
30
views
Where do you place code that effects ALL Products or Customers in the backend?
Hey everyone I know the title is vague so I will clarify here.
I have code that updates Customer attributes and Product attributes.
Unfortunately you guys are all going to frown upon me because I run ...
1
vote
1
answer
501
views
Magento 2 - Getting order information
I'm working on creating a file that I can use to send any orders received on a particular day via a post API call. Magento's code appears to have changed dramatically now so I'm finding getting ...
1
vote
2
answers
1k
views
Can't see existing product attributes in backend
There's an attribute which has been assigend to an attribute set and there's a product using that set.
I have successfully created attributes and added them to attribute sets. However, when I create ...
1
vote
2
answers
3k
views
Show two product in home page using my custom module
I have created my custom module. It works fine. But now i want to show two/three simple product in my home page using my custom module. can I use helper or block? which will more efficient or easy to ...
1
vote
1
answer
1k
views
Create a Bulk products using rest api with rabbitMq custom queue in magento 2.3 beta
How to publish message to rabbitmq and read message in consumer and create a bulk products in magento while running custom queue in rabbitmq.
I want to create custom module in magento 2.3 beta to ...
1
vote
1
answer
2k
views
magento 2 unable to set the values for product collection using service contract from custom module?
I am trying to form a custom format for product collection(getList) using service-contract concept in magento 2 i am able to add keys but i am unable to add values to the response object can you ...
1
vote
2
answers
484
views
update Programtically created Product
We have 2 buttons in Product view page, after we click on 1st button, we creating Product Programtaically.
once click on 2nd button [ after entering email, password] we are assigning that product to ...
1
vote
4
answers
2k
views
Overriding Mage_Catalog_Model_Product_Type
I am trying to override a model file.
The file location is: core/Mage/Catalog/Model/Product/Type.php
I am trying to show only simple products when creating a new product but it is not working.
...
1
vote
2
answers
138
views
Increase level zoom
How could I increase the level zoom on this store?
https://comerciomix.com.br/100-canecas-de-acrilico-de-400-ml-sem-personalizac-o.html
I have the options on backend (we use Prozoom module) to ...
1
vote
1
answer
694
views
Call current product in custom phtml file in Magento 2
On the product page I created a custom module to override the form.phtml file.
I also added the option to include a new file called customFile.phtml when the user clicks on a button that is positioned ...
1
vote
0
answers
214
views
Magento2 Multiple product chooser
I need a multiple product chooser for a widget. Can anyone please help me with some directions how can I implement something like that?
1
vote
1
answer
122
views
Custom Magento module config.xml not loading after applying security patch
I've just applied the security patches on Magento 1.9 and after that, my custom modules didn't work. I tried clearing the cache and index but nothing happened. When I tried visiting the URL of my ...
1
vote
1
answer
656
views
Magento 2 - Move swatch-options at the bottom
I try to move swatch-options in the product page at the bottom of the page, before "Write a review" zone, I use this code:
<move element="product.info" destination="content" before="product.info....
1
vote
2
answers
162
views
Magento : Replace Discontinued Product with New Product
I making observer, that detects when someone reorders a discontinued product and should replace that product with a new product.
My question is: How do I retrieve a product object with a specific ...
1
vote
0
answers
489
views
magento 2.1 grid on custom tab of admin product edit page
I am trying to create a grid that should be shown on clicking a custom tab of admin catalog edit page.
1. Created catalog_product_new.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
0
answers
400
views
How to save custom attribute in Magento module
I have this hidden input that I am submitting along with my checkout form:
<input id="text_value" type="hidden" value="This is a test Value" name="text_value"></input>
I was wondering ...
1
vote
0
answers
85
views
Group simple product with fixed price, without qty and user selection option
Is it possible to combined together simple product with fixed price, without qty and user selection option, Custom Option??
Wanted to have feature like grouped product but without user interaction to ...
0
votes
3
answers
55
views
Preference Module - When to Pass in Parent Dependencies
I am currently creating a preference module to add additional functionality to \Magento\Catalog\Model\Product and in reviewing some of the tutorials, example below, I noted that dependencies weren't ...
0
votes
1
answer
680
views
How to set special price on all stores?
I want to programmatically set special prices on products. The below code works perfectly for 1 store view. But I want to have the special price to be applied to the "All Store Views" scope.
...
0
votes
1
answer
44
views
Product name change
Is there a way or a program etc that can help to change products on 50k products in an easier way than Excel or do it one by one in Admin?
Thanks,
0
votes
1
answer
46
views
updating product description via coding correctly shows text on product page but admin side's edit description with pagebuilder shows old values?
In my custom module, I am able to set the description of an existing product successfully using the code below & the product url shows correct output for description:
$product = $this->...
0
votes
2
answers
620
views
add custom tab in product page
Is it possible to add custom tab in product page remains in custom module(with out changing template of theme). if it's not possible help me in extending template of theme to adding custom tab in ...
0
votes
1
answer
448
views
Magento 2 - How I can get category for related products
How I can get categories for related products like in the following image:
I use this code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('...
0
votes
1
answer
2k
views
Pass the value from the block class to the phtml file and not working in custom module
Hi all I need your help,
I am writing a new module (quote request, when user go to the product details page, they can request a quote for the product)
I created a form and display in the product ...
0
votes
1
answer
39
views
Magento Module not loading. Codepool local [closed]
I am trying to make a module to hide product types when tryng to create a new product.
I have created the files as follows:
app\etc\modules\Grando_Producttype.xml
<?xml version="1.0"?>
<...
0
votes
2
answers
728
views
Change "add to cart" button depending on customer group and attribute [closed]
A while ago, I asked this question and the code is working fine. I can change the "add to cart" button depending on the value of a yes/no attribute.
What I'm trying to achieve now is to create an if/...
0
votes
2
answers
2k
views
How to get product zoom extensions to work in custom theme?
I worked with the default theme as base an am slowly implementing my own theme on top of it by overriding it (as is recommended).
Now, I'm currently trying to install extensions that change how ...
0
votes
1
answer
48
views
rearrange more information & details tab in product details page in product details page
I need to change the default tab on product details to be more information tab, i make this edit in vendor, i replace this code
<block class="Magento\Catalog\Block\Product\View\Details&...
0
votes
0
answers
2k
views
main.CRITICAL: Error: Call to a member function getId() on null
I'm using Magento 2.4.3 and I'm loading a custom module using someone else's code from the link
https://community.magento.com/t5/Magento-2-x-Programming/Magento-2-Product-Reviews-only-by-customer-who-...
0
votes
1
answer
51
views
Any free extension for displaying top rated products in magento 2?
I like to know is there any free extension or module for displaying top rated products in magento 2?