Questions tagged [phtml]

Denotes questions related to template `.phtml` files

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

magento 2.2.3 how to add a new cms block or new phtml to product page

I want to add a new cms block or PHTML to the product page. I have the following files composer.json, etc/module.xml, and registration.php I have view/frontend/layout/catalog_product_view.xml &...
1
vote
2answers
21 views

How can i translate custom elements in .phtml file according to store view

I have added a tag in form.phtml file which shows on view Cart Page. <h1>Custom Cart Information</h1> which effects as Hence my store is multi-lingual when i change store view to ...
3
votes
1answer
26 views

How to override phtml file in module?

I am trying to change "sign in or create an account" message which is called by block named product.review.form in catalog_product_view.xml. /vendor/magento/module-review/view/frontend/layout/...
0
votes
1answer
53 views

Where to find Magento Configuration files

I'm trying to change a default setting in Magento, and I have found the solution how to change it. The issue is I can't find the file, I need to modify items.phtml. The path is app/design/adminhtml/...
0
votes
1answer
30 views

$block is not working in override phtml file

I override totals.phtml, but when I am calling my custom block in it, its not working. File path: Magento/vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml Override File ...
0
votes
0answers
20 views

How do I get the value of a property in my product on my phtml file?

Im looking at my theme/Magento_Catalog/templates/product/price/final_price.phtml and I am trying to set up a conditional so that when a custom field that another developer built in as a dropdown is ==...
0
votes
1answer
32 views

How not to use ObjectManager in phtml from template

First a bit of context, and at the end, my question I added an EAV attribute to my customer. It's an attribute with multiple values, and I want to add it to the account information (for reasons). I'...
0
votes
1answer
25 views

how to add custom js to end of footer on every page

I want to add a custom js file to all pages before the footer i want to pass script through phtml Is it possible to do this?
0
votes
3answers
40 views

i want to show a template before tabs

I want to show a template just before all tabs but it's not showing. my code on file catalog_product_view.xml : <referenceContainer name="product.info.detailed"> <block ...
0
votes
0answers
30 views

Display Product More Information In product Category Listing Page

i want to display product "More information" in catalog category page. I copy that code from /magento/module-catalog/view/frontend/templates/product/view/attributes.phtml <?php $...
0
votes
1answer
23 views

How to call displayProductStockStatus() method from a custom block?

in catalog_product_view.xml of my theme I have a block like this `<block class="Magento\Catalog\Block\Product\View" name="extra.product.info" template="product/view/extra-product-info.phtml" after=...
2
votes
1answer
28 views

How to access a variable declared in a phtml from another phtml?

I have inserted two blocks in the catalog_product_view.xml file: <block class="Magento\Catalog\Block\Product\View" name="product.info.custom-product-attributes" template="product/view/custom-...
1
vote
1answer
27 views

How to get the store code in a phtml file of Magento2?

In a custom phtml file I have to get the code associated to the store view (not the Id), any idea how to get this?
1
vote
0answers
13 views

How can I add a container div for each color of the swatch colors on the product page?

I am trying to add a container div for each color of the swatch colors to give it the look I need (configurable product, in PDP). I am adding the div in the following file that I inserted in my theme ....
1
vote
1answer
32 views

magento 2 how to add magestore slider in blog phtml file

Here I have a blog page there I wanted to display banner sliders. I configured the sliders they working fine in home page, but am unable to add in custom phtml(blog) page here is my blog Phtml file &...
1
vote
1answer
34 views

update message “ Your search returned no results. ” when no records found

I wanted to update message " Your search returned no results . " in magento2.But i am not getting directory file to change the message.I am new to magento2. Please let me know the exact file path ...
1
vote
2answers
36 views

Magento2.3: How to remove others in general at registration form?

In account registration form, we have a gender field, on that there are three options as Male, Female and Others. I want to remove Others in registration form. How can I remove that? Any help will ...
1
vote
1answer
82 views

How to add texts to payment step Onepage checkout page

Which file should i edit to add text underneath all the payment methods. ( I would like to add some return/refund policy). The URL is https://www.mywebsite.com/checkout/#payment
0
votes
0answers
20 views

Magento2.3: How to make a sticky header?

I have tried to make a sticky header but no success. I have followed many posts regarding this but none of them is working for my case. I have followed below link. Fixed Headers in Magento Any help ...
1
vote
0answers
26 views

How to Add an icon next to Payment Method for Amazon Pay?

I have looked up a few similar question but can't figure how. It's the default amazon pay module that came with Magento 2 I'm editing this file /var/www/html/vendor/amzn/amazon-pay-module/view/...
0
votes
1answer
34 views

Call store Switcher in phtml file directly in Magento 2

I want to call Store Switcher in phtml file directly. I tried to call directly but its not working. Kindly review. $this->getLayout() ->createBlock('Magento\Store\Block\Switcher') ...
0
votes
0answers
39 views

Magento 2.2 display brand logo product detail page

Please can someone provide step by step instructions or provide tutorial on how to display brand logo on product detail page above the add to cart button. Thanks
2
votes
2answers
72 views

Magento2.3: How to move the custom block in account navigation sidebar?

I want to show the customer profile pic and the name after he/she logged in on the account navigation sidebar. I have successfully got those details. Please see below. However, I want to show them ...
2
votes
1answer
59 views

Magento 2: How to get product by SKU in custom page?

I created a custom page, where users can input SKU of product and after they submit the button, its load product details, like name, image and a configurable option for configurable product. Here is ...
0
votes
0answers
29 views

Magento2.3: Cannot add a product to wish-list even after logged in

I'm facing an issue in adding the product to wish-list. I have logged-in the site but still can't add the product to wish-list. When checking the admin configuration, I see the wish-list is enabled ...
0
votes
2answers
54 views

Add custom row to Order View on Frontend Magento 2

I have my own custom discount, and on checkout I can use it. When I place the order, I see that grand total is changed, but me need to show discount. I want to paste it between subtotal and shipping.
1
vote
1answer
38 views

Can I change the extension from .HTML to .phtml?

I've got a custom payment module. I've .HTML checkout button page in this path. \app\code\vendorName\moduleName\view\frontend\web\template\payment\vendor.html Can i change .phtml instead of .HTML
0
votes
0answers
56 views

Magento2.3 - How to fix loop error in account dashboard?

We have implemented our own design into the My Account dashboard. When we do our implementation, we have added some lines of code in the file collapsible.phtml. The issue now we are facing is that one ...
1
vote
1answer
24 views

Magento2.3: How to customise the default search design in home page?

I want to customise the default search button in home page. We have the search as below screenshot and want to do that if we click the search icon it should open the input box below the search icon. ...
0
votes
2answers
54 views

Magento2.3: How to fix Undefined variable issue?

We are facing issues from the custom module which we have done for EMI calculator. The issue is when we try to load the category page from the megamenu, its throwing the below error: 1 exception(s): ...
0
votes
2answers
34 views

How can we split js file from phtml file

We currently have a large phtml file that is essentially a plain JavaScript file, eg., <?php // some conditional check. about 10 lines of code > <script> // here is 1000 lines of ...
0
votes
1answer
31 views

Dymanic Block based on Segments in phtml

I created 2 dynamic cms blocks in BE with different Customer Segment, How can I call to them from phtml file? Please note that dynamic cms block != cms block tried $block->getLayout()->...
0
votes
0answers
57 views

Magento 2.2 display swatch image on Product Page

Magento 2.2.2 I have in my view.phtml the following code /app/design/frontend/mytheme/shop/Magento_Catalog/templates/product view.phtml $img1 = $products->getResource()->getAttribute('...
0
votes
1answer
25 views

Magento2.3: Cannot open links in Myaccount dashboard

I'm implementing my own design to My Account dashboard. Unfortunately, I'm not able to open the Address Book and Address Information. When am clicking those links, I'm getting the below attached error....
0
votes
1answer
167 views

Magento 2 How to display Customer-Welcome in header link?

In the header links, I don't have "customer-welcome" on my website. Below is the screenshot taken from demo site. Please have a look at it. How can display the customer welcome on my website? Below ...
2
votes
1answer
168 views

Slick slider is not working properly in Magento2.3

I would like to use slick slider concept for compare products so I have implemented it on my Magento site. But It's not working as expected though the script has been loaded. I'm not sure where am I ...
0
votes
1answer
69 views

call phtml file in page builder in magento 2.3 enterprise

I want to call phtml file in static block that uses page builder in Magento 2 EE.
1
vote
1answer
37 views

How to change the CSS only for Myaccount page title?

I want to change the CSS only for the title of My Account page. I have added my custom class into the file title.phtml at the path module-theme/view/frontend/templates/html But it affects all the ...
0
votes
1answer
29 views

Changing the design of Myaccount page

We have designed My account page using HTML. Now we have to implement the same design on our website. In order to get the same design, where I have to modify the CSS? Could anyone please help me ...
1
vote
2answers
51 views

Magento2 - InstallData Cms Page with content from file

as the title suggests I'm creating a module that programmatically installs pages on cms_page, my problem arises when I want to load the contents of a phtml file and pass it as html into the array to ...
0
votes
2answers
26 views

Magento2: How to include js library + assets into static cms page via template?

i have a static page which was created via cms -> page. I include a custom phtml template within the cms page {{block class="Magento\Framework\View\Element\Template" name="test_file" template="...
0
votes
3answers
38 views

Can't get media image in the phtml file

I have a module that has a phtml file. I want to add an image from pub/media, but my attempts have been unsuccessful: pub / media / catalog / category / shutterstock_259609874 jpg I tried this, ...
0
votes
1answer
38 views

how to align the custom order option in magento 2 in product list page sort by options

how to align the custom order option in magento 2 in product list page sort by options ? how to set the custom order in attributes using Short by options ?
1
vote
1answer
33 views

Script executar apenas para algum manufacture

I want to make javascript at the end of the file run only if the product is not from the "hello-kitty" manufacturer but for that I need to somehow take the manufacturer of the product to store in a ...
6
votes
2answers
198 views

Magento 2: Pass variable from phtml to js

here is my layout <referenceContainer name="minicart.addons"> <block class="Vendor\Mymodule\Block\Cart\Sidebar" name="shipping_bar" template="Vendor_Mymodule::cart/minicart.phtml"> ...
0
votes
0answers
27 views

Get page title from another magento module

I use weltpixel to integrate with Google Tag Manager, but I have to get the page title and store the information, I have a phtml but I need to check how to use the correct magento lib and get it ...
0
votes
2answers
28 views

Magento 2 .focus() not working in template

I have this template: CODE PHTML: <div> Content // this line is OK </div> <script type="text/javascript"> require(['jquery'],function($){ $(window).load(function()...
1
vote
0answers
24 views

Magento 2.2.9 question about foreach data into popup modal

I am trying to do a popup modal with this information I have in an array. I have ID, NAME and DESCRIPTION So in a function, I have done foreach to gather all the information and i am showing it on ...
0
votes
1answer
16 views

how to check an array with cart price rule ID magento 2

I am trying to get Cart_Price_Rule. public function test() { $ruleArray = $this->adventCollectionFactory->create()->getData(); $ruleArray = array_column($ruleArray,'promo_rule_id')...
1
vote
0answers
58 views

Magento 2: Use Zend_Pdf easily while making PDF file

How to make a dynamic PDF easily while sending an email with this PDF attachment using Zend_Pdf because of this type of code $page->drawText(__("Image"), $x + 60, $this->y-10, 'UTF-8'); $...