Questions tagged [phtml]

Denotes questions related to template `.phtml` files

Filter by
Sorted by
Tagged with
0
votes
2answers
20 views

How to add Slick Slider

I want to add slick slider on my home page in magento using static block and phtml with rotating images. if anyone have idea about that then please answer my question as soon as possible. Thank you ...
0
votes
0answers
23 views

Show Multiple Select Attribute in a CMS Block

I want to show Multiple Select Attributes in a CMS Block. In the Block I used this code: {{block type="core/template" name="ausgezeichnet" template="Magento_Theme/templates/html/auszeichnungen.phtml"}...
1
vote
1answer
25 views

call a vendor function in custom module

I'm trying to create a custom module which will have GoogleSheet Import functionality. So I want to call varienImport.postToFrame() this function works when we click on Check Data option in existing ...
0
votes
2answers
27 views

How to call Static content block

I want to create static block in Magento 2.3.5 and call that block in footer content. please anyone can have idea then please share with me. Thank you in Advance.
0
votes
3answers
20 views

How to add default head block in default.xml

I want to add default head block in default.xml file. so if anyone have idea about it then please send me the solution.
0
votes
1answer
35 views

Want to Learn magento 2.3.5

I am Working as PHP Developer and want to learn about magento 2.3.5 from scratch so can anyone having material related to magento 2.3.5 then please send me for self learning and any demo of modules as ...
2
votes
1answer
33 views

Magento 2: Shopping Cart quantity doesnt update after custom Add to cart form is submitted

I have a custom Add to Cart button for bundled products. This is on my phtml for the /test-page : <?php /** @var Magento\Checkout\Helper\Cart $_checkoutCartHelper */ $_checkoutCartHelper = $this-&...
0
votes
0answers
6 views

How to create admin form and action for edit and delete in magento 2

I am developing one module for post data to be displayed on front-end and all posts can be add,edit,delete by admin. I want to use UI Component for that, so can anyone can have idea about how to ...
0
votes
0answers
20 views

Show related products with list style on product page in Magento 2?

I was able to show the related products on the product page inside the 'related product' tab. However, it is in grid style. I'm wondering if there is a way to show them with "list style" ( like the ...
0
votes
3answers
38 views

How to use for loop in PHTML page

How to use for loop in phtml page i want to use the for loop in phtml page to complete my functionality <php? for(i=1;1<=3;i++): //My code endfor: ?> I used as above code.
0
votes
1answer
18 views

Magento 2.3: How do I retrieve the product price in form.phtml file and assign it to an HTML attribute data-purchase-amount?

How do I retrieve the product price in form.phtml and assign it to an HTML attribute data-purchase-amount ="" as code snippet meant for Klarna tagline placement as seen in the file below. <div ...
0
votes
1answer
33 views

Magento 2: How to add a new phtml(template) to a layout file so I can use it in the head section?

I am trying to add a phtml template file to the layout file so that I can use this template in the head section to insert contents from an JS file. Please tell me what is the best way to do this?
0
votes
1answer
46 views

Magento 2: How to insert a custom JS file in the header of custom theme. This custom JS file is placed in pub/media/pmm-custom directory?

I'm looking for a way to add a custom js file in the header.phtml file. I don't place custom JS file under theme_directory for a obvious reason. Could anyone please tell me how to override header ...
0
votes
1answer
60 views

Magento 2: Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Perfectmirrors\PmmLayout\Block\Head

I am really not sure how to create the block class Pmm\PmmLayout\Block\Head , function of which $block->getAllPagesJSContent() should be called inside my phtml file pmm_head.phtml <...
1
vote
1answer
29 views

Magento 2: Why do I see an extra IMG tag beside the actual IMG intended for logo on the home screen?

as seen in the image below, my Magento site displays an IMG tag before the IMG tag meant for displaying logo on the homepage. Please tell me how to eliminate the first unwanted IMG tag logo-white.svg. ...
0
votes
1answer
26 views

Magento 2: How to get only the file name of Home Page Logo?

is there a way to only get the filename of an Homepage logo in the logo.phtml template file? $block->getLogoSrc() in logo.phtml returns the URL to the logo, but I need only the filename like someimage....
0
votes
1answer
15 views

Magento 2.3.4 - Call phtml file within CMS block

I'm trying to call the following phtml file into a CMS block. Phtml file location app/design/frontend/{Package}/{theme}/Magento_Newsletter/templates/subscribe_footer.phtml I tried using {{block ...
1
vote
1answer
31 views

Calling ReferenceContainer or ReferenceBlock into phtml file

I am trying to call Template into list.phtml, this file is categories list file, here is the ReferenceBlock and ReferenceContainer code in xml file. <page xmlns:xsi="http://www.w3.org/2001/...
1
vote
2answers
87 views

Magento 2: Custom module to override the logo.phtml file of the custom theme

Naming the custom module to override the logo.phtml file found at the path seen in the screenshot below a bit confusing to me as the module name is too long to decide on the naming. The vendor of the ...
0
votes
0answers
15 views

Redirecting when submitting a Contact Form

I have a Contact page on Magento 2. After I try submitting the Contact Form, it redirects me to the page website.com/contact/index/index/ saying the Captcha is incorrect. Then when I submit it there, ...
0
votes
0answers
15 views

How to pass data from model file to phtml file?

I want to pass collection from model file and then, get HTML into model file. How to do that? Please help me. Thanks.
0
votes
1answer
33 views

Magento 2 Add Anchor link in Notice, Error or Success Message

The link shows exactly how it is typed instead of an actual link. What am I missing? <div class="message notice"> <div> <?= $block->escapeHtml($block->getNoResultText(...
0
votes
4answers
67 views

How to get Magento 2 customer group ID

How to get Magento 2 customer group ID if user is logged in, in a .phtml file? I have already tried with: protected $_customerSession; public function __construct( \Magento\Customer\Model\...
0
votes
1answer
37 views

How to add button at top of Layered navigation Filter from custom module?

I have a phtml that contain button like this in my custom module : app/code/Vendor/Module/view/templates/button.phtml <button> <span> <?= __('New Button') ?> </span> </...
0
votes
1answer
22 views

How do I correctly move products and categories between stores in magento1?

I currently have a magento 1.9 installation which uses two stores. I'm at the moment trying to move a category (as well as the subcategories and products) from one store to the other but I'm running ...
0
votes
0answers
11 views

Add autocomplete=“on” to e-mail field at Checkout

For some reason, we need to add the tag autocomplete="off" to the e-mail field at checkout (/checkout/). So the current code: <input class="input-text mage-error" type="email" data-bind="...
0
votes
1answer
54 views

Magento 2: How to pass object as a argument from phtml

I want to pass object as a argument from phtml file how can I do this? As I've checked we can pass string using $block->setData('var','test') but didn't found for object.
0
votes
0answers
12 views

How to trigger an event that selects all the select attribute entries with the same value

magento 1.9 I want to do a function (maybe it is possible with js, but I'm not good at it yet) that after a customer selects an entry - IN THE FIRST MOMENT - in the select field "UNIDADE" all the ...
0
votes
1answer
32 views

Magento 2 override product list.phtml

I want to override product list.phtml and in my layout file catalog_category_veiw.xml i tried many methods but still not able to call my templates file <referenceBlock name="category.products.list"...
0
votes
0answers
19 views

In checkout page while I'm switching the address the shipping method is not get updated Is there any way to fix the issue?

In checkout page while I'm switching the address the shipping method is not get updated Is there any way to fix the issue ?
0
votes
0answers
11 views

Magento 2 Shipping Form Fields Column Layout

Default Porto Theme Magento Layout for Shipping Page We need to make it look like this: Make fields 3 column instead of 1 column. Bring Phone filed above and next to the Email field. I have tried ...
1
vote
0answers
23 views

Save product-attribute value

How to save attribute value into DB from a phtml ? ie, Phtml contains a custom input field which is rendered in the admin product edit page under a custom tab. The value entered in the input field ...
0
votes
0answers
32 views

Magento2 - Category filter is not working for all product list

Magento2 - Category filter is not working for all product list Issues page
0
votes
0answers
23 views

No output from catalog/view/frontend/templates/category/description.phtml in M 2.3.4

We don't get any category descriptions on category pages in Magento 2.3.4. The /vendor/magento/module-catalog/view/frontend/templates/category/description.phtml file is loading in frontend (see ...
0
votes
1answer
95 views

Error filtering template: Invalid template file in module

I have this issue and I don't know how to solve it. My phtml file is under: app/design/frontend/rwd/josefsteiner/template/home.phtml and i tried to include this phtml file into my CMS site like ...
1
vote
0answers
18 views

Template notations in magento

I was working with the Algolia search module in Magento 2 and foud something like below in the template files. Can anybody let me know what this notation is called and where can I learn more about ...
0
votes
0answers
25 views

Use Magento UI Form Component Outside Of Form? (Product Category Selector)

I need to use the Product Category Chooser: But not inside of a usual UI Component form. Is this possible? Basically I want to call it from a .phtml file for a custom admin page I'm building.
0
votes
1answer
41 views

Magento 2 How to call template file in block file

My block file form.php and I want to call phtml file in this block to display table in this custom admin form, I have no created a layout for this phtml file, if is there any other way to display the ...
0
votes
3answers
56 views

How can i get phtml file in helper magento 2?

I have tried this solution but it is not working $this->_layout->createBlock('Vendor\Module\Block\Productdesigner'); $response = $layout->setData(array("customer_data" => $result))...
0
votes
1answer
37 views

Modification to .phtml does not render

In content/page homepage I insert a widget from the porto theme: {{block class="Smartwave\Filterproducts\Block\Home\LatestList" name="latest_product" product_type="4" product_count="50" category_id="...
1
vote
1answer
176 views

How to get current page number from url in Magento 2

I want to check the page number which appears in a URL in a phtml file. For example, if the URL is: http://localhost/magento/index.php/shop.html?p=4 How can I get the value 4 in the .phtml file? ...
0
votes
1answer
37 views

Convert Magento 1 PHTML Code to Magento 2

I have a template from a customer's Magento 1 theme that I need to move to M2. The theme isn't the same but the template does what I need it to on M1 and I need this in Magento 2. <ul class="...
1
vote
0answers
151 views

Magento 2 : Firefox javascript update not working

I am trying to create buttons to either add or remove 1 item of a certain type from the shopping cart. In my search I found some code online that works great for Chrome but appears to not work on ...
0
votes
1answer
37 views

Changing phtml file via /app

In a previous question i asked where to find items.phtml file. I found it and did the configuration and it worked. But when i did this it was via this path: vendor/magento/module-shipping/view/...
0
votes
1answer
39 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
40 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
53 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
71 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
78 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 ==...

1
2 3 4 5
13